From 46f57c2812ffe21d8fb2a6395d9bbb2c3c39ca02 Mon Sep 17 00:00:00 2001 From: sgade-reisys Date: Thu, 7 Sep 2023 08:17:30 -0400 Subject: [PATCH] NYCCHKBK-12891: Drupal 9 release --- .editorconfig | 17 - .gitattributes | 49 - .gitignore | 38 - .travis.yml | 16 - CODE_OF_CONDUCT.md | 100 - INSTALL.md | 617 --- README.md | 60 - SOLR-INSTALL.md | 132 - .../functional/NYCAutomationTest/pom.xml | 86 - .../modules/contrib/metatag/.codeclimate.yml | 25 - .../all/modules/contrib/metatag/.csslintrc | 2 - .../all/modules/contrib/metatag/.eslintignore | 1 - .../all/modules/contrib/metatag/.eslintrc | 213 -- .../all/modules/contrib/metatag/CHANGELOG.txt | 1214 ------ .../contrib/metatag/CODE_OF_CONDUCT.txt | 3 - .../all/modules/contrib/metatag/LICENSE.txt | 339 -- .../all/modules/contrib/metatag/README.txt | 419 --- .../modules/contrib/metatag/arrow-down.png | Bin 140 -> 0 bytes .../modules/contrib/metatag/arrow-right.png | Bin 139 -> 0 bytes .../modules/contrib/metatag/metatag.admin.css | 88 - .../modules/contrib/metatag/metatag.admin.inc | 858 ----- .../modules/contrib/metatag/metatag.admin.js | 48 - .../modules/contrib/metatag/metatag.api.php | 482 --- .../modules/contrib/metatag/metatag.drush.inc | 22 - .../contrib/metatag/metatag.features.inc | 98 - .../modules/contrib/metatag/metatag.feeds.inc | 73 - .../modules/contrib/metatag/metatag.i18n.inc | 147 - .../all/modules/contrib/metatag/metatag.inc | 777 ---- .../all/modules/contrib/metatag/metatag.info | 113 - .../modules/contrib/metatag/metatag.install | 2624 ------------- .../contrib/metatag/metatag.metatag.inc | 502 --- .../contrib/metatag/metatag.migrate.inc | 130 - .../modules/contrib/metatag/metatag.module | 3307 ----------------- .../contrib/metatag/metatag.search_api.inc | 116 - .../modules/contrib/metatag/metatag.theme.inc | 91 - .../contrib/metatag/metatag.tokens.inc | 317 -- .../contrib/metatag/metatag.variable.inc | 60 - .../contrib/metatag/metatag.vertical-tabs.js | 58 - .../metatag/metatag_app_links/README.txt | 40 - .../metatag_app_links/metatag_app_links.info | 14 - .../metatag_app_links.metatag.inc | 163 - .../metatag_app_links.module | 15 - .../tests/MetatagAppLinksTagsTest.test | 90 - .../metatag/metatag_context/README.txt | 31 - .../metatag_context/metatag_context.admin.inc | 261 -- .../metatag_context.context.inc | 349 -- .../metatag_context/metatag_context.i18n.inc | 132 - .../metatag_context/metatag_context.info | 19 - .../metatag_context/metatag_context.install | 14 - .../metatag_context.metatag.inc | 14 - .../metatag_context/metatag_context.module | 133 - .../tests/MetatagContextTest.test | 114 - .../tests/MetatagContextWithI18nTest.test | 144 - .../tests/metatag_context_tests.context.inc | 57 - .../tests/metatag_context_tests.info | 16 - .../tests/metatag_context_tests.module | 36 - .../contrib/metatag/metatag_dc/README.txt | 37 - .../metatag/metatag_dc/metatag_dc.info | 14 - .../metatag/metatag_dc/metatag_dc.install | 22 - .../metatag/metatag_dc/metatag_dc.metatag.inc | 215 -- .../metatag/metatag_dc/metatag_dc.module | 41 - .../metatag_dc/tests/MetatagDcTagsTest.test | 82 - .../metatag/metatag_dc_advanced/README.txt | 52 - .../metatag_dc_advanced.info | 15 - .../metatag_dc_advanced.metatag.inc | 271 -- .../metatag_dc_advanced.module | 15 - .../tests/MetatagDcAdvancedTagsTest.test | 86 - .../metatag/metatag_devel/metatag_devel.info | 15 - .../metatag_devel/metatag_devel.module | 182 - .../metatag_devel/tests/MetatagDevelTest.test | 49 - .../metatag_facebook/metatag_facebook.info | 14 - .../metatag_facebook/metatag_facebook.install | 6 - .../metatag_facebook.metatag.inc | 65 - .../metatag_facebook/metatag_facebook.module | 34 - .../tests/MetatagFacebookTagsTest.test | 54 - .../metatag_favicons/metatag_favicons.info | 17 - .../metatag_favicons/metatag_favicons.install | 17 - .../metatag_favicons.mask-icon.class.inc | 105 - .../metatag_favicons.metatag.inc | 282 -- .../metatag_favicons/metatag_favicons.module | 168 - .../tests/MetatagFaviconsTagsTest.test | 437 --- .../tests/druplicon-vector.svg | 109 - .../metatag/metatag_google_cse/README.txt | 22 - .../metatag_google_cse.info | 14 - .../metatag_google_cse.install | 6 - .../metatag_google_cse.metatag.inc | 63 - .../metatag_google_cse.module | 48 - .../tests/MetatagGoogleCseTagsTest.test | 58 - .../metatag/metatag_google_plus/README.txt | 45 - .../metatag_google_plus.inc | 30 - .../metatag_google_plus.info | 17 - .../metatag_google_plus.install | 33 - .../metatag_google_plus.metatag.inc | 146 - .../metatag_google_plus.module | 67 - .../tests/MetatagGooglePlusTagsTest.test | 123 - .../metatag/metatag_hreflang/README.txt | 39 - .../metatag_hreflang/metatag_hreflang.info | 23 - .../metatag_hreflang/metatag_hreflang.install | 71 - .../metatag_hreflang.metatag.inc | 97 - .../metatag_hreflang/metatag_hreflang.module | 86 - .../metatag_hreflang.tokens.inc | 118 - .../tests/MetatagHreflangTagsTest.test | 114 - ...atagHreflangWithEntityTranslationTest.test | 283 -- .../metatag/metatag_importer/README.txt | 51 - .../metatag_importer.admin.inc | 19 - .../metatag_importer.drush.inc | 94 - .../metatag_importer/metatag_importer.info | 18 - .../metatag_importer.metatags_quick.inc | 225 -- .../metatag_importer/metatag_importer.module | 42 - .../metatag_importer.nodewords.inc | 581 --- .../metatag_importer.page_title.inc | 140 - .../tests/MetatagImporterTest.test | 49 - .../contrib/metatag/metatag_mobile/README.txt | 91 - .../metatag_mobile/metatag_mobile.info | 14 - .../metatag_mobile/metatag_mobile.metatag.inc | 310 -- .../metatag_mobile/metatag_mobile.module | 91 - .../tests/MetatagMobileTagsTest.test | 226 -- .../metatag_opengraph/metatag_opengraph.info | 14 - .../metatag_opengraph.install | 120 - .../metatag_opengraph.metatag.inc | 639 ---- .../metatag_opengraph.module | 76 - .../tests/MetatagOpenGraphTagsTest.test | 185 - .../metatag_opengraph_products.info | 15 - .../metatag_opengraph_products.metatag.inc | 165 - .../metatag_opengraph_products.module | 15 - .../MetatagOpenGraphProductsTagsTest.test | 89 - .../contrib/metatag/metatag_panels/README.txt | 27 - .../metatag_panels/metatag_panels.i18n.inc | 127 - .../metatag_panels/metatag_panels.info | 17 - .../metatag_panels/metatag_panels.metatag.inc | 14 - .../metatag_panels/metatag_panels.module | 259 -- .../tests/MetatagPanelsI18nTest.test | 110 - .../tests/MetatagPanelsTest.test | 67 - .../tests/metatag_panels_tests.info | 17 - .../tests/metatag_panels_tests.module | 15 - .../metatag_panels_tests.pages_default.inc | 130 - .../metatag_pinterest/metatag_pinterest.info | 14 - .../metatag_pinterest.metatag.inc | 72 - .../metatag_pinterest.module | 15 - .../tests/MetatagPinterestTagsTest.test | 75 - .../metatag/metatag_twitter_cards/README.txt | 46 - .../metatag_twitter_cards.info | 14 - .../metatag_twitter_cards.install | 59 - .../metatag_twitter_cards.metatag.inc | 438 --- .../metatag_twitter_cards.module | 40 - .../tests/MetatagTwitterCardsTagsTest.test | 144 - .../metatag/metatag_verification/README.txt | 16 - .../metatag_verification.info | 14 - .../metatag_verification.install | 26 - .../metatag_verification.metatag.inc | 79 - .../metatag_verification.module | 15 - .../tests/MetatagVerificationTagsTest.test | 57 - .../contrib/metatag/metatag_views/README.txt | 16 - .../metatag_views/metatag_views.i18n.inc | 101 - .../metatag/metatag_views/metatag_views.inc | 26 - .../metatag/metatag_views/metatag_views.info | 20 - .../metatag_views/metatag_views.install | 55 - .../metatag_views/metatag_views.metatag.inc | 34 - .../metatag_views/metatag_views.module | 172 - .../metatag_views/metatag_views.tokens.inc | 102 - .../metatag_views/metatag_views.views.inc | 22 - ...views_plugin_display_extender_metatags.inc | 180 - .../tests/MetatagViewsI18nTest.test | 107 - .../metatag_views/tests/MetatagViewsTest.test | 61 - .../tests/metatag_views_tests.info | 16 - .../tests/metatag_views_tests.module | 13 - .../metatag_views_tests.views_default.inc | 453 --- .../content_types/node_form_metatags.inc | 75 - .../metatag/tests/MetatagBulkRevertTest.test | 56 - .../metatag/tests/MetatagCoreImageTest.test | 491 --- .../metatag/tests/MetatagCoreLocaleTest.test | 157 - .../metatag/tests/MetatagCoreNodeTest.test | 450 --- .../tests/MetatagCoreNodeWithI18nTest.test | 118 - .../tests/MetatagCoreOutputCachingTest.test | 127 - .../tests/MetatagCoreStringHandlingTest.test | 374 -- ...MetatagCoreStringHandlingWithI18nTest.test | 32 - .../tests/MetatagCoreTagRemovalTest.test | 78 - .../metatag/tests/MetatagCoreTermTest.test | 169 - .../tests/MetatagCoreTermWithI18nTest.test | 118 - .../metatag/tests/MetatagCoreUnitTest.test | 147 - .../metatag/tests/MetatagCoreUserTest.test | 94 - .../tests/MetatagCoreWithI18nConfigTest.test | 331 -- .../MetatagCoreWithI18nDisabledTest.test | 105 - .../tests/MetatagCoreWithI18nOutputTest.test | 185 - .../metatag/tests/MetatagCoreWithMeTest.test | 73 - .../tests/MetatagCoreWithMediaTest.test | 240 -- .../tests/MetatagCoreWithPanelsTest.test | 183 - .../tests/MetatagCoreWithProfile2Test.test | 133 - .../tests/MetatagCoreWithSearchApiTest.test | 139 - .../tests/MetatagCoreWithViewsTest.test | 191 - ...etatagCoreWithWorkbenchModerationTest.test | 117 - .../metatag/tests/MetatagCoreXSSTest.test | 210 -- .../metatag/tests/MetatagTagsTest.test | 299 -- .../metatag/tests/MetatagTagsTestBase.test | 283 -- .../metatag/tests/MetatagTestBase.test | 772 ---- .../metatag/tests/metatag_search_test.info | 15 - .../metatag/tests/metatag_search_test.module | 48 - .../contrib/metatag/tests/metatag_test.info | 14 - .../metatag/tests/metatag_test.metatag.inc | 70 - .../contrib/metatag/tests/metatag_test.module | 73 - .../modules/contrib/site_verify/LICENSE.txt | 339 -- .../contrib/site_verify/site_verify.admin.inc | 323 -- .../contrib/site_verify/site_verify.api.php | 44 - .../contrib/site_verify/site_verify.info | 15 - .../contrib/site_verify/site_verify.install | 130 - .../contrib/site_verify/site_verify.module | 218 -- .../contrib/site_verify/site_verify.test | 49 - .../modules/contrib/xmlsitemap/LICENSE.txt | 339 -- .../all/modules/contrib/xmlsitemap/README.txt | 111 - .../contrib/xmlsitemap/xmlsitemap.admin.inc | 913 ----- .../contrib/xmlsitemap/xmlsitemap.api.php | 319 -- .../contrib/xmlsitemap/xmlsitemap.drush.inc | 181 - .../xmlsitemap/xmlsitemap.generate.inc | 584 --- .../modules/contrib/xmlsitemap/xmlsitemap.inc | 92 - .../contrib/xmlsitemap/xmlsitemap.info | 15 - .../contrib/xmlsitemap/xmlsitemap.install | 586 --- .../modules/contrib/xmlsitemap/xmlsitemap.js | 22 - .../contrib/xmlsitemap/xmlsitemap.module | 1729 --------- .../contrib/xmlsitemap/xmlsitemap.pages.inc | 161 - .../contrib/xmlsitemap/xmlsitemap.test | 962 ----- .../xmlsitemap/xmlsitemap.xmlsitemap.inc | 394 -- .../xmlsitemap/xmlsitemap_custom/README.txt | 76 - .../xmlsitemap_custom.admin.inc | 220 -- .../xmlsitemap_custom/xmlsitemap_custom.info | 13 - .../xmlsitemap_custom.install | 14 - .../xmlsitemap_custom.module | 68 - .../xmlsitemap_custom/xmlsitemap_custom.test | 132 - .../xmlsitemap/xmlsitemap_engines/README.txt | 79 - .../tests/xmlsitemap_engines.test | 180 - .../tests/xmlsitemap_engines_test.info | 11 - .../tests/xmlsitemap_engines_test.module | 51 - .../xmlsitemap_engines.admin.inc | 82 - .../xmlsitemap_engines.api.php | 34 - .../xmlsitemap_engines.info | 14 - .../xmlsitemap_engines.install | 45 - .../xmlsitemap_engines.module | 257 -- .../xmlsitemap_i18n/xmlsitemap_i18n.info | 13 - .../xmlsitemap_i18n/xmlsitemap_i18n.module | 126 - .../xmlsitemap_i18n/xmlsitemap_i18n.test | 176 - .../xmlsitemap/xmlsitemap_menu/README.txt | 79 - .../xmlsitemap_menu/xmlsitemap_menu.info | 13 - .../xmlsitemap_menu/xmlsitemap_menu.install | 47 - .../xmlsitemap_menu/xmlsitemap_menu.module | 329 -- .../xmlsitemap_menu/xmlsitemap_menu.test | 78 - .../xmlsitemap_modal/xmlsitemap_modal.info | 13 - .../xmlsitemap_modal/xmlsitemap_modal.module | 86 - .../xmlsitemap/xmlsitemap_node/README.txt | 81 - .../xmlsitemap_node/xmlsitemap_node.info | 12 - .../xmlsitemap_node/xmlsitemap_node.install | 44 - .../xmlsitemap_node/xmlsitemap_node.module | 392 -- .../xmlsitemap_node/xmlsitemap_node.test | 228 -- .../xmlsitemap/xmlsitemap_taxonomy/README.txt | 83 - .../xmlsitemap_taxonomy.info | 13 - .../xmlsitemap_taxonomy.install | 66 - .../xmlsitemap_taxonomy.module | 296 -- .../xmlsitemap_taxonomy.test | 78 - .../xmlsitemap/xmlsitemap_user/README.txt | 82 - .../xmlsitemap_user/xmlsitemap_user.info | 12 - .../xmlsitemap_user/xmlsitemap_user.install | 43 - .../xmlsitemap_user/xmlsitemap_user.module | 168 - .../xmlsitemap_user/xmlsitemap_user.test | 84 - .../xmlsitemap/xsl/jquery.tablesorter.js | 854 ----- .../xmlsitemap/xsl/jquery.tablesorter.min.js | 2 - .../contrib/xmlsitemap/xsl/xmlsitemap.xsl | 138 - .../contrib/xmlsitemap/xsl/xmlsitemap.xsl.css | 46 - .../contrib/xmlsitemap/xsl/xmlsitemap.xsl.js | 45 - .../checkbook_datafeeds.module | 2112 ----------- .../checkbook_etl_status.info | 30 - .../checkbook_etl_status.install | 19 - .../checkbook_etl_status.module | 78 - .../smart_search_filter.tpl.php | 242 -- .../themes/checkbook3/templates/html.tpl.php | 26 - 272 files changed, 46348 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .gitattributes delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 INSTALL.md delete mode 100644 README.md delete mode 100644 SOLR-INSTALL.md delete mode 100644 source/tests/functional/NYCAutomationTest/pom.xml delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/.codeclimate.yml delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/.csslintrc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/.eslintignore delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/.eslintrc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/CHANGELOG.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/CODE_OF_CONDUCT.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/LICENSE.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/arrow-down.png delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/arrow-right.png delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.admin.css delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.admin.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.admin.js delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.api.php delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.drush.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.features.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.feeds.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.i18n.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.migrate.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.search_api.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.theme.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.tokens.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.variable.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag.vertical-tabs.js delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_app_links/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_app_links/metatag_app_links.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_app_links/metatag_app_links.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_app_links/metatag_app_links.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_app_links/tests/MetatagAppLinksTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/metatag_context.admin.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/metatag_context.context.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/metatag_context.i18n.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/metatag_context.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/metatag_context.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/metatag_context.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/metatag_context.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/tests/MetatagContextTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/tests/MetatagContextWithI18nTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/tests/metatag_context_tests.context.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/tests/metatag_context_tests.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_context/tests/metatag_context_tests.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc/metatag_dc.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc/metatag_dc.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc/metatag_dc.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc/metatag_dc.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc/tests/MetatagDcTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc_advanced/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc_advanced/metatag_dc_advanced.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc_advanced/metatag_dc_advanced.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc_advanced/metatag_dc_advanced.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_dc_advanced/tests/MetatagDcAdvancedTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_devel/metatag_devel.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_devel/metatag_devel.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_devel/tests/MetatagDevelTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_facebook/metatag_facebook.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_facebook/metatag_facebook.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_facebook/metatag_facebook.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_facebook/metatag_facebook.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_facebook/tests/MetatagFacebookTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_favicons/metatag_favicons.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_favicons/metatag_favicons.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_favicons/metatag_favicons.mask-icon.class.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_favicons/metatag_favicons.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_favicons/metatag_favicons.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_favicons/tests/MetatagFaviconsTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_favicons/tests/druplicon-vector.svg delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_cse/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_cse/metatag_google_cse.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_cse/metatag_google_cse.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_cse/metatag_google_cse.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_cse/metatag_google_cse.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_cse/tests/MetatagGoogleCseTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_plus/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_plus/metatag_google_plus.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_plus/metatag_google_plus.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_plus/metatag_google_plus.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_plus/metatag_google_plus.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_plus/metatag_google_plus.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_google_plus/tests/MetatagGooglePlusTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/metatag_hreflang.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/metatag_hreflang.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/metatag_hreflang.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/metatag_hreflang.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/metatag_hreflang.tokens.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/tests/MetatagHreflangTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_hreflang/tests/MetatagHreflangWithEntityTranslationTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/metatag_importer.admin.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/metatag_importer.drush.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/metatag_importer.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/metatag_importer.metatags_quick.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/metatag_importer.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/metatag_importer.nodewords.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/metatag_importer.page_title.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_importer/tests/MetatagImporterTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_mobile/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_mobile/metatag_mobile.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_mobile/metatag_mobile.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_mobile/metatag_mobile.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_mobile/tests/MetatagMobileTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph/metatag_opengraph.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph/metatag_opengraph.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph/metatag_opengraph.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph/metatag_opengraph.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph/tests/MetatagOpenGraphTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph_products/metatag_opengraph_products.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph_products/metatag_opengraph_products.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph_products/metatag_opengraph_products.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_opengraph_products/tests/MetatagOpenGraphProductsTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/metatag_panels.i18n.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/metatag_panels.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/metatag_panels.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/metatag_panels.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/tests/MetatagPanelsI18nTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/tests/MetatagPanelsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/tests/metatag_panels_tests.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/tests/metatag_panels_tests.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_panels/tests/metatag_panels_tests.pages_default.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_pinterest/metatag_pinterest.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_pinterest/metatag_pinterest.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_pinterest/metatag_pinterest.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_pinterest/tests/MetatagPinterestTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_twitter_cards/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_twitter_cards/metatag_twitter_cards.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_twitter_cards/metatag_twitter_cards.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_twitter_cards/metatag_twitter_cards.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_twitter_cards/metatag_twitter_cards.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_twitter_cards/tests/MetatagTwitterCardsTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_verification/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_verification/metatag_verification.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_verification/metatag_verification.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_verification/metatag_verification.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_verification/metatag_verification.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_verification/tests/MetatagVerificationTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.i18n.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.install delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.tokens.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views.views.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/metatag_views_plugin_display_extender_metatags.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/tests/MetatagViewsI18nTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/tests/MetatagViewsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/tests/metatag_views_tests.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/tests/metatag_views_tests.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/metatag_views/tests/metatag_views_tests.views_default.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/plugins/content_types/node_form_metatags.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagBulkRevertTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreImageTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreLocaleTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreNodeTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreNodeWithI18nTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreOutputCachingTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreStringHandlingTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreStringHandlingWithI18nTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTagRemovalTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermWithI18nTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUnitTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUserTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nConfigTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nDisabledTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nOutputTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMeTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMediaTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithPanelsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithProfile2Test.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithSearchApiTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithViewsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithWorkbenchModerationTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreXSSTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTest.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTestBase.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTestBase.test delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.module delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.info delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.metatag.inc delete mode 100644 source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.module delete mode 100644 source/webapp/sites/all/modules/contrib/site_verify/LICENSE.txt delete mode 100644 source/webapp/sites/all/modules/contrib/site_verify/site_verify.admin.inc delete mode 100644 source/webapp/sites/all/modules/contrib/site_verify/site_verify.api.php delete mode 100644 source/webapp/sites/all/modules/contrib/site_verify/site_verify.info delete mode 100644 source/webapp/sites/all/modules/contrib/site_verify/site_verify.install delete mode 100755 source/webapp/sites/all/modules/contrib/site_verify/site_verify.module delete mode 100644 source/webapp/sites/all/modules/contrib/site_verify/site_verify.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/LICENSE.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.admin.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.api.php delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.drush.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.generate.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.install delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.js delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.pages.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.xmlsitemap.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.install delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.admin.inc delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.api.php delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.install delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.install delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/README.txt delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.install delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.test delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.js delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.min.js delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.css delete mode 100644 source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.js delete mode 100644 source/webapp/sites/all/modules/custom/checkbook_datafeeds/checkbook_datafeeds.module delete mode 100644 source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.info delete mode 100644 source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.install delete mode 100644 source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.module delete mode 100644 source/webapp/sites/all/modules/custom/checkbook_faceted_search/smart_search_filter.tpl.php delete mode 100644 source/webapp/sites/all/themes/checkbook3/templates/html.tpl.php diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 4e8fbc6a1e..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,17 +0,0 @@ -# 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 - -[*.{php,module,inc}] -indent_size = 4 diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 4726a91157..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -# 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`. - -# Auto-detect text files, ensure they use LF. -* text=auto eol=lf - -# -# The above will handle all files NOT found below -# - -# Documents -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain -*.md text -*.adoc text -*.textile text -*.mustache text -*.csv text -*.tab text -*.tsv text -*.sql text eol=lf - -# Graphics -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.tif binary -*.tiff binary -*.ico binary -# SVG treated as an asset (binary) by default. If you want to treat it as text, -# comment-out the following line and uncomment the line after. -*.svg binary -#*.svg text -*.eps binary diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 8212278106..0000000000 --- a/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# Ignore directories generated by Composer -/source/drush/contrib/ -/source/vendor/ -/source/web/core/ -/source/web/modules/contrib/ -/source/web/themes/contrib/ -/source/web/profiles/contrib/ -/source/web/libraries/ -/source/web/private/ - -# Ignore sensitive information -/source/web/sites/*/settings.php -/source/web/sites/*/settings.local.php - -# Ignore Drupal's file directory -/source/web/sites/*/files/ -/source/web/themes/custom/checkbook3/node_modules/ - -#Ignore Highchart Library -/source/web/modules/custom/widget_framework/widget_highcharts/Highcharts-Stock-10.0.0/ - -# Ignore SimpleTest multi-site environment. -/source/web/sites/simpletest - -# Ignore files generated by PhpStorm -/.idea - -# Ignore .env files as they are personal -/.env - -# Place for custom Drush config -/source/web/sites/all/drush - -### macOS ### -# General -.DS_Store -.AppleDouble -.LSOverride diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 65a05c28c7..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php -php: - - '7.2' - - '7.3' - - '7.4' - - 'nightly' - -git: - depth: 3 - -before_script: - - phpenv versions - - phpenv config-rm xdebug.ini || echo "xdebug not available" - -script: - - phpunit --no-logging diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 5451c81d7f..0000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,100 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for -everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity -and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, -color, religion, or sexual identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our community include: - - Demonstrating empathy and kindness toward other people - Being respectful of differing opinions, viewpoints, and experiences - Giving and gracefully accepting constructive feedback - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience - Focusing on what is best not just for us as individuals, but for the overall community - -Examples of unacceptable behavior include: - - The use of sexualized language or imagery, and sexual attention or advances of any kind - Trolling, insulting or derogatory comments, and personal or political attacks - Public or private harassment - Publishing others’ private information, such as a physical or email address, without their explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting - - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior -and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, -threatening, offensive, or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, -issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for -moderation decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing -the community in public spaces. Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed representative at an online or offline event. - -## Enforcement - - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible -for enforcement at action@comptroller.nyc.gov. All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem -in violation of this Code of Conduct: - -1. Correction - -Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. - -Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and -an explanation of why the behavior was inappropriate. A public apology may be requested. - -2. Warning - -Community Impact: A violation through a single incident or series of actions. - -Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including -unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding -interactions in community spaces as well as external channels like social media. Violating these terms may lead to a -temporary or permanent ban. - -3. Temporary Ban - -Community Impact: A serious violation of community standards, including sustained inappropriate behavior. - -Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified -period of time. No public or private interaction with the people involved, including unsolicited interaction with those -enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. - -4. Permanent Ban - -Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, -harassment of an individual, or aggression toward or disparagement of classes of individuals. - -Consequence: A permanent ban from any sort of public interaction within the community. - - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 2.1, -available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. - -Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder. - -For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. -Translations are available at https://www.contributor-covenant.org/translations. \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index 7676165297..0000000000 --- a/INSTALL.md +++ /dev/null @@ -1,617 +0,0 @@ -Checkbook NYC Installation -========================== - -Table of contents: - - * Introduction - * Requirements - * Optional configuration for scalability and performance - * Installation - * Troubleshooting - -Introduction ------------- - -Our goal is for Checkbook NYC to be easily deployable by any city or -other entity that wants to offer a financial transparency dashboard. -The level of IT expertise required to deploy Checkbook NYC should be -about the same as that required to run, say, a Drupal site or other -LAMP-stack open source application suite. - -The Checkbook deployment process is getting closer to that ideal, but -it is not there yet. We know that more work is needed to smooth and -standardize deployment, and we are conducting that work in the open, -with participation from all interested parties. The code's authors, -who are intimately familiar with every step of the process, naturally -can and do regularly deploy production instances to - -- but various improvements need to be made -to these instructions before that process is equally easy for -newcomers. - -We therefore ask for your patience *and your help* to make those -improvements. As you try out Checkbook, please stay in contact with -the project, asking questions and making suggestions. There is no -better source of information than feedback from people doing -deployment in the wild. Contact the project by reporting bugs and -submitting pull requests at , -and by joining us in the Checkbook NYC technical discussion forum at - (you do not need to -be subscribed to post there, though we recommend you subscribe if -you're interested in following Checkbook development). - -Requirements -------------- - -Please note that unlike most Drupal-based applications, Checkbook uses -two separate databases simultaneously: - - * MySQL/MariaDB for the application itself (essentially Drupal + some modules) - * PostgreSQL for the financial data (usually much larger than the app) - -The full list of dependencies is: - - * GNU/Linux or similar operating system - * Drupal 9.5 _(Note: Checkbook includes Drupal, so you don't need to download Drupal separately.)_ - * PHP 8.1.6 or higher with the following extensions enabled: - - PHP Intl extension () - - PHP PostgreSQL extension () - * MySQL 5.7.8 or higher () or - MariaDB 10.3.7 or higher () - * PostgreSQL 9.2 or higher () -- other - data warehouse products derived from PostgreSQL (e.g. Greenplum Database, - Amazon Redshift) are also compatible for storing Checkbook data - * psql client (PostgreSQL command line interface) - * Apache HTTPD 2.4.7 or higher with mod_rewrite enabled - * Solr 7.4.x search platform () - * Drush 11.x (Drupal command-line scripting tool) - -The Checkbook distribution includes the Drupal source tree, along with -additional (non-core) custom and contributed Drupal modules used by -Checkbook. The distribution also includes some SQL data required for -setup: a Drupal database that is loaded into MySQL as part of -installation, which is described in more detail later in this file. - -Optional configuration for scalability and performance ------------------------------------------------------- - -These instructions assume you're deploying Checkbook on a single -server, that is, where httpd, the databases, and Solr are all running -on a single instance. - -While this is okay for test deployments, in production you might want -to divide services among multiple instances, and (for example) use: - - * A load balancer for distributing requests across multiple instances. - * Varnish or any other reverse proxy cache for caching last access pages. - * PGPool for distributing load across multiple PostgreSQL databases. - -If you are configuring for scalability and performance in this way, -then parts of the instructions below will need adjustment, of course. - -Installation ------------- - -We assume that a GNU/Linux server with basic system utilities is installed. -The following assumptions are also made about the installation: - - * The webroot is `/var/www/html` - (It could be somewhere else; `/var/www/html` is just the standard location - we use in these instructions.) - -The initial installation of the GNU/Linux server with LAMP stack takes on average 20 minutes. - -Steps to install: - -1. Make sure the right ports are open on your server. - - Ports 80 and 8080 will need to be opened. If you plan to SSH in to - the server to do the rest of this installation, you'll also need port - 22 open for SSH. - - (Note that if you're deploying on Amazon Web Services, port 22 may - not be open by default; you would typically open it up via the AWS - security group.) - -2. Ensure you have the necessary dependencies installed. - - On Ubuntu 22.04, you can install the necessary packages like this - (Debian GNU/Linux should be pretty similar): - - $ sudo apt-get update - $ sudo apt-get install apache2 php8.1 php8.1-gd php8.1-intl php8.1-mysql php8.1-pgsql - $ sudo apt-get install mysql-server - $ sudo apt-get install postgresql - $ sudo apt-get install postgresql-client - $ sudo apt-get install postgresql-contrib - $ sudo apt-get install git - $ sudo apt-get install apache2 - $ sudo apt-get install openjdk-6-jre-headless - $ sudo apt-get install zip - - On CentOS 6.4 (Red Hat RHEL should similar), it's this: - - $ sudo yum install php.x86_64 - $ sudo yum install php-gd.x86_64 - $ sudo yum install php-intl.x86_64 - $ sudo yum install php-mysql.x86_64 - $ sudo yum install php-pgsql.x86_64 - $ sudo yum install php-xml - $ sudo yum install mysql-server.x86_64 - $ sudo yum install git.x86_64 - $ sudo yum install httpd.x86_64 - $ sudo yum install java-1.6.0-openjdk.x86_64 - $ sudo yum install zip.x86_64 - - The Drupal Shell (drush) is generally not provided as - a package in official distro repositories, so we can - install it using Composer: - * https://getcomposer.org/doc/00-intro.md#globally - * http://docs.drush.org/en/master/install-alternative/ - - For PostgreSQL, we want version 9.x, but base CentOS 6.4 - only packages PostgreSQL 8.x. So first download the RPM - file from the PostgreSQL Yum/RPM Building Project at - http://yum.postgresql.org/repopackages.php (look for the - "CentOS 6 - x86_64" link, which as of this writing points to - http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm). - - $ sudo rpm -ivh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm - - That installed the repos RPM -- in other words, it made the - yum/rpm system aware of the PostgreSQL package repository - from which you can now install the actual packages. Do so: - - $ sudo yum install postgresql93-server - $ sudo yum install postgresql93-contrib - - For other operating systems, you'll have to translate the above to - the appropriate package management system. - - *Note: the process of installing Apache Solr will be described - later, as Checkbook currently installs Solr in an unusual way.* - -3. Download the latest version of the base Checkbook code: - - $ git clone https://github.com/NYCComptroller/Checkbook.git - - (It doesn't matter where you put it; later installation steps will - copy the relevant parts to the appropriate destinations.) - -4. Install the Drupal app. - - The next steps will look familiar if you've installed Drupal before. - We'll copy the contents of the folder `source/webapp/` to the webroot - directory, such that the top level inside the webroot looks like the - top level inside `source/webapp/` (i.e., looks like the top of a - Drupal tree). - - First, make sure there's nothing in the way at the destination: - - $ ls /var/www/html - No such file or directory - - Good. Next, create the `/var/www/html` directory by copying the - webapp from Checkbook: - - $ sudo su www-data - $ cp -a source/webapp/* /var/www/html - $ cp source/webapp/.htaccess /var/www/html - $ ls /var/www/html/ - authorize.php index.php INSTALL.txt profiles/ themes/ - CHANGELOG.txt INSTALL.mysql.txt LICENSE.txt README.txt update.php - COPYRIGHT.txt INSTALL.pgsql.txt MAINTAINERS.txt robots.txt UPGRADE.txt - cron.php install.php misc/ scripts/ web.config - includes/ INSTALL.sqlite.txt modules/ sites/ xmlrpc.php - $ - - (If the `/var/www/html` directory is already there, then you'll - need to adjust these instructions in the appropriate way. Also, - all of this assumes that directory `/var/www/` already exists and - is owned by user `www-data` and group `www-data`. If that's not - the case, you may need to properly create and set root permissions - for the www-data user with the following command. - `sudo chown -R www-data.www-data /var/www` would be one - way to do that on Ubuntu 12.04.) - - Make sure the `sites/default/files/` directory has read, write, - *and* execute permissions for the web server user: - - $ chmod ug+rwx /var/www/html/sites/default/files - - Finally, copy the `default.settings.php` file to - `settings.php`. There is no actual line break below nor backslash -- - the backslash just indicates that the line continues: - - $ cp /var/www/html/sites/default/default.settings.php \ - /var/www/html/sites/default/settings.php - - (We'll edit `settings.php` later.) - -5. Bring over some third-party libraries. - - **Highcharts:** - - Download version 9.3.2 from : - - $ wget https://code.highcharts.com/zips/Highcharts-9.3.2.zip - - Unpack it into the appropriate place in the web application: - - $ mkdir -p /var/www/html/sites/all/modules/custom/widget_framework/widget_highcharts/highcharts/ - $ unzip Highcharts-9.3.2.zip -d \ - /var/www/html/sites/all/modules/custom/widget_framework/widget_highcharts/highcharts/9.3.2 - - - Verify that it unpacked into the right place, by checking the path to `highcharts.src.js`: - - $ ls /var/www/html/sites/all/modules/custom/widget_framework/widget_highcharts/highcharts/9.3.2/js/highcharts.src.js - - **Highstock:** - - Download version 9.3.2 from : - - $ wget https://code.highcharts.com/zips/Highcharts-Stock-9.3.2.zip - - Unpack it: - - $ mkdir -p /var/www/html/sites/all/modules/custom/widget_framework/widget_highcharts/highstock/ - $ unzip Highstock-9.3.2.zip -d \ - /var/www/html/sites/all/modules/custom/widget_framework/widget_highcharts/highstock/9.3.2 - - Verify that it is unpacked into the right place, by checking that the path to `highstock.src.js`: - - $ ls /var/www/html/sites/all/modules/custom/widget_framework/widget_highcharts/highstock/9.3.2/js/highstock.src.js - - Note that these Highcharts and Highstock downloads are available at - no charge, but they are not licensed under open source licenses. - We are actively seeking open source replacements to recommend in - these installation instructions, and welcome suggestions. Ideally - such replacements would be drop-in compatible, but if they are not we - will consider making the necessary code adjustments. - -6. Install the Drupal (MySQL) database. - - Create and import the database into MySQL using the following commands: - - $ mysql -u root -p - _(enter the MySQL password for the MySQL root user)_ - mysql> grant all on checkbook_drupal.* to checkbook@localhost \ - identified by 'checkbook'; - mysql> create database checkbook_drupal; - mysql> use checkbook_drupal - mysql> source data/checkbook_drupal.sql - mysql> quit; - - *Notes:* - - On some operating systems (e.g., CentOS 6.4), the MySQL daemon may - not have been invoked at system startup, and furthermore the MySQL - root password may not have been set yet. To deal with these - situations respectively, do `sudo service mysqld start` and - `mysqladmin -u root password "some_password"`. - - The path `data/checkbook_drupal.sql` is relative to the top of this - source tree; you may need to give an absolute path or a different - relative path when you issue the MySQL `source` command above, - depending on where you invoked mysql. - - In this demo, we are giving the MySQL user "checkbook@localhost" - the password 'checkbook', to match the default setting in - `/var/www/html/sites/default/settings.php`. For a production - installation, you would want to use a better password of course. - -7. Install the Checkbook (PostgreSQL) database. - Begin by inilitizing the PostgreSQL database with the following command: - $ service postgresql-9.3 initdb - $ service postgresql-9.3 start; - - Create and import the database into PostgreSQL using the following commands: - - $ cd data - $ unzip checkbook_demo_database_for_postgres_db_20140708.zip - Archive: checkbook_demo_database_for_postgres_db_20140708.zip - inflating: checkbook_demo_database_for_postgres_db_20140708.sql - $ unzip checkbook_demo_database_for_postgres_ogent_db_20140708.zip - Archive: checkbook_demo_database_for_postgres_ogent_db_20140708.zip - inflating: checkbook_demo_database_for_postgres_ogent_db_20140708.sql - $ cd .. - $ sudo su postgres - bash-4.1$ psql - postgres=# create database checkbook ; - postgres=# create database checkbook_ogent ; - postgres=# \q - _(to exit from the database interactive prompt)_ - bash-4.1$ psql checkbook -f data/checkbook_demo_database_for_postgres_db_20140708/checkbook_demo_database_for_postgres_db_20140708.sql - bash-4.1$ psql checkbook_ogent -f data/checkbook_demo_database_for_postgres_ogent_db_20140708/checkbook_demo_database_for_postgres_ogent_db_20140708.sql - bash-4.1$ exit - - - Set the PostgreSQL database user's username and password with the following command: - $ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';" - - Verify that PostgreSQL can accept password authentication from the postgres user with the following command: - $ PGPASSWORD=postgres psql -U postgres checkbook - *Notes:* - - The demo dataset loaded above assumes the PostgreSQL database user - `postgres`, and the default settings.php file assumes that user's - password is 'postgres' too. Both of these should be changed in - production, and ideally even our demo dataset should not assume a - particular database username (and certainly not assume the admin user - 'postgres'). However, until that's fixed, these instructions are - accurate. - - The sample data set contains sanitized data for testing Checkbook -- - you would not load it into a production instance. We plan to better - document the process for loading real data into production instances. - These documentation files describe more about the process of - importing data and running a production instance: - - documentation/Creating new Database and running ETL Job.docx - documentation/Data Mapping 4_29_2013.xlsx - documentation/NYC Checkbook2 ETL Implementation Approach_2013_29_01.docx - -8. Check the basic database settings in `settings.php`. - - Look for: $databases = array (); text in the following file `/var/www/html/sites/default/settings.php`: - Insert the following settings listed below. - - $databases = array( - 'default' => array( - 'default' => array( - 'database' => 'checkbook_drupal', - 'username' => 'checkbook', - 'password' => 'checkbook', - 'host' => 'localhost', - 'port' => '', - 'driver' => 'mysql', - 'prefix' => '', - ), - ), - 'checkbook' => array( - 'main' => array( - 'database' => 'checkbook', - 'username' => 'postgres', - 'password' => 'postgres', - 'host' => '127.0.0.1', - 'port' => '5432', - 'driver' => 'pgsql', - 'prefix' => '', - 'schema' => 'public' - ), - ), - 'checkbook_ogent' => array( - 'main' => array( - 'database' => 'checkbook_ogent', - 'username' => 'postgres', - 'password' => 'postgres', - 'host' => '127.0.0.1', - 'port' => '5432', - 'driver' => 'pgsql', - 'prefix' => '', - 'schema' => 'public' - ), - ), - ); - - If any of the settings don't look right for you, fix them. (However, - the default settings provided there should work assuming you used the - defaults in the rest of these instructions.) - -9. Install Solr. - - Please refer to SOLR-INSTALL.md for Solr installation instructions. - -10. Configure the rest of the webapp's `settings.php`. - - **Solr:** - - URL of Solr instance: - - //Solr URL - $conf['check_book']['solr']['url'] = 'http://://'; - - You can change the value to "`http://localhost:8080/solr-checkbook`", - assuming a deployment where everything runs on one server. - - **DB settings:** - - Update the psql command in the obvious ways. Again, there is no actual - backslash nor linebreak after it: - - // update the command for psql. - $conf['check_book']['data_feeds']['command'] = \ - 'PGPASSWORD= psql -h -U ' - - If you're just running PostgreSQL on the same server, you can - either specify `-h localhost` or remove the `-h` option and - argument entirely (since localhost is the default). For the - postgres username and password, put in the correct values, which - are "postgres" for both if you've been using the defaults from - these instructions, and similarly "checkbook" for the db name. - - **Site URL:** - - URL of the site (this is included in email notifications): - - $conf['check_book']['data_feeds']['site_url'] = 'http://'; - - Replace with the URL of your Checkbook site. (E.g., on AWS, it might - look something like '`, and if - you look at your site with an in-browser debugger such as Firebug, - you'll see some warnings as fonts are requested and not found.* - - On its New York City production instance at checkbooknyc.com, - Checkbook uses Novecento Wide Normal font. This font can be - downloaded from - . - Once downloaded, the following font files - - Novecentowide-Normal-webfont.eot - Novecentowide-Normal-webfont.svg - Novecentowide-Normal-webfont.ttf - Novecentowide-Normal-webfont.woff - - should be copied into - - /var/www/html/sites/all/themes/checkbook3/fonts/ - - Fonts on the site can be changed by editing these files: - - /var/www/html/sites/all/themes/checkbook3/fonts/fonts.css - /var/www/html/sites/all/themes/checkbook3/css/fontfamily.css - -12. Set up cron jobs. - - Use `crontab -e` to add the following entries to crontab (again, - backslashes escape line breaks): - - */15 * * * * www-data /usr/bin/drush \ - --root="/var/www/html" scr processQueueJob \ - --script-path="sites/all/modules/custom/checkbook_api/script/" \ - >> /dev/null 2>&1 - - */5 * * * * www-data /usr/bin/drush \ - --root="/var/www/html" scr sendFeedCompletionEmails \ - --script-path="sites/all/modules/custom/checkbook_datafeeds/script/" \ - >> /dev/null 2>&1 - -13. Configure Apache to serve the site. - - Define an httpd configuration block for the site like this: - - - ServerAdmin webmaster@localhost - ServerName your-checkbook-hostname.com - DocumentRoot /var/www/html - ErrorLog ${APACHE_LOG_DIR}/checkbook_error.log - LogLevel debug - - - - AllowOverride all - - - On Ubuntu 12.04 or Debian GNU/Linux, the standard is to put that in a - file named (e.g.) `/etc/apache2/sites-available/checkbook.conf`, and - then install it like this: - - $ cd /etc/apache2/sites-enabled/ - $ sudo rm 000-default # Old default site not interesting to us now. - $ sudo ln -s ../sites-available/checkbook.conf 000-checkbook.conf - - Don't forget to restart Apache: - - $ sudo service apache2 restart - -14. Verify that the new Checkbook site is working: - - * Test the site by accessing the root URL. - - The default page should be the spending transactions page for - current fiscal year. - - * Click on search button and should see the search results page. - - * Start typing any name in the search box and autocomplete results - should appear. - - * Click on advanced search and click on submit. results page should appear. - - * Click on export in advances search results page to verfiy that - export is working. - -Troubleshooting ---------------- - -We're slowly collecting troubleshooting tips based on people's -installation experiences in the real world. If you encounter a new -problem, please raise it in one of the feedback forums (e.g., as a -GitHub issue or as a post in the discussion group -- see README.md), -and once we've figured out the solution we'll list it here too. - - * Installation on a Virtual Machine. - - https://github.com/NYCComptroller/Checkbook/issues/26#issuecomment-34296699 - describes how user @sapariduo installed CheckbookNYC on a virtual - machine, with the Host machine running Windows 7 and the Virtual - Machine running Centos 6.4. - - To do this, he set up 2 virtual networks. 1 (NAT) used DHCP from - the host machine, therefore having the same subnet address as the - Host. The other virtual network used a static IP address ("Host - Only Configuration"), for the Checkbook server on CentOS 6.4. The - objective of this configuration was to allow the CentOS machine to - be able to connect with the external network, so that a very - minimal CentOS installation could be used without any need for any - desktop features there, and allowing the Windows browser to - connect to the Checkbook application on the CentOS VM. - - Here are some extra things he needed to do to make this work: - - - Set up or verify hostname of the server on - `/etc/sysconfig/network` and put the static IP address and - hostname on `/etc/hosts`. - - - In `/etc/httpd/conf/httpd.conf`: - - 1. Find entry "ServerName", untag and set parameter with - yourdomain:80 or yourIP:80 - - 2. Find entry "NameVirtualHost", untag and set parameter with *:80 - - 3. Set VirtualHost Configuration and use your domain or your IP - on ServerName element - - - Configuration needed for PostgreSQL to make Solr able to connect: - - 1. Change parameter on `/var/lib/pgsql/9.3./data/pg_hba.conf`: - "local all all ident" --> "local all all trust" - - Then monitor whether Solr is able to connect with Postgres, from - `/opt/apache-tomcat-6.0.35/logs/catalina.out`. If there is still - an error in the JDBC Postgres connection, try changeing this - parameter too: - "host all all 127.0.0.1/32 ident" --> "host all all 127.0.0.1/32 trust" - - Then restart HTTPD and Tomcat: - - `service httpd restart` - - `./bin/shutdown.sh` (from within the apache-tomcat directory) diff --git a/README.md b/README.md deleted file mode 100644 index 4f951c3666..0000000000 --- a/README.md +++ /dev/null @@ -1,60 +0,0 @@ -![Build -status](https://travis-ci.org/NYCComptroller/Checkbook.svg?branch=develop) - -Checkbook NYC -============= - -Checkbook NYC is an open source financial transparency web application. - -Checkbook provides transparent access to a city's or other jurisdiction's -financial information, through web-based dashboard views that show activity -in categories such as Revenue, Budget, Spending, Contracts, and -Payroll. It also offers that information programmatically via APIs. - -Checkbook operates on a read-only, filtered copy of a city's financial -data. Confidential information like municipal employee's names and -addresses are not even in the Checkbook database. Data is loaded via -an extract-transform-load (ETL) process; a typical frequency for -running the ETL import is a few times per week. - -The [New York City Office of the Comptroller](http://comptroller.nyc.gov/) runs a production instance -of Checkbook NYC at http://checkbooknyc.com/. - -Checkbook NYC is licensed under the GNU Affero General Public License, -version 3.0. See the file LICENSE.md for details. - -Installing Checkbook --------------------- - -(See the file INSTALL.md for details.) - -Checkbook runs in a standard LAMP-stack environment: Apache HTTPD and -Apache Solr, MySQL and PostgreSQL. Checkbook is built on top of -Drupal, but you do not need to install Drupal first, as Checkbook's -own source code includes the appropriate version of Drupal. - -Checkbook NYC's installation and data management procedures were -originally designed around the needs of New York City. Our goal is to -make Checkbook portable to other jurisdictions; the installation and -data import procedures are probably the areas that most need -improvement to achieve that goal. (The code itself is -production-ready, as New York City runs a live instance.) We welcome -early-adopter feedback to help make these improvements. - -Getting Help / Participating in Development -------------------------------------------- - -The source code to Checkbook NYC is available here: - - https://github.com/NYCComptroller/Checkbook - -You can use the usual ways to interact with the project there (submit -pull requests, file tickets in the issue tracker, etc), and we invite -you to ask questions in the Checkbook NYC technical discussion forum: - - Web: https://groups.google.com/group/checkbooknyc - Email: checkbooknyc {_AT_} googlegroups.com - -You can post via web or email; either way, you don't need to be -subscribed to post. - diff --git a/SOLR-INSTALL.md b/SOLR-INSTALL.md deleted file mode 100644 index 83bbea0619..0000000000 --- a/SOLR-INSTALL.md +++ /dev/null @@ -1,132 +0,0 @@ -Solr Installation for Checkbook NYC ------------------------------------ - -Checkbook NYC runs Solr inside Tomcat. - -1. Get Solr and Tomcat and put them to the right places. - - $ sudo cp -a ./solr-4.1.0 /opt/solr-4.1.0 - $ sudo cp -a ./apache-tomcat-6.0.35 /opt/apache-tomcat-6.0.35 - - *Note: you may need to create the `/opt` directory first on some systems.* - -2. Create the Tomcat log directory. - - $ sudo mkdir /opt/apache-tomcat-6.0.35/logs - - *Note: as the above implies, Tomcat will be running as `root` and - writing to its log directory as `root`. This is not ideal; probably - Tomcat should run as `www-data`. However, we have not tested that - configuration yet, so for now we are documenting running as `root`.* - - -3. Ensure that Solr will be able to connect to the PostgreSQL DB. - - $ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';" - - *Note: Hmm, this step does not really belong in the Solr installation - instructions. It's really about setting the postgres DB user's - password, and therefore should be documented in INSTALL.md.* - -4. Set the PostgreSQL connection authentication configuration: - - Open up the PostgreSQL configuration file (a file somewhere - like `/etc/postgresql/9.1/main/pg_hba.conf` if Ubuntu 12.04 or - `/var/lib/pgsql/9.3/data/pg_hba.conf` if CentOS 6.4) and apply the - changes listed below: - -# 'local' is for Unix domain socket connections only - - local all all md5 - -# IPv4 local connections: - - host all 0.0.0.0/0 md5 - -# IPv6 local connection: - - host all all md5 - - - *Note: This configuration is set so any user can log into the database - providing the username: localhost, postgres, etc. with the password: postgres. - This configuration is simply for initial setup and can be customized to your - preference. - - *Note: Again, that "postgres" user is the main PG database user, and - changing its authentication mechanism could affect up other things. - The long-term solution is for Checkbook to have its own PG user.* - -5. Then restart PostgreSQL: - - $ sudo service postgresql-9.3 restart - - Verify that the user postgres can connect to the checkbook database with - the following command. - - $ PGPASSWORD=postgres psql -U postgres checkbook - -6. Next, verify that the localhost user can connect to the checkbook database - with password authentication. Later SOLR will connect to the database - using U-localhost and -PGPASSWORD=postgres. The following command will - verify if that connection is succesfull. - - $ PGPASSWORD=postgres psql -U localhost checkbook - - The expected result is something like this: - - psql (9.3.5) - Type "help" for help. - checkbook=# \q (to quit) - -7. Tell Solr how to connect to PostgreSQL: - - Edit `/opt/solr-4.1.0/indexes/solr/collection1/conf/db-config.xml` - to insert the correct database details. There is no line break or - backslash here; the backslash just indicates line continuation: - - url="jdbc:postgresql://localhost/checkbook" \ - user="postgres" password="postgres" - - *Note: Actually, you may not need to edit it if you're just testing, - as the shipped file has the username "postgres" with password - "postgres", for testing. However, in a production environment those - would be different, and this is where you would need to set them.* - -8. Start Solr inside Tomcat: - - To run Tomcat, you'll need a Java runtime environment. If your - system doesn't already have one, you can install it like this under - Ubuntu 12.04: - - $ sudo apt-get update - $ sudo apt-get install openjdk-6-jre-headless - - Now that Java is installed, start up Tomcat: - - $ cd /opt/apache-tomcat-6.0.35/bin - $ sudo ./startup.sh - - That starts up Tomcat, and Solr within Tomcat. Visit - in a browser to verify that - Solr is now running. For troubleshooting errors, see the detailed - logs in `/opt/apache-tomcat-6.0.35/logs/`. - -9. Start Solr indexing. - - Visit this url in a browser start indexing: - - - You can monitor the progress of indexing by repeatedly visiting - . - - Detailed logs for troubleshooting errors can be found at - . - - *Note: You may need to open up the server's firewall to enable a web - browser to reach port 8080. Firewall configuration varies widely - from system to system, so we cannot document all the possibilities - here, but if it's iptables, then `iptables -F` should flush all - existing firewall rules. You probably wouldn't want to do that on a - production server, but that approach might make sense for a test - instance, especially one running in a virtual machine.* diff --git a/source/tests/functional/NYCAutomationTest/pom.xml b/source/tests/functional/NYCAutomationTest/pom.xml deleted file mode 100644 index 154bafdc4f..0000000000 --- a/source/tests/functional/NYCAutomationTest/pom.xml +++ /dev/null @@ -1,86 +0,0 @@ - - 4.0.0 - WebdriverTest - WebdriverTest - 0.0.1-SNAPSHOT - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19.1 - - - **/suites/FunctionalTest.java - - - - - - - - UTF-8 - 1.8 - - - - junit - junit - 4.13.1 - test - - - org.seleniumhq.selenium - selenium-java - 3.3.1 - - - net.sourceforge.jexcelapi - jxl - 2.6.12 - - - org.seleniumhq.selenium - selenium-chrome-driver - 3.3.1 - - - - org.seleniumhq.selenium - selenium-firefox-driver - 3.3.1 - - - org.seleniumhq.selenium - selenium-server - 3.3.1 - - - - org.seleniumhq.selenium - selenium-api - 3.3.1 - - - com.github.detro.ghostdriver - phantomjsdriver - 1.0.4 - - - - org.postgresql - postgresql - 9.4.1212.jre7 - - - diff --git a/source/webapp/sites/all/modules/contrib/metatag/.codeclimate.yml b/source/webapp/sites/all/modules/contrib/metatag/.codeclimate.yml deleted file mode 100644 index e8b0bd077e..0000000000 --- a/source/webapp/sites/all/modules/contrib/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/source/webapp/sites/all/modules/contrib/metatag/.csslintrc b/source/webapp/sites/all/modules/contrib/metatag/.csslintrc deleted file mode 100644 index aacba956e5..0000000000 --- a/source/webapp/sites/all/modules/contrib/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/source/webapp/sites/all/modules/contrib/metatag/.eslintignore b/source/webapp/sites/all/modules/contrib/metatag/.eslintignore deleted file mode 100644 index 96212a3593..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -**/*{.,-}min.js diff --git a/source/webapp/sites/all/modules/contrib/metatag/.eslintrc b/source/webapp/sites/all/modules/contrib/metatag/.eslintrc deleted file mode 100644 index 9faa37508e..0000000000 --- a/source/webapp/sites/all/modules/contrib/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/source/webapp/sites/all/modules/contrib/metatag/CHANGELOG.txt b/source/webapp/sites/all/modules/contrib/metatag/CHANGELOG.txt deleted file mode 100644 index d827c39831..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/CHANGELOG.txt +++ /dev/null @@ -1,1214 +0,0 @@ -Metatag 7.x-1.27, 2020-02-10 ----------------------------- -#3047486 by DamienMcKenna: Fixed hook_requirements message about Fast Token - Browser module. -#3104933 by DamienMcKenna, ron_s: Revert #3037874 for breaking Panels support. -#3102817 by DamienMcKenna, ron_s, steveoriol, jmouse888, mattlt, slovv, - joekings: Summary token filtering from #3063056 breaks content displays. -#3112422 by DamienMcKenna: Combine submodule "TagsTest" and "Test" tests. -#3112410 by DamienMcKenna: Only run token logic if node:summary token used. -#3109898/#2954968 by malcolm_p, andyg5000, DamienMcKenna: - metatag_requirements() loads slowly due to system_rebuild_module_data(). -#3108311 by mvc, DamienMcKenna: Meta tags not working with taxonomy terms Views - page ending in /all. -#3107119 by DamienMcKenna: Improve in-module text, meta tag descriptions, etc. -#2403349 by DamienMcKenna, pvhee, thejimbirch: Convert "author" tag to HTML 5.2 - spec. -#3112549 by DamienMcKenna: Rename test files to PascalCase. - - -Metatag 7.x-1.26, 2019-12-20 ----------------------------- -#3011548 by jacob.embree, DamienMcKenna: Add configure link to - metatag_importer.info. -#2966185 by DamienMcKenna, justindodge: Cache get without set causes super long - lock_waits with stampede protection. -#3030181 by DamienMcKenna: Filter JavaScript, style content out of values. -#3021167 by Stevel, DamienMcKenna: Make Devel a dependency for all tests. -#3030239 by DamienMcKenna: Remove duplicate metatag_hreflang.test file. -#3044943 by thejimbirch, mluzitano, DamienMcKenna: Fix LICENSE.txt. -#3037897 by Ronino, DamienMcKenna: Allow raw meta tags to be modified prior to - creating the render array. -#3037874 by Ronino: Build meta tags for Panels much later so they can be altered - after page data has been processed. -#3018692 by thatguy, DamienMcKenna: Search API index multiple types. -#3061475 by DamienMcKenna: Token to provide summary of text fields. -#2994100 by DamienMcKenna: Add new meta tag: google. -#3082120 by thejimbirch, cindytwilliams, DamienMcKenna: Add option name in - ROBOTS selector. -#2831198 by FeyP, Xrobak, DamienMcKenna, Simon Georges: Translated views metatag - do not display. -#2947473 by aether, rpayanm: Validate string in - DrupalDefaultMetaTag::tidyValue(). -#2982252 by DamienMcKenna, dev20.addweb, Mingsong: PHP Notice: Undefined index - value. -#3047486 by DamienMcKenna: Recommend the Fast Token Browser module. -#2977120 by DamienMcKenna: New meta tag: og:image:alt. -#3027076 by DamienMcKenna: Add meta tag: Pocket site verification. -#3096935 by DamienMcKenna, cindytwilliams, rubyji: Add new tag: Zoom domain - verification. -#2994102 by DamienMcKenna, LaravZ: Removed extra xmlns definitions due to W3C - validation errors. -#3063056 by tristangraves, DamienMcKenna: Metatag has media browser token in - meta description. -#2957361 by DamienMcKenna: Add support for Pinterest meta namespace. - - -Metatag 7.x-1.25, 2018-04-03 ----------------------------- -#2958362 by DamienMcKenna, didierlebouc: Undefined index error in 7.x-1.24. -#2958208 by DamienMcKenna: Bug in count() statement in metatag.metatag.inc. - - -Metatag 7.x-1.24, 2018-04-03 ----------------------------- -#2958279 by joelpittet: Fatal error: Call to undefined function int_val(). - - -Metatag 7.x-1.23, 2018-04-03 ----------------------------- -#2906312 by DamienMcKenna: Added the twitter:dnt meta tag. -#2903980 by DamienMcKenna, Chris Charlton: Undefined index in - metatag_token_info. -#2143979 by bpleduc, drunken monkey, DamienMcKenna, thirdender, davidthou: - Allow Views meta tags to "Use replacement tokens from the first row". -#2882769 by DamienMcKenna: List Schema Metatag as a related module. -#2882769 by DamienMcKenna: Added a hook_requirements() message about the - Schema.org Metatag module. -#2929487 by volkswagenchick, porkloin: Typo in metatag_dc.install, aka "Dublin" - misspelled by the guy from Ireland. -#2931744 by DamienMcKenna: Fix tests for the 7.x-1.x branch, - testXssMetatagConfig has a regression. -#2932110 by thejimbirch: Update Description's meta description to 320 chars - (for 2018). -#2933940 by DamienMcKenna: og:image must be at least 200x200 otherwise it is - ignored by Facebook. -#2946145 by DamienMcKenna, bkosborne: Remove usage of deprecrated each() - function for PHP 7.2+ future proofing. -#2872206 by jenlampton: Drush command for importing from Page Title throws - fatal. -#2872446 by jenlampton, DamienMcKenna: Complete the drush command for importing - nodewords meta tags. -#1282806 by DamienMcKenna, iamEAP, osopolar, victoriachan, malcomio, HyperGlide, - Murz, dandaman, klokie: Upgrade script for Meta Tags Quick. -By DamienMcKenna: Updated README.txt related to the importer module. -#2950652 by Les Lim: metatag_favicons_get_mime_type() is mostly wrong. -#2933194 by ocastle: Issue with URL Decoding panel substitutions. -#2932401 by DamienMcKenna: New tag: Set-Cookie. -#2945589 by ron_s: Apostrophe encoded in page title when using Panels - substitutions. -#2956465 by DamienMcKenna, alexpott: Make sure $_GET['page'] is an integer. -#2832101 by DamienMcKenna, jenstechs: hreflang tokens should support Content - Translation. -#2309017 by DamienMcKenna, rodrigoaguilera, nmillin, John_B, David Hernández, - ctarres, cmseasy, computerbarry, skein, erwangel, espurnes, zmove: - Automatically trim meta tag lengths. -#2958206 by DamienMcKenna: Fix hreflang tags for entity_translation. -#2864078 by DamienMcKenna: Improve coding standards on Metatags 7.x-1.x. -#2924181 by Mike Lewis: Default value for Robots on config form does not - reflect stored configuration. -#2853251 by kpaxman: Code to use only first item doesn't work if first item is - blank. -#1624266 by L-four, angrytoast: Add support Views Bulk Operations for mass - updating metatags. -#2854539 by DamienMcKenna, jalpesh, zhouhana: http://drupal.org instead of - https://www.drupal.org in default generator tag. - - -Metatag 7.x-1.22, 2017-07-03 ----------------------------- -#2853699 by DamienMcKenna: Drupal core 7.40 is the minimum version supported. -#2857982 by arosboro: Fixed tests due to changes in Entity Translation. -#2864524 by JamesK: Improve field description for the abstract meta tag. -#2868750 by DamienMcKenna: List Metatag Cxense as a related module. -#2882048 by jyraya: i18n integration shouldn't assume a tag has a group. -#2882703 by smustgrave: module_load_include() doesn't work quite as intended if - the module is not installed. -#2864834 by DamienMcKenna: Added a note to update script 7114 to note that - output caching has been disabled. -#2297647 by greggles, DamienMcKenna: Run views_invalidate_cache() when - metatag_views is disabled. -#2857088 by arosboro: Fixed parsing of percentages in URLs in Metatag:Panels. - - -Metatag 7.x-1.21, 2017-02-15 ----------------------------- -#2844504 by DamienMcKenna: Add project names to all dependencies. -By DamienMcKenna: Backported some minor text changes from the D8 branch. -#2821713 by WidgetsBurritos: Don't output the mask-icon 'color' attribute if - it's empty. -By DamienMcKenna, Michelle: Minor updates to README.txt. -#2852260 by DamienMcKenna: Output caching wasn't fully disabled for the front - page or non-entity pages that used the global defaults. -#2852737 by DamienMcKenna: Added CodeClimate config files. -By DamienMcKenna, klausi: Information disclosure issue under certain - circumstances. - - -Metatag 7.x-1.20, 2017-01-18 ----------------------------- -#2840500 by DamienMcKenna: Bring back compatibility with Workbench Moderation - v1. -#2841064 by klausi, DamienMcKenna: Fix sandbox-based update scripts so they - don't run into infinite loops. - - -Metatag 7.x-1.19, 2017-01-01 ----------------------------- -#2832427 by dmitry.kazberovich, e2thex, DamienMcKenna: Allow the metatag cache - expiration time to be modified. -#2780025 by DamienMcKenna: Backported output tests from D8. Also fixes the - output of the shortcut icon, ios-app, android-app, author, publisher, and made - the Google CSE thumbnail tag an 'image'. Left some others to be fixed later. -#2832476 by czigor; Added the 'product.group' and 'place' og:type options. -#2835614 by drumm: metatag_metatags_load_multiple() doesn't need to sort the - results. -By DamienMcKenna: Noted in the metatag_google_plus info file and README.txt that - it includes the Author and Publisher meta tags. -By DamienMcKenna: Tweaked the favicons module description. -By DamienMcKenna: Updated main tests to match the latest coding standards. -By DamienMcKenna: Minor updates to various Google CSE labels. -By DamienMcKenna: A string in metatag_opengraph_products wasn't using an - argument that was being passed to it. -By DamienMcKenna: Minor adjustment to metatag_mobile strings. -By DamienMcKenna: Updated submodule tests to match the latest coding standards. -#2838198 by DamienMcKenna, Mixologic: Test dependency changes to workaround - changes in the DrupalCI platform. -#2831073 by dxvargas, DamienMcKenna: Remove old workarounds due to Workbench - Moderation 3.x API changes, warn if older version installed. - - -Metatag 7.x-1.18, 2016-11-30 ----------------------------- -#2761817 by DamienMcKenna: Fixed metatag_update_replace_config() so it isn't - hardcoded to only work with og:video. -#2759843 by DamienMcKenna: Removed the Alexa verification tag. -#2759855 by DamienMcKenna: Removed the Yahoo verification tag. -By DamienMcKenna: Clear Metatag's caches after deleting or renaming a meta tag. -#2763499 by DamienMcKenna: Don't use entity_load() when saving Metatag data, - it can cause anomolies. -#2750705 by jalpesh, susannecoates: Updated description of the Google Play app - ID meta tag. -#2771603 by FeyP: Fixed incorrect argument name to metatag_metatag_save(). -#2745177 by DamienMcKenna: Tests to confirm each meta tag can be filled in and - added to the global settings. -#2773839 by DamienMcKenna: Remove 'metatag_ui' from the {system} table. -#2773465 by DamienMcKenna: Because Page Title is now fully deprecated, promote - converting its settings and uninstalling it. -#1944862 by FeyP, DamienMcKenna: Allow control over which meta tags and - languages are reverted on the Bulk Revert page. -#2766315 by recrit, DamienMcKenna: metatag_entity_type_enable() would - incorrectly change settings in certain circumstances. -#2774859 by DamienMcKenna: Refactored main tests to not use the submodules by - default. -#2678896 by nmalinoski: Fixed redundant t() calls to fix double translation. -#2787189 by DamienMcKenna: Added some tests to confirm that the different node - preview options don't interfere with saving meta tag values. -By DamienMcKenna: Added a Known Issue for problems with Entity Token. -#2790967 by DamienMcKenna: Added tests for taxonomy term config translations - using i18n. -#2795255 by lazysoundsystem: 'disabled' was misspelled. -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 Author meta tag to GooglePlus submodule. -#1343914 by DamienMcKenna: Moved Publisher meta tag to GooglePlus submodule. -#2784879 by sorinb, DamienMcKenna: Change metatag_update_7108 to use a sandbox. -#2791963 by ttkaminski, DamienMcKenna: Don't change protocol-relative URLs in - image values. -#2797069 by Internet, DamienMcKenna: Corrected the URL to Wikipedia's ICBM page. -#2799317 by mdooley: Use a static date example for the Expires meta tag's - description to avoid flooding the {locales_source} table. -#2800479 by DamienMcKenna, david.gil: Avoid showing errors if Search API is not - installed. -By DamienMcKenna: Slight reordering of the main info file. -#2663208 by DamienMcKenna, geertvd: Don't load meta tags on the /user/me page, - avoid problems when the Me module is installed. -#2813429 by DamienMcKenna: Added tests for metatag_mobile. -#2813427 by DamienMcKenna: Added support for the amphtml link tag. -#2811735 by Stevel, DamienMcKenna: Added dependencies to all tests so that tests - will only be listed if those dependencies are also available. -By stimalsina: Minor improvements to the amphtml meta tag's description. -#2823367 by DamienMcKenna: Fixed tests after internal API change in Media. -#2826023 by renatog, DamienMcKenna, gfcamilo: Coding standards fixes for - metatag.module. -#2831030 by prince_zyxware: Fixed some minor coding standard bugs, spacing - issues. -#2759461 by DamienMcKenna: hreflang=x-default is no longer removed when another - hreflang meta tag has the same URL, instead the other tag is removed as it - was supposed to be. Added a new [node:url-original] token for showing the - URL for the source node for translations; updated the default value for - the hreflang=x-default meta tag to use the new token instead of - [node:source:url]. Updates to many tests to allow these changes. -#2532588 by cebasqueira, renatog, DamienMcKenna: Added new meta tags for Google - CSE. -#2796701 by DrupalDano, DamienMcKenna: Some XSS tests for meta tag handling. -#2831073 by DamienMcKenna: Added Workbench Moderation as a test dependency, for - future use. -#2831822 by DamienMcKenna: Added support for the handheld mobile alternate link - tag, supported by Google. - - -Metatag 7.x-1.17, 2016-06-30 ----------------------------- -#2748627 by jalpesh: Corrected twitter:app:id:googleplay description. -#2752319 by DamienMcKenna: Fixed output of the mask-icon meta tag. -#2752319 by DamienMcKenna: Added the mask-icon 'color' attribute, the new 'url' - option for meta tag definitions, and tests for the mask-icon meta tag. -#2754263 by DamienMcKenna: Meta tags with multiple values should still be - returned as a string from metatag_get_value(). -#1953080 by DamienMcKenna: Don't output language/locale meta tags if they are - equal to LANGUAGE_NONE/"und". -#2659906 by DamienMcKenna: Rewrote update 7040 to use less memory and work - better. -#2720723 by IRuslan: Allow config instance names to be changed. -#2669592 by DamienMcKenna: Fix for possible problem with removal of meta tags - that Metatag is already outputting. -#2162397 by DamienMckenna: Added test dependency for Profile2. -#2162397 by roderick, DamienMckenna, hideaway: Fixed loading multiple entities - on the same path when at least one of them is not enabled for use with - Metatag and gets in the way of the one which is enabled. - - -Metatag 7.x-1.16, 2016-06-03 ----------------------------- -#2742063 by jalpesh, DamienMcKenna: Fix syntax error in verification module. -#2742123 by DamienMcKenna: Added test for all submodules to ensure they could be - enabled. - - -Metatag 7.x-1.15, 2016-06-03 ----------------------------- -#2700217 by DamienMcKenna: Added Media module as a test dependency. -#2700217 by DamienMcKenna: Automatically filter out Media embed codes from meta - tags when the Media WYSIWYG module is installed. -#2709985 by alzz: Added fb:pages meta tag for Facebook Instant Pages. -#2703081 by DylanUnderwood: Added apple-mobile-web-app-title meta tag. -#2704805 by jcnventura: Fixed the hreflang meta tag. -#2678004 by alvar0hurtad0: Improvements to the API documentation. -By DamienMcKenna: Corrected some messages in metatag_update_7104. -By DamienMcKenna: Incorrect indenting in metatag_favicons.metatag.inc. -#2687309 by das-peter, skein, DamienMcKenna, k_zoltan: Fixed output translations - so it's actually disabled when it's turned off. -#2712815 by Chalk, DamienMcKenna: Rewrote update scripts that rename meta tags - to use two new shared functions, and always use a sandbox for it. -#2720463 by DamienMcKenna: Rename the icon_any favicon to mask-icon. -#2276855 by ben.kyriakou: Properly handle the 'disabled' state when featurized - configs are reverted. -#2687309 by das-peter, DamienMcKenna: Submodules shouldn't update translations - during page load. -#2725251 by DamienMcKenna, Jim.M: Added validation tags for Alexa, Baidu, Norton - Safe Web and Yahoo. -#2725741 by DamienMcKenna: Ensure the Locale module is enabled before running db - queries against the {locales_source} table. -By DamienMcKenna: Updated the docblock comment for metatag_metatags_save(). -#2728919 by DYdave: Workaround for CTools bug that causes the Views popup to be - tiny. -#2728933 by DYdave, DamienMcKenna: Trigger hook_metatag_token_types() from - metatag_metatags_form() instead of metatag_field_attach_form() so it works - with all submodules too. -#2710377 by DamienMcKenna: Updated the message for og:image:url to make it - clear it might be better to not use it. -#2539388 by DamienMcKenna: All image meta tags will be output with absolute URLs - and spaces will be replaced with '%20'. -#2692877 by stefan.r, DamienMcKenna, Drunkey Monkey: Search API integration. -#2720221 by dnmurray: Allow sanitizing of values through token_replace(); for - advanced usage only, may lead to other issues. -#2497043 by marcelovani, uzlov: Allow Metatag:Context configs to be sorted by a - 'weight' value. - - -Metatag 7.x-1.14, 2016-04-02 ----------------------------- -By DamienMcKenna: Corrected return code from update 7107. -#2664624 by DamienMcKenna: Added a space in front of the Google Plus schemaorg - variable to avoid HTML validation errors because of the lack of space. -#2658902 by DamienMcKenna, swentel: Renamed the 'Add a Metatag default' link to - match the D8 wording. -#2665206 by DamienMcKenna: Don't add an index in 7029 if it already exists. -#2670842 by Ambient.Impact: Fixed permissions in the Importer submodule. -#2613598 by DamienMcKenna: Removed the Contributor Covenant, replaced it with a - link to https://www.drupal.org/dcoc. -#2692933 by doostinharrell, DamienMcKenna: $metatags variable in - metatag_field_attach_form() may not be an array in certain circumstances. -#2658808 by tommik: Rewrote query in update 7040 so it works better. -#2688963 by DamienMcKenna: Added a note about the Yoast SEO module. -#2687847 by DamienMcKenna: Added a note about the Parse.ly module. -#2696445 by Simon Georges: Added the twitter:image:alt meta tag. -#2678896 by Dave Reid: Fixed double-encoding of form fields. -#2667214 by DamienMcKenna: Improved tests for string encoding. -#2667214 by joelstein, DamienMcKenna: Decode HTML entities prior to rendering - meta tags. - - -Metatag 7.x-1.13, 2016-03-04 ----------------------------- -#2662952 by DamienMcKenna: Fixed logic on hook_requirements for checking the - version of Token that is installed. - - -Metatag 7.x-1.12, 2016-03-04 ----------------------------- -#2644742 by kev5873, DamienMcKenna: Variable scoping issue with Metatag:Panels - could lead to incorrect meta tag output. -#2309017 by DamienMcKenna, rodrigoaguilera: Tidied up the install file a little. -#2658808 by DamienMcKenna: Improved query to skip update 7040 if it isn't - needed. -#2658262 by Devin Carlson, DamienMcKenna: Fixed hook_metatag_config_delete(), - this time with tests. -#2661378 by DamienMcKenna: No longer require Token v7.x-1.6, just highly - recommend it. -#2661408 by DamienMcKenna: Removed the status message when core is up-to-date. -#2661412 by DamienMcKenna: Improve hook_requirements check for Entity - Translation. -#2661434 by DamienMcKenna: Removed the status message about alt_hreflang. -#2652120 by DamienMcKenna: Fixes for old config translations that weren't - fixed with previous updates. - - -Metatag 7.x-1.11, 2016-01-26 ----------------------------- -#2568499 by DamienMcKenna, DD 85: Removed an errant space. -#2655582 by DamienMcKenna, MihaiMiculescu: Fixed automatic image parsing. -By DamienMcKenna: Minor changes to the README.txt file. -#2655614 by DamienMcKenna: Added tests for image handling. -#2655662 by DamienMcKenna: Fixed handling of output translation on pages with - really long paths. - - -Metatag 7.x-1.10, 2016-01-22 ----------------------------- -#2654838 by Plazik, DamienMcKenna: Disabling output caching lead to Undefined - Variable errors. -#2654638 by DamienMcKenna, noah, marleythedog: Allow updates 7104 and 7105 to - run if Locale is not enabled. -#2654530 by DamienMcKenna, Adenn, deja711: Twitter Cards update 7100 and - OpenGraph update 7103 cannot run until Metatag update 7100 has finished. - - -Metatag 7.x-1.9, 2016-01-21 ---------------------------- -#2652772 by DamienMcKenna: Fix update 7101 and rerun it to correct translation - data. -#2651812 by DamienMcKenna: Added an option to disable the i18n integration. -#2420489 by Les Lim, DamienMcKenna: New caching process for entities. -#2652260 by DamienMcKenna: Remove the revision_id from translation string IDs. -#2509246 by DamienMcKenna, zniki.ru: Remove meta tags added by core, with option - to leave them as-is. -#2652294 by DamienMcKenna: Incorrect string context was being used for meta tag - output translation. -#2653434 by DamienMcKenna, reinchek: Fixed metatag_metatags_load(). -#2653446 by DamienMcKenna: Wrong variable name passed to - metatag_config_delete(). -#1858540 by DamienMcKenna, friera: Added the pragma, cache-control and expires - meta tags. - - -Metatag 7.x-1.8, 2016-01-14 ---------------------------- -#2546636 by DamienMcKenna: Fixes to the custom Panels pane for editing tags. -#2113501 by DamienMcKenna: Shortened i18n translation context to just - "metatag:METATAGNAME" to make translations easier. -#2552829 by DamienMcKenna: Move the basic meta tags to a group. -#2552827 by DamienMcKenna: Group meta tag tokens so they're less confusing. -#2552849 by DamienMcKenna: Meta tag tokens for user entities. -#1986032 by DamienMcKenna, izus, yang_yi_cn, Placinta, maijs, Tharna, stijndmd: - Improved i18n compatibility for the Views, Panels and Context submodules. -#2518690 by manikaprasanth: Added support for editing Commerce product entities. -#2550001 by DamienMcKenna: Renamed twitter:image:src back to twitter:image. LOL. -#2559359 by labboy0276: Errors if the Views integration can't find the expected - display object. -#2560649 by DamienMcKenna: Added optional second-stage translation for meta tag - output. -#2556741 by DamienMcKenna: Fixed robots handling on Nodewords importer; moved - Nodewords importer into a separate file to keep the Importer module more - general. -#1809652 by DamienMcKenna: Added a new [current-page:pager] token for inserting - a pager into meta tags. -#1809652 by DamienMcKenna: Update default node title to insert the pager. -#2518690 by DamienMcKenna: Improvements to Commerce Product handling. -#2568499 by DamienMcKenna: Added new Apple-specific meta tags to the Mobile - submodule. -#2568463 by DamienMcKenna: Added the android-app deeplink meta tag. -#2569093 by DamienMcKenna: Added the ios-app deeplink meta tag. -#2568955 by DamienMcKenna: Don't output meta tags that only contain a pager. -#2556741 by DamienMcKenna: BatchAPI call wasn't updated after the Nodewords - importer file was renamed. -#2514916 by DamienMcKenna: Split up the tests file, moved them into the tests - directory, added new tests for node revisions. -#2567621 by hass: Allow the custom pager to be translated using the i18n - Variable module. -#2572371 by Dave Reid: Remove support for comments. -#2572291 by Dave Reid: Always display config items in the correct order - global - items first, then sorted alphabetically. -#2567677 by Perignon, DamienMcKenna: og:video meta tag renamed. -#2556741 by DamienMcKenna: Follow-up to fix imported robots meta tags. -#2556741 by DamienMcKenna: Updated the final commit message to show the correct - count. -#2498213 by makangus: Added the Android manifest meta tag. -#2573869 by DamienMcKenna: Fixed variable bug in update 7040. -#2579871 by DamienMcKenna: Added more test dependencies. -#2579201 by lesonunique, DamienMcKenna: Missing 'secure' option on - og:audio:secure_url. -#2580623 by marcvangend: Incorrect check for admin_language. -#2580523 by DamienMcKenna: Add a note to hook_requirements if hreflang module - is not installed and there are multiple locales enabled on the site. -#2587369 by DamienMcKenna: Added two placeholder files for storing tests for the - Views integration. -#2587371 by DamienMcKenna: Added two placeholder files for storing tests for the - Panels integration. -#2376857 by DamienMcKenna: Work around entity definitions that don't have a - 'bundles' attribute. -#2455777 by DamienMcKenna: Don't try to save any {metatag} records if the entity - or bundle is not supported. -#2597301 by DamienMcKenna: New submodule for handling the hreflang meta tag. -#2603058 by FluxSauce: Fixed problem loading migrate.inc file if Migrate is not - enabled. -#1957358 by pjonckiere, DamienMcKenna: Add tests to ensure that the meta tag - string encoding works correctly. -By DamienMcKenna: Some commit messages were in the wrong place. -#2603458 by Frando: Fixed update 7018 for sites using Entity Translation, and - re-run it. -#1355788 by DamienMcKenna: Allow use of 'public://' file scheme for images. -#2550001 by Dave Reid: Blank out metatag_update_7024() and metatag_update_7030() - because the 'twitter:image:src' meta tag was renamed back to 'twitter:image' - so these updates don't need to ever run. -#1957358 by DamienMcKenna: Added tests to confirm that HTML entities work - correctly in the page title. -#2619438 by DamienMcKenna: Improve documentation on the mobile subtheme. -#2597301 by DamienMcKenna: Only use the new locale-URL tokens when translations - modules are enabled. -#2180031 by DamienMcKenna: Fixed double-encoding of tokens. -#2635144 by DamienMcKenna: Added the apple-itunes-app meta tag. -#1904542 by DamienMcKenna: Added a bunch of Windows and IE -focused meta tags. -#2636132 by SpaghettiBolognese: Inconsistency in submodule naming. -#2637026 by matthewordie, DamienMcKenna: Mention in the og:image meta tag how - Facebook will handle multiple images (It defaults to the largest one). -#2564483 by DamienMcKenna, drupov, mas0h, das-peter, pwiniacki, sylus, webflo, - Gábor Hojtsy, pjonckiere, k_zoltan: Fixed i18n integration for core module and - all submodules; added over 1,000 new test assertions in major expansion of the - test suite. -#2644156 by DamienMcKenna: Default value of image_src meta tag for user entity - was set incorrectly. -#2639170 by anthonyleach: Use the correct hooks to add the RDF namespaces. -#2628558 by marcelovani: Renamed the bundled Context definitions to avoid - conflicts. -By DamienMcKenna: Fixed an accidental removal of the Token v1.6 requirement. -#2622662 by rollsd: Adjusted logic to fix problem with entity types that only - have one bundle. -#2648804 by DamienMcKenna: Removed some unfinished code from - metatag_metatags_delete_multiple(). -#2587725 by DamienMcKenna: Fixed display of meta tag labels in localized entity - & config forms. -#2389929 by michee.lengronne, scor, DamienMcKenna, sint: Fixed Google+ HTML - head declaration so it validates, but a change to the site's html.tpl.php is - now required. -#2184857 by DamienMcKenna, mikeytown2: Expanded metatag_metatags_load() to allow - meta tags to be loaded by revision ID. -#1838554 by dimchich, jcnventura, Bao Truong, marcelovani, DamienMcKenna: Allow - entity tokens to be properly used on entity pages via Metatag:Context i.e. - 'by path'. -#2361343 by marcelovani: Allow by-path definitions to override the page title of - all pages. -#2493689 by DamienMcKenna: Removed two arguments from metatag_metatags_save() - that weren't actually being used. -#2613598 by DamienMcKenna: Added a copy of the Contributor Covenant in the - CODE_OF_CONDUCT.txt file. -#2335015 by DamienMcKenna: Remove og:type 'blog'. -#2649816 by DamienMcKenna: Added a copy of the GPL 2.0 license to the - repository. -#2338211 by DamienMcKenna: Only output the first item of a token for image meta - tags that only support one value. - - -Metatag 7.x-1.7, 2015-07-24 ---------------------------- -#2537738 by deepak_zyxware: Incorrect path to fb_social settings page. -#2535178 by DamienMcKenna: 'multiple' option on Viewport causes problems with - the meta tag's intended values. -#2524460 by DamienMcKenna, adriancotter, gbirch, jrb: Remove custom wrangling - for Views-based custom entity displays, added new hook to allow other modules - to customize as needed (hook_metatag_views_post_render_get_entity). -#2199533 by Adrian Richardson, DamienMcKenna, mairi: Don't reload entities when - processing tokens, it causes problems with content workflows. -#2513892 by DamienMcKenna: Tests for user objects. -#1658970 by DamienMcKenna, stefan.r, subhojit777, HyperGlide, jenlampton: Drush - script to convert data from the Page Title module. - - -Metatag 7.x-1.6, 2015-06-30 ---------------------------- -#2503089 by DamienMcKenna: Added support for the "any" favicon, used for SVG - files in Safari 9. -#2499865 by DamienMcKenna: Improvements to entity selection, all sites will now - automatically start off supporting news, terms and users. -#2503097 by DamienMcKenna: Added the theme-color meta tag. -#2503089 by jdanthinne, DamienMcKenna: Improved wording of the SVG favicon - description. -#2499737 by DamienMcKenna: Moved the Dublin Core Additional Tags meta tags into - a new submodule, metatag_dc_advanced. -#2499739 by DamienMcKenna: Moved the Open Graph Products meta tags into a new - submodule, metatag_opengraph_products. -#2498173 by DamienMcKenna: Clarified the touch icon meta tags available by - adding separate primary vs precomposed tags. -#2499739 by DamienMcKenna: Follow-up to fix a missing variable. -#2507025 by DamienMcKenna: Fixed Panels/Panelizer support for entities after - changes in 1.5. -#2505051 by DamienMcKenna: Automatically check for image URLs in image meta - tags; added a new 'image' attribute to meta tag specifications. -#2504561 by hanoii: Remove unused metatag_load_entity_from_path() function and - corresponding hook. -#2222711 by hanoii, DamienMcKenna, andyg5000: Fixed Views support for entities - after API changes in 1.5. -#2467587 by DamienMcKenna: Clear the Metatag cache when a node's state is - changed via Workbench Moderation. -#2449425 by DamienMcKenna: Only process string values for token replacement. -#2265453 by zd123, DamienMcKenna: CTools keyword substitution for Panels - integration. -#2512284 by DamienMcKenna: Missing token browser link on main Metatag fieldset. -#2513890 by DamienMcKenna: Added tests for taxonomy term integration. -#1404270 by JStanton, DamienMcKenna: Added the Refresh meta tag. -#2384673 by etroid, DamienMcKenna: Added the shortcut icon meta tag. -#2514852 by rrfegade: Spelling mistakes in README.txt files. -#2514878 by DamienMcKenna: Ignore admin pages on Views/CTools-driven entity - pages. -#2514812 by david_garcia: Fix Views integration for ECK entities. -#2514572 by DamienMcKenna: Don't check if records exist when deleting them, - just run the deletion query. - - -Metatag 7.x-1.5, 2015-05-29 ---------------------------- -#2442183 by DamienMcKenna, jwilson: Mention the Image URL Formatter module in - the README.txt file. -#2451231 by DamienMcKenna: Fixed the Devel:Generate integration. -By DamienMcKenna: Rearranged og:type select_or_other integration code to be - after the og:type tag definition. -By DamienMcKenna: Removed duplicate description for video:writer meta tag. -By DamienMcKenna: Standardized structure of all theme functions. -#2452985 by DamienMcKenna: Added 39 additional Dublin Core meta tags. -By DamienMcKenna: Removed duplicate dcterms.rights tag. -By DamienMcKenna: Updated new 'date' dcterms tags to use 'date' generator. -#2460791 by DamienMcKenna: Allow the page region used to trigger output to be - changed; see the advanced settings page for details. -#2462117 by DamienMcKenna: Allow the included default configurations to be - disabled. -#2454499 by Dmitriy.trt: metatag_config_is_enabled() returned FALSE for empty - config, when checked with defaults. -#2407477 by greggles: Provide support for Twitter app tags without having to use - an "app" type. -By DamienMcKenna: Fixed a small mistake in output of metatag_update_7011(). -#2429091 by deviantintegral, DamienMcKenna: Add support for applinks.org tags. -#2417155 by dobe: Feeds import fails because of placement of entity_type. -By DamienMcKenna: Minor text improvements per D8 branch. -By DamienMcKenna: Clarified compatibility with Workbench Moderation. -#2473459 by DamienMcKenna: Updated all links to d.o. -#2479325 by DamienMcKenna: Require Token 1.6. -#1491562 by jonathan_hunt, knalstaaf: Add instructions to README.txt explaining - how to configure meta tags for entity bundles. -#2449425 by DamienMcKenna: Refactored select_or_other usage, API addition. -#2487179 by DamienMcKenna: Allow longer cache IDs to reduce conflicts. -#2473107 by DamienMcKenna: Added a warning about having more og:image:type - values than there are og:image values, it can lead to Facebook validation - errors. -#2474427 by DamienMcKenna: Added an advanced option to disable the output cache. -#2432517 by undertext, DamienMcKenna: Check all CTools contexts, not just the - first one. -#2449425 by DamienMcKenna: Follow-up for select_or_other bug. -#2415983 by ciss, DamienMcKenna: Core elements not removed when no metatag - substitute provided. -#2490846 by DamienMcKenna: Using [metatag] tokens failed if the value was empty. -#2466629 by DamienMcKenna, rupertj: Ensure entity is an object before checking - its language code. -#2081717 by DamienMcKenna: Added Admin Menu item for flush the Metatag caches. -By DamienMcKenna: Noted that the 'shortlink' meta tag replaces 'shorturl'. -#2493711 by akoe, DamienMcKenna: Added geo.position, geo.placename, geo.region - and icbm meta tags. -#2493395 by das-peter: Google+ itemtype meta tag malformatted. -#1915926 by DamienMcKenna: Allow multiple fb:admins values. -#2494271 by DamienMcKenna: og:street_address, og:postal_code, og:country_name - are incorrect. -#1498762 by DamienMcKenna: Added the Rating meta tag. -#2451271 by DamienMcKenna: Added the Referrer meta tag. -#1285946 by DamienMcKenna: Added metatag_mobile submodule with a few mobile - -related meta tags. -#2475147 by MatthewHager, DamienMcKenna: Fixed Feeds integration after its API - changed. -#2070821 by DamienMcKenna, pounard: Major re-architecture to how supported - entities are handled. -#2495877 by DamienMcKenna: Added a Context global config instance. -#2495875 by DamienMcKenna: Added a Panels global config instance. -#1281138 by jantoine, DamienMcKenna, drupalninja99, stuart.crouch, subhojit777, - KarlShea: Metatag:Importer submodule for importing data from Nodewords (D6). -#2376921 by DamienMcKenna: Trigger an entity cache clear when meta tags are - saved or deleted. -#2496487 by DamienMcKenna: The function is called entity_get_info(), not - entity_info(). -#2103321 by mistermoper, DamienMcKenna: Added 24 more Open Graph meta tags for - managing product information. -#2085747 by DamienMcKenna: Added twelve favicon varieties to a new submodule, - Metatag: Favicons. -By DamienMcKenna: Removed message from metatag_opengraph_install() warning about - compatibility with the RDF module, which is no longer applicable. -#2408211 by infinet, MatthewHager: Context substitution added to Metatag: Panels - output. -#2156653 by mitsuroseba, undertext, asgorobets, DamienMcKenna: Added a custom - pane for adding the meta tags fieldset to a node form customized via Panels. -#2496487 by DamienMcKenna: Follow-up on previous commit, remove unneeded - function_exists() call. - - -Metatag 7.x-1.5-beta1, 2015-02-02 ---------------------------------- -#2362639 by DamienMcKenna: Improved defaults for Google+ meta tags. -#2318985 by DamienMcKenna: Indicate that Open Graph tags are used on Pinterest. -#2362639 by DamienMcKenna: Added itemtype default values for Google+ meta tags. -#2358137 by DamienMcKenna: Added a submodule for managing site verification - meta tags, the first of which is for Google. -#2358131 by DamienMcKenna: Support for the Pinterest verification meta tag. -#1848338 by larowlan, DamienMcKenna: Added more tests, especially one for - checking the editorial process on a node. -#2362893 by ipo4ka704: Don't assume the first Panels context is an object. -#2363591 by DamienMcKenna: Added a default for the 'image' meta tag on user - entity pages. -#1967856 by duozersk: Fixed a minor mistake in the previous commit. -#2370943 by Simon George: Removed redundant comment. -#2373189 by nmillin: Added support for the Bing verification code. -#2358139 by nmillin: Added support for the Yandex verification code. -#2378127 by DamienMcKenna: Support for rel="alternate" hreflang="x" link tag. -#2376915 by jenlampton, DamienMcKenna: Added the og:image:url meta tag. -#1978708 by DamienMcKenna, scor: Updated warning about compatibility with the - RDF module in Drupal core before 7.33. -#2385265 by mikemiles86: Correctly flatten Metatag form fieldsets in Context - integration. -#2370439 by potop, DamienMcKenna: Work around hook_entity_load() problems by - loading entity info in metatag_entity_supports_metatags() on demand. -#1868460 by preshetin: Added the rel=prev and rel=next meta tags. -#2388339 by das-peter: Fix select_or_other integration for Metatag:GooglePlus, - add the missing element_validator. -#2391975 by Spleshka: Support scenarios where the entity is possibly blank or - has no entity_id assigned yet, e.g. Profile2 pages. -#2400241 by greggles: Typo in description of robots-notranslate option. -#2400529 by greggles: Add support for OG product price:amount, price:currency. -#2411607 by liberatr, DamienMcKenna: README.txt note about using the - field_multiple_types module to control how many items are output. -#2415025 by DamienMcKenna: l() in metatag_metatag_info() creates recursion bug. -#2411477 by betz, DamienMcKenna: $form[#entity] doesn't work for all entities. -#2411549 by maijs: Language is lost during migration. -#2198669 by D2ev: Using metatag tokens can easily cause an infinite loop. -#2411477 by DamienMcKenna, betz: Follow-up to last change. - - -Metatag 7.x-1.4, 2014-10-09 ---------------------------- -#2353079 by DamienMcKenna: Fixed Views integration, for real this time. -#2344877 by DamienMcKenna: Fixed Panels integration, for real this time. - - -Metatag 7.x-1.3, 2014-10-07 ---------------------------- -#2350967 by das-peter, DamienMcKenna: Fatal error occurred loading any View that - did not have meta tags assigned. -#2344877 by DamienMcKenna, Mau Palantír, libelle2000: Fixed Panels integration. -By DamienMcKenna: metatag_metatags_load()'s documentation was incorrect. -#2347193 by DamienMcKenna: Updated Feeds integration to be compatible with the - new data structures in 1.0, and revision_id problems. - - -Metatag 7.x-1.2, 2014-10-04 ---------------------------- -#2343909 by DamienMcKenna: Unable to update meta tags on nodes that didn't - contain translations. -#2185791 by DamienMcKenna: Improved logic for deciding which meta tag values - to use for the current language; new advanced option allows loading of the - entity's default language's values if nothing else matches. -#2346159 by DamienMcKenna: Fixed tag dependencies, which were broken in 1.0. -#2346153 by DamienMcKenna: Added Twitter app 'name' tags, misc improvements to - Twitter Cards code. -#2185791 by DamienMcKenna: Changed the no-values-to-load entity language default - logic so that the default language values will be loaded unless disabled. -#1304038 by DamienMcKenna: Indicate in the README.txt how to disable output for - the three meta tags output by Drupal core by default. -#2350129 by DamienMcKenna: Added a Drush command for clearing Metatag's caches. -#2341795 by DamienMcKenna: Updated Metatag:Views to be compatible with the new - form data structure in 1.0. -#2292043 by eric.chenchao, DamienMcKenna: Added Google+ 'itemprop' meta tags. -#2341795 by DamienMcKenna: Fixed Views previews. -#2289139 by maijs, DamienMcKenna: Allow each Views display to have different - meta tag values. - - -Metatag 7.x-1.1, 2014-09-18 ---------------------------- -#2340639 by agoradesign: Additional check needed in hook_requirements to avoid - breaking installation profiles. -#2340337 by DamienMcKenna: Config system updated for the new language-based - data handling. -#2330823 by DamienMcKenna: REVERT: Remove the deprecated G+ Author meta tag. - - -Metatag 7.x-1.0, 2014-09-17 ---------------------------- -#2319389 by DamienMcKenna: Additional Open Graph meta tags, for videos. -#2169575 by gvorbeck: Workbench Moderation v2 doesn't need any hackery, so - removed the message in hook_requirements(). -#2140189 by ttkaminski, DamienMcKenna: Added an index to {metatag} table for the - 'type' and 'revision_id' fields. -#1391554 by DamienMcKenna: Handle scenarios where the legacy "metatags" module - had been installed. -#2325459 by DamienMcKenna: Used JSHint to correct some minor JS bugs. -#2326197 by Dave Reid: metatag_generate_entity_metatags() cache can be bypassed. -By DamienMcKenna: Updated the og:image size guidelines. -By DamienMcKenna: Remove the redundant metatag_taxonomy_term_view_alter(). -By DamienMcKenna: Support Twitter Cards fieldset in Metatag:Context. -#1778286 by alberto56: Removed the deprecated metatag_ui module. -#2331677 by othermachines: Updates 7025 and 7027 attempted to update the wrong - tables. -#2330823 by othermachines: Remove the deprecated G+ Author meta tag. -#2186155 by DamienMcKenna, grahamC, JeroenT: Resolved problems when saving an - entity directly rather than via entity form. -By DamienMcKenna: Corrected the namespace prefix for OG video meta tags. -#2186155 by DamienMcKenna: Follow-up to fix a number of scenarios. - - - -Metatag 7.x-1.0-rc2, 2014-08-05 -------------------------------- -#1904266 by mvwensen, DamienMcKenna: Added the dcterms.modified meta tag. -#2202031 by DamienMcKenna: Don't double-encode output, handle   specially. -#2026343 by DamienMcKenna, skruf, valkum, wxman: Added many more Open Graph meta - tags. -#2164919 by DamienMcKenna: Added an Advanced Settings page. -#2241083 by DamienMcKenna: API structure for definiting field dependencies; - currently limited to hiding/showing fields, can be expanded later with - validation logic. Initial implementation for some Open Graph and Twitter Cards - meta tags. -#2307523 by leewillis77, DamienMcKenna: Additional arguments for two - drupal_alter hooks. -#2241083 by rooby: Refactored meta tag output generation using a new function, - metatag_generate_entity_metatags(), allowing for the tags to be independently - obtained for a given entity. -#2262159 by DamienMcKenna: Bumped core requirement to 7.28, removed the - [node:summary] fix that's no longer needed. -#2306449 by DamienMcKenna: Not having the Transliteration or Imagecache Token - modules installed no longer reports an error in hook_requirements(). -#1328562 by andremolnar, Greg Boggs, DamienMcKenna: Improved form descriptions. -#1918706 by theunraveler, DamienMcKenna, Zekvyrin, JeroenT: [current-page:title] - didn't work correctly on Panels pages. -#2153977 by paolomainardi, DamienMcKenna: Fix for translations of base entity - type configuration when there is no bundle configuration. -#2572891 by DamienMcKenna: Removed most 'fine tuning' items from the README.txt - file, added notes again about using Imagecache_Token to improve images. - - -Metatag 7.x-1.0-rc1, 2014-07-12 -------------------------------- -By DamienMcKenna: Small improvement to the comment on update 7007. -#2196393 by generalconsensus, aprohl5: Typo in hook_install(). -#2237507 by SebCorbin: Only delete all records when editing one entity revision. -#2056739 by B-Prod: Incorrect language handling when displaying entity pages - using Panels. -#2205675 by Romlam, greggles: Typo in variable name caused data to not load. -#2265447 by opdavies: Ignore comment entities, conflict with comment_fragment. -#2271685 by adee147: Typos in metatag_metatags_cache_clear(). -#2271811 by DamienMcKenna: Replaced theme_metatag_opengraph() with - theme_metatag_property(). -#1282636 by DamienMcKenna: Support meta tags that allow multiple values; first - supported tags are og:image and og:image:secure_url. -#2273459 by DamienMcKenna: Improved Twitter Cards default values. -#2273241 by DamienMcKenna: Use the new hook_metatag_bundled_config_alter() to - load settings from submodules. -#2273493 by DamienMcKenna: Improved Dublin Core default values. -#2274921 by DamienMcKenna: Token browser link missing on settings pages. -#2277787 by eugene.ilyin: Missing translations in metatag_context. -By DamienMcKenna: Removed duplicate 'devel_generate' setting for 'image_src'. -#2282903 by DamienMcKenna: Special handling for meta tags that need to output a - secure URL, replace 'http://' with 'https://'. -#2281833 by DamienMcKenna: Ensure multi-item values are output in a consistent - order. -#2275323 by drastik: Provide link to settings page in Metatag:Context module. -#1284810 by DamienMcKenna: Really recommend installing Imagecache Token. -#1809356 by DamienMcKenna: Sort all meta tags. -#2276361 by DamienMcKenna: Move Facebook meta tags into a separate submodule. -#2185943 by fizk: Remove warnings about Exclude Node Title. -#2266595 by hefox: Change watchdog() message to a warning not critical, to avoid - problems with Jenkins. -#2193195 by 75th Trombone: Corrected a variable usage in README.txt. -#1338612 by Lasac, DamienMcKenna: Added the content-language meta tag. -#2291993 by DamienMcKenna: Duplicate fb meta tags causes lots of errors. -#2285787 by SebCorbin: Entity Translation problems with revisions. -#2025425 by moonray, David_Rothstein, hefox, DamienMcKenna: Cache improvement - to separate entity vs page language. -#2186241 by nnevill.io1, DamienMcKenna: Revisions support for Panels. -#2051407 by cha0s, DamienMcKenna: Language support for token integration. -#2183203 by mikeytown2, juampy, DamienMcKenna: Improved queries in - metatag_metatags_load_multiple(). -#2227377 by DamienMcKenna: taxonomy_vocabulary_load() caused problems when - executed during hook_entity_info_alter(). -#1995564 by DamienMcKenna, willieseabrook: Added a warning about a possible - conflict with the Admin Language module. -#2298337 by DamienMcKenna: Added an API option to indicate one meta tag replaces - another; updated API docs accordingly. -#2267501 by DamienMcKenna: Renamed the 'twitter:image' meta tag to the correct - 'twitter:image:src'. -#2121437 by DamienMcKenna: Renamed the 'copyright' meta tag to the correct - 'rights' tag. -#2177455 by DamienMcKenna: Avoid errors when updating from older releases due - to missing revision_id field. -#2178411 by DamienMcKenna, kporras07: Language not assigned correctly on CTools - -based pages. - - -Metatag 7.x-1.0-beta9, 2014-01-18 ---------------------------------- -#2174363 by DamienMcKenna: Changed update 7018 to avoid attempting to create - duplicate records when updating; instead should there be a collision the - record with revision_id 0 will be deleted. -#2176351 by DamienMcKenna: 403 and 404 error pages will use the global default - for the page title instead of copying the homepage's. -#2175843 by DamienMcKenna: It was possible to get to update 7016 without the - revision_id field existing, so make sure it exists. -#2081787 by attila.fekete: Don't let Metatag:Views overwrite the frontpage meta - tag config, matching how Metatag:Panels works. -#2176375 by DamienMcKenna: Added note to README.txt about the Textimage module's - compatibility with Metatag. -#2170771 by DamienMcKenna: Added support for the og:image:secure_url meta tag. - - -Metatag 7.x-1.0-beta8, 2014-01-15 ---------------------------------- -#1995284 by DamienMcKenna: Replace $_SERVER['REQUEST_URI'] with request_uri(). -By DamienMcKenna: Updated the README.txt's Credits section to match the project - page. -#1978708 by DamienMcKenna: Added a note to the README.txt, hook_install and - hook_requirements to mention that RDF can cause validation errors for the - Open Graph meta tag output. -#1977640 by dsdeiz: Fixed a comment typo. -#1978730 by DamienMcKenna: Added an installation note to read the README.txt - file. -#1978568 by DamienMcKenna: Strip line breaks in all tag output. -#1961354 by DamienMcKenna, thesame: Optionally provide additional permissions - so that access to modify each meta tag can be controlled individually, see - README.txt for more details. -#1933678 by DamienMcKenna: Default Context configurations for the user login and - registration pages. -#1816856 by DamienMcKenna: Default Context configuration for the main forum - page. -#1292612 by DamienMcKenna: Default Context configuration for the main blog - page. -#1988346 by DamienMcKenna: Form permissions were being overridden thus making - the Metatag fieldset visible when it shouldn't have been. -#1994352 by AmbikaFR: Two strings were not translatable. -#1970064 by Jorrit: Metatag:Panels did not load the data correctly. -#1994634 by DamienMcKenna: DrupalTextMetaTag::getValue fails if - $options['instance'] element doesn't exist. -#1994630 by DamienMcKenna: Cleanup/filter all meta tag output. -By DamienMcKenna: Moved hook_requirements to the top of metatag.install. -#1982164 by DamienMcKenna: Added hook_requirements note to ensure that Entity - Translation is up-to-date. -#2020565 by DamienMcKenna: Save the correct language value on initial entity - creation. -#1876034 by DamienMcKenna: Updated a comment to indicate that there was a - problem with Metatag itself when saving records via node_save(), not - Workbench Moderation after all. -#2024277 by greggles, DamienMcKenna: Don't output a meta tag if the string is - blank, but still allow "0" to be output when needed. -#1999936 by DamienMcKenna: Fixed poor logic for checking if a valid language - was available in metatag_metatags_values(). -#2024277 by DamienMcKenna: Follow-up to fix all meta tag output. -#1498764 by nick_schuch, DamienMcKenna: Added the Revisit-After meta tag. -#1671846 by benys, DamienMcKenna: Expose meta tags as tokens. -#1830952 by DYdave, DamienMcKenna: Allow token types and patterns to be altered. -#1859136 by plopesc, DamienMcKenna: Properly update meta tag records. -#2045855 by czigor: Fix translation of meta tag info labels. -#1572474 by PieIsGood, Dan Reinders, DamienMcKenna: Entity revision support. -#2051401 by cha0s: Remove errant dpm() left in from earlier testing. -#2037677 by adnasa, DamienMcKenna, tsvenson: UX improvement for the token popup. -#1985932 by kolier: Correct the taxonomy term token on Panels pages. -#2033723 by som30ind, DamienMcKenna: Fixed occasional error saving array values, - e.g. the ROBOTS tag. -#1959830 by DamienMcKenna: Added a note to README.txt about Node Form Panes. -#2061511 by amanire: Verify view display 'path' option exists before using it. -#1776836 by kobee, DamienMcKenna: Added the Standout meta tag. -#2095397 by DamienMcKenna: Allow method to skip skipping metatag_entity_view(). -#2095501 by DamienMcKenna: Logic mistake in metatag_metatags_delete_multiple() - meant records were never deleted. -#2072087 by brunascle: Twitter Cards changed to use correct 'name' attribute. -#2086037 by greggles: Only show schema warning messages to appropriate people. -#1311050 by pasive, DamienMcKenna: Added the og:locale meta tag. -#2082539 by DamienMcKenna, hswong3i: {metatag}.revision_id cannot be null. -#2082539 by DamienMcKenna: Follow-up to make all revision_id values numeric. -#1848338 by DamienMcKenna: Added a list of test scenarios that need to be added. -#2152043 by DamienMcKenna: Devel Generate integration via Metatag:Devel - submodule. -#2152043 by DamienMcKenna: Expanded Devel Generate integration to cover almost - all included meta tags. -#1572474 by DamienMcKenna, HyperGlide, jyee, Kristen Pol, sylus: Fixes for - revisions support. -#1876042 by DamienMcKenna: Rename variables to use $entity_id instead of $id - in metatag.admin.inc, $entity_type instead of $type in metatag.migrate.inc. -#2157689/#2088299 by travelertt, iMiksu, DamienMcKenna: JS error broke - CKEditor, etc. -#2168343 by DamienMcKenna: Clear EntityCache bins. -#2062379 by DamienMcKenna: Restructured caching. -#2168939 by DamienMcKenna: Don't skip batch processing on updates ran via Drush. -#2169547 by DamienMcKenna: Clarification on Workbench Moderation support. -#2090557 by Kristen Pol, DamienMcKenna: Don't cache tags on 403/404 error pages. -#1848622 by DamienMcKenna: Translation helper for 'bar'. -#1967856 by duozersk: Support for the noimageindex and notranslate robots tag - options. -#2140463 by zhuber: Small misspelling in a comment. -#1963678 by DC_Marc, gnuget, Albert Volkman: Additional Twitter Card meta tags. -#2170363 by juampy: Incorrect data handling in DrupalDefaultMetaTag. -#1286270 by DamienMcKenna: Provide options for disabling meta tags on specific - entity types or entity bundles, see README.txt for details. -#2071649 by eelkeblok, DamienMcKenna: Verify the entity still exists when - loading meta tag data in metatag_ctools_render_alter() and - metatag_views_post_render(). -#2126157 by hefox: metatag_entity_has_metatags() returns TRUE for disabled - entities, not FALSE. -#2001178 by jantoine, DamienMcKenna: Verify the language exists before saving. -#1864306 by hefox: Export the 'disabled' state via Features, thus allowing - disabled configurations to be exported too. -#2172883 by Kristen Pol, DamienMcKenna: Only use Workbench Moderation functions - on nodes. -#1975552 by pivica, DamienMcKenna: Fixed errors when changing {metatag} table's - primary keys. -#1864306 by DamienMcKenna: Follow-on to only export the $config->disabled - setting if it exists. -#2173271 by deetergp: Spelling and grammar fixes for README.txt. -#2172433 by fabsor, DamienMcKenna: Ensure that update 7015 runs early enough to - avoid data corruption or errors during other updates. -#2156261 by plopesc, DamienMcKenna: Allow meta tags for 403/404 error pages to - be configured, along with some reasonable defaults; removed previous option to - control caching on these pages, the meta tags are now always cached. -#2173863 by DamienMcKenna: Don't load meta tags on admin pages, provide setting - to override this. -#2174363 by DamienMcKenna: Don't attempt to create revision records in update - 7018 if one already exists. - - -Metatag 7.x-1.0-beta7, 2013-04-22 ---------------------------------- -#1970946 by laura s: Twitter Cards no longer requires SSL. -#1971406 by alextataurov, DamienMcKenna: Correct check to see if i18n is - installed. -#1955898 by DamienMcKenna: Clicking 'cancel' when editing a per-path - configuration would cause the config to be deleted. -#1955894 by plopesc: It wasn't possible to remove values from the - Metatag:Context editor. -#1972038 by DamienMcKenna: Context admin page didn't display the '' path - correctly. -#1970064 by DamienMcKenna: Metatag:Context did not load the data correctly. -#1970518 by John Morahan: Incorrect syntax in metatag.info. -#1972932 by chrisjlee: Typo in hook_requirements. -By DamienMcKenna: Removed trailing space in some files. -#1951118 by DamienMcKenna: Display a runtime hook_requirements error message if - the old metatag.entity_translation.inc file is still present. -By DamienMcKenna: Removed some tabs that snook in. -#1973254 by plopesc: Added functional tests for Metatag:Context. -#1284756 by dsdeiz: Add instructions to metatag.migrate.inc explaining how to - use the Migrate integration. -#1954106 by DamienMcKenna: Simplified the project's name to just 'Metatag'. -#1974870 by DamienMcKenna: Moved all modules to the 'SEO' package. - - -Metatag 7.x-1.0-beta6, 2013-04-14 ---------------------------------- -#1961448 by DamienMcKenna: Disable the fb:app_id field if fb_social is present. -#1282620 by idflood, evanbarter, mgifford, Lukas von Blarer, Peacog, zterry95, - DamienMcKenna: Configuration translation through integration with the i18n - module. -#1498740 by devuo: Merged Diogo's metatag_panels module. -#1804356 by Dave Reid: Merged Dave's metatag_views module. -#1909224 by DamienMcKenna: Fixed sloppy code in metatag_metatags_form_submit(). -#1969428 by DamienMcKenna: Changed the DC 'property' attribute to 'name'. -#1284756 by dsdeiz: Update Migrate integration for compatibility with v2.5, - support additional entity types. -#1953724 by DamienMcKenna, joshf, wiifm, twistor: PostgreSQL compatibility for - recent updates. -#1295524 by DamienMcKenna: Temporary fix for the [node:summary] token not - working. -#1952190 by DamienMcKenna: Only run queries involving taxonomy data if the - Taxonomy module is enabled. - - -Metatag 7.x-1.0-beta5, 2013-03-23 ---------------------------------- -#1844638 by DamienMcKenna: Updated help messages around update 7004, when ran - via Drush it will no longer used Batch API. -#1844764 by Devin Carlson, DamienMcKenna: Fix arg placeholders in t() calls. -#1846516 by Staratel: Incorrect arguments for watchdog(). -#1846516 by DamienMcKenna: Further incorrect arguments for watchdog(). -#1844638 by DamienMcKenna: Correctly used drupal_is_cli() instead of just - php_sapi_name(). -#1846978 by edulterado: Corrected the theme function name used with the - Twitter Cards submodule. -#1307804 by juampy: Support for Select_or_Other for use with the OpenGraph - 'type' field. -#1854522 by DamienMcKenna: Redundant return statements in the MetaTag classes. -#1852600 by DamienMcKenna: Only use the first page argument in the Views and - Panels preprocessors if it is numerical. -#1850014 by plopesc: Not all contexts that may be shown on the admin page will - have a path condition defined. -#1846080 by DamienMcKenna: Only support entities that have the 'metatags' - option specifically enabled. -#1857116 by DamienMcKenna: Purge {metatag} records for a few known unsupported - entities that old versions would have saved. -#1857116 by DamienMcKenna: Don't purge 'file' {metatag} records until #1857334 - is decided. -#1857360 by DamienMcKenna: Purge {metatag} records for nodes, taxonomy terms - and users that were purged but where the APIs of older versions failed to - remove them. -#1857116 by DamienMcKenna: Purge {metatag} records for Profile2. -#1852600 by helmo: Typo in Views integration function. -#1852022 by DamienMcKenna: Don't export the {metatag_config}.cid field. -#1862570 by DamienMcKenna: Purge any empty values that may have been added by - very early releases. -#1862570 by DamienMcKenna: Follow-up to correctly handle the serialized empty - array. -#1864340 by cdoyle, DamienMcKenna: Incorrect output for certain Twitter Card - tags. -#1865170 by DamienMcKenna: Fix metatag_requirements() return array when the - Page Title module is also installed. -#1722564 by DamienMcKenna: Provide a hook_requirements() message and README.txt - note about a possible conflict with the Exclude Node Title module. -#1284756 by damiankloip, sylus, alanburke, lancee: Migrate module integration. -#1865228 by greggles, DamienMcKenna: Added the rel=author link meta tag. -#1866122 by DamienMcKenna: Added the twitter:site:id and twitter:creator:id - meta tags. -#1866980 by makangus: Corrected metatag_features_revert(). -#1862818 by DYdave, DamienMcKenna: Added documentation for - hook_metatag_config_default(). -#1778534 by DamienMcKenna: Added the original-source meta tag. -#1886170 by DamienMcKenna: Typo in the API docs regarding enabling metatag - support in custom entities. -#1871020 by DamienMcKenna: Compatibility problem with Workbench_Moderation. -#1773926 by Dave Reid: Fixed token validation fails on config edit if the - instance context is not an entity type. -#1814736 by plach, Dave Reid: metatag_page_build() did not check if the - global:frontpage metatag configuration is disabled. -#1871852: Fixed metatag_update_7005() did not check if the watchdog table - exists. -#1891082 by bago, Dave Reid: Fixed metatag_config_instance_label() failed to - recurse properly. -#1915284: Fixed metatag_html_head_alter() stopped removing duplicate tags too - soon. Fixed duplicate canonical links when global redirect is enabled. -#1845326 by DamienMcKenna, Peacog: Resolved language handling problems to - correctly identify the langcode to properly work with or without - Entity_Translation. -#1876042 by DamienMcKenna: Rename variables to use $entity_id instead of $id - and $entity_type instead of $type. -#1859136 by splatio, DamienMcKenna, multpix: Feeds integration - allow meta tag - fields to be the target for data imported using the Feeds module. -#1880302 by olli, DamienMcKenna: Resolve problems with Features integration. -#1923030 by krlucas, DamienMcKenna: Only run metatag_entity_update() on - supported entities. -#1844638 by DamienMcKenna, mikeytown2: Remove unnecessary duplicate {metatag} - records, fix language values for all entities. -#1935084 by DamienMcKenna: Remove unnecessary items from metatag_hook_info() - that was causing problems with PHP 5.4. -#1791720 by kbasarab: Added the news_keywords meta tag. -#1934492 by juampy, DamienMcKenna: Added a page for reverting meta tags for - specific entity or bundle. -#1386320: Note a known issue of using custom template files that do not output - the $page['content'] variable. -#1917902 by DamienMcKenna: Ensure strings returned from token replacement of - text fields ([node:summary]) is passed through the appropriate text filters. -#1919070 by DamienMcKenna: Fix any records that may have been corrupted by e.g. - #1871020. -#1861656 by DamienMcKenna, torrance123: Optionally load the global meta tags on - all pages, enabled by default. -#1871798 by mstrelan: Clear the Context plugin cache when metatag_context is - enabled so that the new plugin becomes available. -#1932192 by DamienMcKenna: Only run metatag_entity_view() once per page view. -#1900434 by Dustin Currie, j0rd, DamienMcKenna: Added several new OpenGraph meta - tags, including ones for videos, location and contact information. -#1883118 by DamienMcKenna: Improve the help message on Metatag:Context's Path - field as neither relative nor absolute URLs will work. -#1945114 by SergO, DamienMcKenna: A query from #1919070 was missing the - preproccess wrapper around the table name. -#1908586 by DamienMcKenna: Added a line to README.txt explaining how to - customize the tokens used to generate the meta tags. -#1350610 by DamienMcKenna: metatag_update_7001 needed to drop the primary key - before customizing it. -#1859136 by DamienMcKenna: Fixed scenarios when updating an entity there are two - copies of the data submitted, e.g. Feeds integration. -#1308790 by DamienMcKenna: Documented that [current-user] tokens should not be - used. -#1318294 by DamienMcKenna: Documented how to use Imagecache Token to resize - images that are being used as tokens for meta tags. -#1871534 by DamienMcKenna: Documented how some browser plugins can make the page - title appear to be wrapped with doublequotes though the output doesn't - actually show them. - - -Metatag 7.x-1.0-beta4, 2012-11-17 ---------------------------------- -#1842764 by DamienMcKenna: Work around problems in metatag_entity_load() - stemming from an outdated database schema, leave a message suggesting the - site admin run the database updates. -#1842868 by DamienMcKenna: Changed metatag_update_7003 to automatically assign - the correct language per entity, added update_7004 to fix records updated in - beta3, fixed the language selection for loading meta tags so sites without - translation functionality continue to work correctly. -#1842868 by DamienMcKenna: Changed update 7003 again so it *only* adds the new - field, changed update 7004 so it will update all records using Batch API. -#1843676 by DamienMcKenna: Changed the hook_requirements message to an INFO - message if Page_Title is also installed, will freak people out less. - - -Metatag 7.x-1.0-beta3, 2012-11-16 ---------------------------------- -#1688286 by colan, DamienMcKenna: Support for Entity Translation. -#1835030 by DamienMcKenna: Documentation and hook_requirements note re Drupal - core v7.17. -#1840402 by DamienMcKenna, paperdhc: Corrected use of array_pop(). -#1841404 by mh86: Don't attempt to load meta tags for unsupported entities, and - don't support configuration-only entities. -#1841564 by peximo: Correctly identify the content language being used on the - homepage. -#1841774 by DamienMcKenna: Provide a warning via hook_requirements if the Page - Title module is also enabled, due to the possibilities of complications and - unexpected results. -#1363476 by DamienMcKenna: Workaround to trigger metatag_entity_view() if the - current CTools (Panels, Panelizer, etc) page is an entity display page. -#1842052 by DamienMcKenna: Don't process unsupported entities being displayed - via Views. -#1664322 by nico059, kerasai, miechiel, idflood, DamienMcKenna, alexweber: - Twitter Cards meta tags. -#1842198 by DamienMcKenna: Move the 'advanced' fieldset under the others. -#1840236 by weri, Marty2081: Only revert the requested feature, not all - features. - - -Metatag 7.x-1.0-beta2, 2012-10-30 ---------------------------------- -#1817580 by DamienMcKenna: Removed code that was enabling debug mode on all - Contexts. -#1818240 by DamienMcKenna: Added $instance value to the drupal_alter() call in - metatag_metatags_view(). -#1817984 by DamienMcKenna, alexweber: Documented - hook_metatag_metatags_view_alter(). -#1818252 by DamienMcKenna: There was no caching on the front page's meta tags. -#1818516 by DamienMcKenna: Incorrect variable check in metatag_page_build(). -#1818762 by DamienMcKenna: Updated hook_hook_info(). -#1466292 by DamienMcKenna: Listed hooks in metatag.api.php and everywhere the - hooks are triggered there's a comment to say what the hook is. -#1818984 by DamienMcKenna: Add the $instance value to metatag_context's - triggering of hook_metatag_metatags_view. -#1819000 by DamienMcKenna: Don't load default meta tags if no active contexts - define meta tags. -#1819448 by DamienMcKenna: Error on admin page if any meta tags were disabled. -#1818958 by DamienMcKenna: The $cid_parts array should contain all relevant - entity variables. -#1820362 by DamienMcKenna: $cid_parts should use base_path() instead of '/'. -#1820374 by DamienMcKenna: Front page $cid_parts did not include the full URL. -#1822726 by DamienMcKenna: Ensure the CTools exportables system is loaded. -#1818300 by eugene.ilyin, DamienMcKenna: Improved Features integration. -#1151936 by DamienMcKenna, maximpodorov: Workaround to trigger - metatag_entity_view() if the current Views page is an entity display page. - - -Metatag 7.x-1.0-beta1, 2012-10-19 ---------------------------------- -First mostly-stable release. diff --git a/source/webapp/sites/all/modules/contrib/metatag/CODE_OF_CONDUCT.txt b/source/webapp/sites/all/modules/contrib/metatag/CODE_OF_CONDUCT.txt deleted file mode 100644 index 587ba66b7c..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/CODE_OF_CONDUCT.txt +++ /dev/null @@ -1,3 +0,0 @@ -Contributor Code of Conduct ---------------------------- -See: https://www.drupal.org/dcoc diff --git a/source/webapp/sites/all/modules/contrib/metatag/LICENSE.txt b/source/webapp/sites/all/modules/contrib/metatag/LICENSE.txt deleted file mode 100644 index d159169d10..0000000000 --- a/source/webapp/sites/all/modules/contrib/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. - - - 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/source/webapp/sites/all/modules/contrib/metatag/README.txt b/source/webapp/sites/all/modules/contrib/metatag/README.txt deleted file mode 100644 index 4350c11502..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/README.txt +++ /dev/null @@ -1,419 +0,0 @@ -Metatag -------- -This module allows you to automatically provide structured metadata, aka "meta -tags", about your website and web pages. - -In the context of search engine optimization, providing an extensive set of -meta tags may help improve your site's & pages' ranking, thus may aid with -achieving a more prominent display of your content within search engine -results. Additionally, using meta tags can help control the summary content -that is used within social networks when visitors link to your site, -particularly the Open Graph submodule for use with Facebook, Pinterest, -LinkedIn, etc (see below). - -This version of the module only works with Drupal 7.40 and newer. - -For additional information, see the online documentation: - https://www.drupal.org/docs/7/modules/metatag - - -Features --------------------------------------------------------------------------------- -The primary features include: - -* The current supported basic meta tags are ABSTRACT, DESCRIPTION, CANONICAL, - GENERATOR, GEO.PLACENAME, GEO.POSITION, GEO.REGION, ICBM IMAGE_SRC, KEYWORDS, - PUBLISHER, REFRESH, REVISIT-AFTER, RIGHTS, ROBOTS, SHORTLINK, and the page's - TITLE tag. - -* Multi-lingual support using the Entity Translation module. - -* Translation support using the Internationalization (i18n) module of the global - configurations, the values for all three submodules (Metatag:Context, - Metatag:Panels, Metatag:Views), and the final meta tags being output. - -* Full support for entity revisions and workflows based upon revision editing, - including compatibility with the Revisioning and Workbench Moderation modules. - -* Automatically extracts URLs from image fields, no need for extra modules. - -* String-based meta tags may be automatically trimmed to a certain length, and - the lengths may be easily customized to accommodate changes in search engine - algorithms. - -* A custom pager string may be added to meta tags by inserting the token - [current-page:pager] into e.g. page titles, description tags, etc. The - replacement string may be customized from the settings page. - -* Per-path control over meta tags using the "Metatag: Context" submodule - (requires the Context module). - -* Integration with the Views module allowing meta tags to be controlled for - individual Views pages, with each display in the view able to have different - meta tags, by using the "Metatag: Views" submodule. - -* Integration with the Panels module allowing meta tags to be controlled for - individual Panels pages, by using the "Metatag: Panels" submodule. - -* 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. - -* Twenty six additional Open Graph Protocol meta tags are provided for - describing products in the "Metatag: Open Graph Products" 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 App Links meta tags may be added by enabling the Metatag: App Links - 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. - -* Support for meta tags specific to Google Custom Search Appliance are available - in the "Metatag: Google Custom Search Engine (CSE)" submodule. - -* A variety of favicon sizes and styles can be added to the global configuration - using the Metatag: Favicons submodule. - -* An API allowing for additional meta tags to be added, beyond what is provided - by this module - see metatag.api.php for full details. - -* Support for the Migrate module for migrating data from another system - see - metatag.migrate.inc for full details. - -* Support for the Feeds module for importing data from external data sources or - file uploads. - -* Support for the Search API module for indexing of keywords. - -* Integrates with Devel_Generate, part of the Devel module, to automatically - generate meta tags for generated nodes, via the Metatag:Devel submodule. - -* Integrates with Workbench Moderation (v1) allowing meta tags on nodes to be - managed through the workflow process; this custom support is not needed in - Workbench Moderation v3 so the extra logic is automatically ignored. - -* The Transliteration module (see below) is highly recommended when using image - meta tags, e.g. og:image, to ensure that filenames are HTML-safe. - -* Adds an extra item to the "Flush all caches" menu for the Admin Menu module, - allowing for a quick way to clear the Metatag module's custom caches. - -* A custom pane, called "Node form meta tags", is available for adding the meta - tags fieldset when the node_edit page is customized using Panels; the - Metatag: Panels submodule does not need to be enabled in order for this to - work. - -* Several advanced options may be controlled via the Settings page. - -* An import script is provided in the Metatag:Importer submodule for sites that - need to import data from Metatags Quick, Nodewords (Drupal 6 only), or Page - Title. - -* If the Media module (v2) is installed, the Media WYSIWYG submodule will be - used to automatically filter out Media's embed codes. - - -Configuration --------------------------------------------------------------------------------- - 1. On the People Permissions administration page ("Administer >> People - >> Permissions") you need to assign: - - - The "Administer meta tags" permission to the roles that are allowed to - access the meta tags admin pages to control the site defaults. - - - The "Edit meta tags" permission to the roles that are allowed to change - meta tags on each individual page (node, term, etc). - - 2. The main administrative page controls the site-wide defaults, both global - settings and defaults per entity (node, term, etc), in addition to those - assigned specifically for the front page: - admin/config/search/metatags - - 3. The list of supported entity types (nodes, taxonomy terms, etc) and bundles - (content types, vocabularies, etc) may be controlled from the Settings page: - admin/config/search/metatags/settings - - 4. In order to provide a specific configuration per entity bundle (content - type, vocabulary, etc), click "Add default meta tags". - - 5. Each supported entity object (nodes, terms, users) will have a set of meta - tag fields available for customization on their respective edit page, these - will inherit their values from the defaults assigned in #2 above. Any - values that are not overridden per object will automatically update should - the defaults be updated. - - 6. As the meta tags are output using Tokens, it may be necessary to customize - the token display for the site's entities (content types, vocabularies, - etc). To do this go to e.g., admin/structure/types/manage/article/display, - in the "Custom Display Settings" section ensure that "Tokens" is checked - (save the form if necessary), then to customize the tokens go to: - admin/structure/types/manage/article/display/token - - -Internationalization with the Translation (core) and Entity Translation modules --------------------------------------------------------------------------------- -The module works with the core Translation module, allowing the meta tags for a -specific entity (node, term, etc) to be tied to a specific language. It also -supports the Entity Translation module, which may work better thank the basic -Translation module depending upon the site's desired functionality. This -integration means that content creators can customize an entity's meta tags for -each language supported on the site, and that the correct meta tags should -always be displayed for each locale. - - -Internationalization with the i18n modules --------------------------------------------------------------------------------- -Using the String Translation (i18n_string) submodule of the Internationalization -(i18n) module package it is possible to translate meta tags: - -* All default configurations (admin/config/search/metatag) are translatable. - When a configuration is created or updated it will pass the values to the - i18n_string system. Additionally it is possible to bulk update them via the - string translation page (admin/config/regional/translate/i18n_string). - -* Meta tags for all submodules (Metatag:Context, Metatag:Panels, Metatag:Views) - are translatable. Similar to the default configurations, these meta tags are - made available when they are created and/or update, and may also be bulk - updated. - -* Meta tags from entities (nodes, terms, etc) are not directly translatable. - -* The final output meta tags are passed through the translation system when the - page is being loaded. It is not possible to use the strings bulk updater to - spool all pages on the site, to do so it would be necessary to spool the page - using a separate script or tool. - -Additionally, certain variables are available for translation using the Variable -Translation submodule of the i18n package: - -* metatag_pager_string - The custom pager string. - - -Internationalization with the Smartling module --------------------------------------------------------------------------------- -The Smartling translation service may be used with the Metatag module provide an -improved UX around the meta tag translation process. In order to do this, the -Smartling Interface Translation (smartling_interface_translation) module must -be enabled. - -For further details see the module's project page: - https://www.drupal.org/project/smartling - - -Search API integration --------------------------------------------------------------------------------- -Entity meta tag values can be made searchable using the Search API module -(https://www.drupal.org/project/search_api). - - 1. Select "Meta tags" under "Data alterations" in the filters for the - index: - admin/config/search/search_api/index/INDEX NAME/workflow - 2. Meta tag fields will now appear under "Fields" and can be enabled there: - admin/config/search/search_api/index/INDEX NAME/fields - - -Fine tuning & suggestions --------------------------------------------------------------------------------- -* There are many options available on the settings page to control how Metatag - works: - admin/config/search/metatags/settings - -* It is possible to "disable" the meta tags provided by Drupal core, i.e. - "generator", "canonical URL" and "shortlink", though it may not be completely - obvious. Metatag takes over the display of these tags, thus any changes made - to them in Metatag will supercede Drupal's normal output. To hide a tag, all - that is necessary is to clear the default value for that tag, e.g. on the - global settings for nodes, which will result in the tag not being output for - those pages. - -* When using Features to export Metatag configurations, it is suggested to - override all of the default configurations and then disable the default - configurations via the advanced settings page; doing so will avoid potential - conflicts of the same configurations being loaded by both the Metatag module - and the new Features-based modules. - -* Using fields to automatically fill in values for image meta tags is the - recommended way of inserting images - the module will automatically extract - the URL from the value. However, by default this forces social networks, - search engines and certain browsers to download the original version of the - image, which could be multiple megabytes. The alternative is to use the - Imagecache_Token module to instead load meta tags via a specific image style. - As an example, in order to load an image from a node field named - "field_meta_tag_image" using the "seo_thumbnail" style, the following token - would be used: - [node:field_meta_tag_image:seo_thumbnail:uri] - or - [node:field_meta_tag_image:seo_thumbnail] - (They give the same results) - Additionally, dimensions of the image may be obtained from the following: - [node:field_meta_tag_image:seo_thumbnail:width] - [node:field_meta_tag_image:seo_thumbnail:height] - - -Developers --------------------------------------------------------------------------------- -Full API documentation is available in metatag.api.php. - -It is not necessary to control Metatag via the entity API, any entity that has -view modes defined and is not a configuration entity is automatically suitable -for use. - -The meta tags for a given entity object (node, etc) can be obtained as follows: - $metatags = metatags_get_entity_metatags($entity_id, $entity_type, $langcode); -The result will be a nested array of meta tag structures ready for either output -via drupal_render(), or examining to identify the actual text values. - - -Troubleshooting / known issues --------------------------------------------------------------------------------- -* When using custom page template files, e.g., page--front.tpl.php, it is - important to ensure that the following code is present in the template file: - - or - - Without one of these being present the meta tags will not be displayed. -* An alternative method to fixing the missing-tags problem is to change the page - region used to output the meta tags. The region used may be controlled from - the settings page, it is recommended to test different options to identify the - one that works best for a specific site. -* Versions of Drupal older than v7.17 were missing necessary functionality for - taxonomy term pages to work correctly. -* Using Metatag with values assigned for the page title and the Page Title - module simultaneously can cause conflicts and unexpected results. It is - strongly recommended to convert the Page Title settings to Metatag and just - uninstall Page Title entirely. See https://www.drupal.org/node/2774833 for - further details. -* When customizing the meta tags for user pages, it is strongly recommended to - not use the [current-user] tokens, these pertain to the person *viewing* the - page and not e.g., the person who authored a page. -* Certain browser plugins, e.g., on Chrome, can cause the page title to be - displayed with additional double quotes, e.g., instead of: - The page title | My cool site - it will show: - "The page title | My cool site" - The solution is to remove the browser plugin - the page's actual output is not - affected, it is just a problem in the browser. -* Drupal core versions before v7.33 had a bug which caused validation problems - in the Open Graph output if the RDF module was also enabled. The solution is - to update to core v7.33 or newer. -* If the Administration Language (admin_language) module is installed, it is - recommended to disable the "Force language neutral aliases" setting on the - Admin Language settings page, i.e. set the "admin_language_force_neutral" - variable to FALSE. Failing to do so can lead to data loss in Metatag. -* If Entity Token is installed (a dependency for Rules, Commerce and others) it - is possible that the token browser may not work correctly and may either - timeout or give an error instead of a browsable list of tokens. This is a - limitation of the token browser. - - -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. - -* Transliteration - https://drupal.org/project/transliteration - Tidies up filenames for uploaded files, e.g. it can remove commas from - filenames that could otherwise break certain meta tags. - -* Imagecache Token - https://www.drupal.org/project/imagecache_token - Use tokens to load images via image styles, rather than forcing meta tags to - use the original image. - -* Alternative hreflang - https://www.drupal.org/project/hreflang - An alternative to the Metatag:hreflang module. Automatically outputs - meta tags on every page - for each language/locale available on the site. Also does not provide any way - of overriding the values or setting the x-default value. - -* Domain Meta Tags - https://drupal.org/project/domain_meta - Integrates with the Domain Access module, so each site of a multi-domain - install can separately control their meta tags. - -* Select or Other - https://drupal.org/project/select_or_other - Enhances the user experience of the metatag_google_plus and metatag_opengraph - submodules by allowing the creation of custom itemtype and og:types values. - -* Node Form Panes - https://drupal.org/project/node_form_panes - Create custom node-edit forms and control the location of the Metatag fields. - -* Textimage - https://drupal.org/project/textimage - Supports using Textimage's custom tokens in meta tag fields. - -* Field Multiple Limit - https://drupal.org/project/field_multiple_limit - Allows control over how many items are output in a multi-item field, useful - with meta tags that only allow for one item but which are assigned from fields - which accept multiple items, e.g. og:audio and og:video. - -* 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. - -* Parse.ly Publishing Analytics - https://www.drupal.org/project/parsely - Automatically generates meta tags for the Parse.ly service. - -* Metatag Cxense - https://www.drupal.org/project/metatag_cxense - Adds support for the Cxense meta tags used by their DMP and Insight services. - - -Credits / contact --------------------------------------------------------------------------------- -Currently maintained by Damien McKenna [1] and Dave Reid [2]; all initial -development was by Dave Reid. - -Ongoing development is sponsored by Mediacurrent [3] and Lullabot [4]. All -initial development was sponsored by Acquia [5] and Palantir.net [6]. - -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/u/damienmckenna -2: https://www.drupal.org/u/dave-reid -3: https://www.mediacurrent.com/ -4: https://www.lullabot.com/ -5: https://www.acquia.com/ -6: https://www.palantir.net/ diff --git a/source/webapp/sites/all/modules/contrib/metatag/arrow-down.png b/source/webapp/sites/all/modules/contrib/metatag/arrow-down.png deleted file mode 100644 index dbd52a3b50ecd2251bd426fcba48afc1a2a9d7e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2?f#ZI0f96(URkb0f8P6(X{sVKjGC6YqyFkEB83}9Q%GXuBTvj$3>3I4GTG^yQT0(m@dqAx!xc? eLC9hYGsFKGVu8~q<$3^(WAJqKb6Mw<&;$Tm_$dtl diff --git a/source/webapp/sites/all/modules/contrib/metatag/arrow-right.png b/source/webapp/sites/all/modules/contrib/metatag/arrow-right.png deleted file mode 100644 index e14dbaed5a9378006c4696f6169ece2492e2a88a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2?f#ZI0f96(URkOR2)FL(2u%tHnrhW*u5KQN#CzROhuX`)+klRPj9_)p4n1UE>0^ i9H{~(C(R}u28Nz9Vqc a { - font-weight: bold; -} - -.metatag-config-label.collapsed { - background-image: url('arrow-right.png'); - background-repeat: no-repeat; - background-position: center left; -} - -.metatag-config-label.expanded { - background-image: url('arrow-down.png'); - background-repeat: no-repeat; - background-position: center left; -} - -table.metatag-config-overview > tbody > tr > td:first-child { - width: 60%; -} - -table.metatag-config-overview > tbody > tr > td { - vertical-align: top; -} - -table.metatag-config-overview tbody div.indent { - margin-left: 20px; -} - -table.metatag-config-overview tr.disabled > td:first-child a { - color: #999; -} - -div.metatag-config-details { - color: #666; - margin-left: 20px; -} - -div.metatag-config-details p { - margin: 0.75em 0; -} - -div.metatag-config-details div.inheritance { - font-style: italic; -} - -div.metatag-config-details table.metatag-value-summary { - border: none; - width: auto; - margin: 0.75em 0; -} - -div.metatag-config-details table.metatag-value-summary td { - padding: 0 0.5em 0 0; - color: #666; -} - -div.metatag-config-details table.metatag-value-summary tr, -div.metatag-config-details table.metatag-value-summary tr td:last-child { - background-color: transparent; - border: none; -} - -div.metatag-config-details table.metatag-value-summary tr td:first-child { - font-weight: bold; - padding-right: 2em; -} - -/*div.metatag-config-details ul { - margin-left: 2em; -} - -div.metatag-config-details ul li { - line-height: 105%; -} - -div.metatag-config-details > p { - margin: 0.25em 0; -}*/ - - -/* For the advanced settings page */ -.metatag-bundle-checkbox { - margin-left: 2em; -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/metatag.admin.inc b/source/webapp/sites/all/modules/contrib/metatag/metatag.admin.inc deleted file mode 100644 index b662db4529..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/metatag.admin.inc +++ /dev/null @@ -1,858 +0,0 @@ -'); - $suffix = array_fill(0, count($parents), ''); - $text = implode('', $prefix) . $text . implode('', $suffix); - } - - return $text; -} - -function metatag_config_overview() { - ctools_include('export'); - - $metatags = metatag_get_info('tags'); - - $configs = ctools_export_crud_load_all('metatag_config'); - uksort($configs, '_metatag_config_instance_sort'); - - $rows = array(); - foreach ($configs as $config) { - $row = array(); - - // Style disabled configurations differently. - if (!empty($config->disabled)) { - $row['class'][] = 'disabled'; - } - - $details = ''; - $details .= '
'; - - $inherits = array(); - $parents = metatag_config_get_parent_instances($config->instance); - array_shift($parents); - foreach (array_reverse($parents) as $parent) { - if (!isset($configs[$parent])) { - $rows[$parent] = array( - _metatag_config_overview_indent('
' . check_plain(metatag_config_instance_label($parent)) . '
', $parent), - '', - ); - } - else { - $inherits[$parent] = metatag_config_instance_label($parent); - if (!empty($configs[$parent]->disabled)) { - $inherits[$parent] .= ' ' . t('(disabled)'); - } - } - } - - // Show how this config inherits from its parents. - if (!empty($inherits)) { - $details .= '

' . t('Inherits meta tags from: @parents', array('@parents' => implode(', ', $inherits))) . '

'; - } - - // Add a summary of the configuration's defaults. - $summary = array(); - foreach ($config->config as $metatag => $data) { - // Skip meta tags that were disabled. - if (empty($metatags[$metatag])) { - continue; - } - $summary[] = array( - check_plain($metatags[$metatag]['label']) . ':', - check_plain(metatag_get_value($metatag, $data, array('raw' => TRUE))), - ); - } - if (!empty($summary)) { - $details .= theme('table', array( - 'rows' => $summary, - 'attributes' => array('class' => array('metatag-value-summary')), - )); - } - else { - $details .= '

No overridden default meta tags

'; - $row['class'][] = 'warning'; - } - - // Close the details div. - $details .= '
'; - - // Add indentation to the leading cell based on how many parents the config has. - $details = _metatag_config_overview_indent($details, $config->instance); - - $row['data']['details'] = $details; - - $operations = array(); - if (metatag_config_access('disable', $config)) { - $operations['edit'] = array( - 'title' => ($config->export_type & EXPORT_IN_DATABASE) ? t('Edit') : t('Override'), - 'href' => 'admin/config/search/metatags/config/' . $config->instance, - ); - } - if (metatag_config_access('enable', $config)) { - $operations['enable'] = array( - 'title' => t('Enable'), - 'href' => 'admin/config/search/metatags/config/' . $config->instance . '/enable', - 'query' => array( - 'token' => drupal_get_token('enable-' . $config->instance), - ) + drupal_get_destination(), - ); - } - if (metatag_config_access('disable', $config)) { - $operations['disable'] = array( - 'title' => t('Disable'), - 'href' => 'admin/config/search/metatags/config/' . $config->instance . '/disable', - 'query' => array( - 'token' => drupal_get_token('disable-' . $config->instance), - ) + drupal_get_destination(), - ); - } - if (metatag_config_access('revert', $config)) { - $operations['revert'] = array( - 'title' => t('Revert'), - 'href' => 'admin/config/search/metatags/config/' . $config->instance . '/revert', - ); - } - if (metatag_config_access('delete', $config)) { - $operations['delete'] = array( - 'title' => t('Delete'), - 'href' => 'admin/config/search/metatags/config/' . $config->instance . '/delete', - ); - } - $operations['export'] = array( - 'title' => t('Export'), - 'href' => 'admin/config/search/metatags/config/' . $config->instance . '/export', - ); - if (module_exists('i18n_string') && !variable_get('metatag_i18n_disabled', FALSE)) { - $operations['translate'] = array( - 'title' => t('Translate'), - 'href' => 'admin/config/search/metatags/config/' . $config->instance . '/translate', - ); - } - $row['data']['operations'] = array( - 'data' => array( - '#theme' => 'links', - '#links' => $operations, - '#attributes' => array('class' => array('links', 'inline')), - ), - ); - - $rows[$config->instance] = $row; - } - - $build['config_table'] = array( - '#theme' => 'table', - '#header' => array( - 'type' => t('Type'), - 'operations' => t('Operations'), - ), - '#rows' => $rows, - '#empty' => t('No meta tag defaults available yet.'), - '#attributes' => array( - 'class' => array('metatag-config-overview'), - ), - '#attached' => array( - 'js' => array( - drupal_get_path('module', 'metatag') . '/metatag.admin.js', - ), - 'css' => array( - drupal_get_path('module', 'metatag') . '/metatag.admin.css', - ), - ), - '#suffix' => '

' . t('Any items marked "Unknown" are configurations in the system for entity types or bundles which have been disabled via the API or the Settings page; they will not be used.', array('@url' => url('admin/config/search/metatags/settings'))) . '

', - ); - - return $build; -} - -/** - * Build an FAPI #options array for the instance select field. - */ -function _metatag_config_instance_get_available_options() { - $options = array(); - $instances = metatag_config_instance_info(); - - foreach ($instances as $instance => $instance_info) { - if (metatag_config_load($instance)) { - continue; - } - $parents = metatag_config_get_parent_instances($instance, FALSE); - array_shift($parents); - if (!empty($parents)) { - $parent = reset($parents); - $parent_label = isset($instances[$parent]['label']) ? $instances[$parent]['label'] : t('Unknown'); - if (!isset($options[$parent_label])) { - $options[$parent_label] = array(); - if (!metatag_config_load($parent)) { - $options[$parent_label][$parent] = t('All'); - } - } - $options[$parent_label][$instance] = $instance_info['label']; - unset($options[$parent]); - } - else { - $options[$instance] = $instance_info['label']; - } - } - - return $options; -} - -function metatag_config_add_form($form, &$form_state) { - $form['instance'] = array( - '#type' => 'select', - '#title' => t('Type'), - '#description' => t('Select the type of default meta tags you would like to add.'), - '#options' => _metatag_config_instance_get_available_options(), - '#required' => TRUE, - ); - $form['config'] = array( - '#type' => 'value', - '#value' => array(), - ); - - $form['actions']['#type'] = 'actions'; - $form['actions']['save'] = array( - '#type' => 'submit', - '#value' => t('Add and configure'), - ); - $form['actions']['cancel'] = array( - '#type' => 'link', - '#title' => t('Cancel'), - '#href' => isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/metatags', - ); - - return $form; -} - -function metatag_config_add_form_submit($form, &$form_state) { - form_state_values_clean($form_state); - $config = (object) $form_state['values']; - metatag_config_save($config); - $form_state['redirect'] = 'admin/config/search/metatags/config/' . $config->instance; -} - -function metatag_config_edit_form($form, &$form_state, $config) { - $form['cid'] = array( - '#type' => 'value', - '#value' => !empty($config->cid) ? $config->cid : NULL, - ); - $form['instance'] = array( - '#type' => 'value', - '#value' => $config->instance, - ); - - $contexts = explode(':', $config->instance); - $options['context'] = $contexts[0]; - if ($contexts[0] != 'global') { - // The context part of the instance may not map to an entity type, so allow - // the token_get_entity_mapping() function to fallback to the provided type. - if ($token_type = token_get_entity_mapping('entity', $contexts[0], TRUE)) { - $options['token types'] = array($token_type); - } - else { - $options['token types'] = array($contexts[0]); - } - // Trigger hook_metatag_token_types_alter(). - // Allow the defined tokens to be modified. - drupal_alter('metatag_token_types', $options); - } - - // Ensure that this configuration is properly compared to its parent 'default' - // configuration values. - if (count($contexts) > 1) { - // If the config is something like 'node:article' or 'taxonomy_term:tags' - // then the parent default config is 'node' or 'taxonomy_term'. - $default_instance = $contexts; - array_pop($default_instance); - $default_instance = implode(':', $default_instance); - $options['defaults'] = metatag_config_load_with_defaults($default_instance); - } - elseif ($contexts[0] != 'global') { - // If the config is something like 'node' or 'taxonomy_term' then the - // parent default config is 'global'. - $options['defaults'] = metatag_config_load_with_defaults('global'); - } - else { - // If the config is 'global' than there are no parent defaults. - $options['defaults'] = array(); - } - - metatag_metatags_form($form, $config->instance, $config->config, $options); - $form['metatags']['#type'] = 'container'; - - $form['actions']['#type'] = 'actions'; - $form['actions']['save'] = array( - '#type' => 'submit', - '#value' => t('Save'), - ); - $form['actions']['cancel'] = array( - '#type' => 'link', - '#title' => t('Cancel'), - '#href' => isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/metatags', - ); - - $form['#submit'][] = 'metatag_config_edit_form_submit'; - return $form; -} - -function metatag_config_edit_form_submit($form, &$form_state) { - // Build the configuration object and save it. - form_state_values_clean($form_state); - $config = (object) $form_state['values']; - // @todo Consider renaming the config field from 'config' to 'metatags' - $config->config = $config->metatags[LANGUAGE_NONE]; - unset($config->metatags); - metatag_config_save($config); - - $label = metatag_config_instance_label($config->instance); - drupal_set_message(t('The meta tag defaults for @label have been saved.', array('@label' => $label))); - - $form_state['redirect'] = 'admin/config/search/metatags'; -} - -function metatag_config_enable($config) { - if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'enable-' . $config->instance)) { - return MENU_ACCESS_DENIED; - } - - ctools_export_crud_enable('metatag_config', $config); - - $label = metatag_config_instance_label($config->instance); - drupal_set_message(t('The meta tag defaults for @label have been enabled.', array('@label' => $label))); - drupal_goto(); -} - -function metatag_config_disable($config) { - if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'disable-' . $config->instance)) { - return MENU_ACCESS_DENIED; - } - - ctools_export_crud_disable('metatag_config', $config); - - $label = metatag_config_instance_label($config->instance); - drupal_set_message(t('The meta tag defaults for @label have been disabled.', array('@label' => $label))); - drupal_goto(); -} - -function metatag_config_delete_form($form, &$form_state, $config) { - $form['cid'] = array('#type' => 'value', '#value' => $config->cid); - $form['instance'] = array('#type' => 'value', '#value' => $config->instance); - - $label = metatag_config_instance_label($config->instance); - $delete = metatag_config_access('delete', $config); - $title = $delete ? t('Are you sure you want to delete the meta tag defaults for @label?', array('@label' => $label)) : t('Are you sure you want to revert the meta tag defaults for @label?', array('@label' => $label)); - - return confirm_form( - $form, - $title, - 'admin/config/search/metatags', - t('This action cannot be undone.') - ); -} - -function metatag_config_delete_form_submit($form, &$form_state) { - $config = metatag_config_load($form_state['values']['instance']); - metatag_config_delete($config); - - $label = metatag_config_instance_label($config->instance); - $delete = metatag_config_access('delete', $config); - $title = $delete ? t('The meta tag defaults for @label have been deleted.', array('@label' => $label)) : t('The meta tag defaults for @label have been reverted.', array('@label' => $label)); - drupal_set_message($title); - - $form_state['redirect'] = 'admin/config/search/metatags'; -} - -function metatag_config_export_form($config) { - ctools_include('export'); - return drupal_get_form('ctools_export_form', ctools_export_crud_export('metatag_config', $config), t('Export')); -} - -/** - * Form constructor to revert nodes to their default metatags. - * - * @see metatag_bulk_revert_form_submit() - * - * @ingroup forms - */ -function metatag_bulk_revert_form() { - // Get the list of entity:bundle options. - $options = array(); - foreach (entity_get_info() as $entity_type => $entity_info) { - foreach (array_keys($entity_info['bundles']) as $bundle) { - if (metatag_entity_supports_metatags($entity_type, $bundle)) { - $options[$entity_type . ':' . $bundle] = $entity_info['label'] . ': ' . $entity_info['bundles'][$bundle]['label']; - } - } - } - - $form['update'] = array( - '#type' => 'checkboxes', - '#required' => TRUE, - '#title' => t('Select the entities to revert'), - '#options' => $options, - '#default_value' => array(), - '#description' => t('All meta tags will be removed for all content of the selected entities.'), - ); - - $metatags = metatag_get_info(); - $options = array(); - foreach ($metatags['tags'] as $tag_name => $tag) { - $options[$tag_name] = t('@group_label: @tag_label', array( - '@group_label' => $metatags['groups'][$tag['group']]['label'], - '@tag_label' => $tag['label'], - )); - } - - if (count($options) > 0) { - $form['tags'] = array( - '#type' => 'checkboxes', - '#required' => FALSE, - '#title' => t('Select the tags to revert'), - '#description' => t('If you select any tags, only those tags will be reverted.'), - '#options' => $options, - ); - } - - $languages = language_list(); - $options = array( - LANGUAGE_NONE => t('Language neutral'), - ); - foreach ($languages as $language) { - $options[$language->language] = $language->name; - } - - $form['languages'] = array( - '#type' => 'checkboxes', - '#required' => FALSE, - '#title' => t('Select the languages to revert'), - '#description' => t('If you select any languages, only tags for those languages will be reverted.'), - '#options' => $options, - ); - - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Revert'), - ); - - return $form; -} - -/** - * Form submit handler for metatag reset bulk revert form. - * - * @see metatag_batch_revert_form() - * @see metatag_bulk_revert_batch_finished() - */ -function metatag_bulk_revert_form_submit($form, &$form_state) { - $batch = array( - 'title' => t('Bulk updating metatags'), - 'operations' => array(), - 'finished' => 'metatag_bulk_revert_batch_finished', - 'file' => drupal_get_path('module', 'metatag') . '/metatag.admin.inc', - ); - - $tags = isset($form_state['values']['tags']) ? array_filter($form_state['values']['tags']) : array(); - $languages = isset($form_state['values']['languages']) ? array_filter($form_state['values']['languages']) : array(); - - // Set a batch operation per entity:bundle. - foreach (array_filter($form_state['values']['update']) as $option) { - list($entity_type, $bundle) = explode(':', $option); - $batch['operations'][] = array('metatag_bulk_revert_batch_operation', array($entity_type, $bundle, $tags, $languages)); - } - - batch_set($batch); -} - -/** - * Batch callback: delete custom metatags for selected bundles. - */ -function metatag_bulk_revert_batch_operation($entity_type, $bundle, $tags, $languages, &$context) { - if (!isset($context['sandbox']['current'])) { - $context['sandbox']['count'] = 0; - $context['sandbox']['current'] = 0; - } - - // Query the selected entity table. - $entity_info = entity_get_info($entity_type); - $query = new EntityFieldQuery(); - $query->entityCondition('entity_type', $entity_type) - ->propertyCondition($entity_info['entity keys']['id'], $context['sandbox']['current'], '>') - ->propertyOrderBy($entity_info['entity keys']['id']); - if ($entity_type != 'user') { - /** - * Entities which do not define a bundle such as User fail returning no results. - * @see https://www.drupal.org/node/1054168#comment-5266208 - */ - $query->entityCondition('bundle', $bundle); - } - // Get the total amount of entities to process. - if (!isset($context['sandbox']['total'])) { - $context['sandbox']['total'] = $query->count()->execute(); - $query->count = FALSE; - - // If there are no bundles to revert, stop immediately. - if (!$context['sandbox']['total']) { - $context['finished'] = 1; - return; - } - } - - // Process 25 entities per iteration. - $query->range(0, 25); - $result = $query->execute(); - $entity_ids = !empty($result[$entity_type]) ? array_keys($result[$entity_type]) : array(); - foreach ($entity_ids as $entity_id) { - $metatags = metatag_metatags_load($entity_type, $entity_id); - if (!empty($metatags)) { - $reset = FALSE; - if (empty($tags)) { - // All tags should be reset, so we just delete any records from the db. - $query = db_delete('metatag') - ->condition('entity_type', $entity_type) - ->condition('entity_id', $entity_id); - if (!empty($languages)) { - $query->condition('language', $languages, 'IN'); - } - $query->execute(); - metatag_metatags_cache_clear($entity_type, $entity_id); - $reset = TRUE; - } - else { - // Iterate over tags and unset those, that we want to reset. - $needs_reset = FALSE; - foreach ($metatags as $metatags_language => $metatags_tags) { - if (empty($languages) || in_array($metatags_language, $languages)) { - foreach ($metatags_tags as $metatags_tag => $metatags_value) { - if (in_array($metatags_tag, $tags)) { - unset($metatags[$metatags_language][$metatags_tag]); - $needs_reset = TRUE; - } - } - } - } - // Save modified metatags. - if ($needs_reset) { - // We don't have a revision id, so we'll get the active one. - // Unfortunately, the only way of getting the active revision ID is to - // first load the entity, and then extract the ID. This is a bit - // performance intensive, but it seems to be the only way of doing it. - $entities = entity_load($entity_type, array($entity_id)); - if (!empty($entities[$entity_id])) { - // We only care about the revision_id. - list(, $revision_id,) = entity_extract_ids($entity_type, $entities[$entity_id]); - } - metatag_metatags_save($entity_type, $entity_id, $revision_id, $metatags, $bundle); - $reset = TRUE; - } - } - if ($reset) { - $context['results'][] = t('Reverted metatags for @bundle with id @id.', array( - '@bundle' => $entity_type . ': ' . $bundle, - '@id' => $entity_id, - )); - } - } - } - - $context['sandbox']['count'] += count($entity_ids); - $context['sandbox']['current'] = max($entity_ids); - - if ($context['sandbox']['count'] != $context['sandbox']['total']) { - $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total']; - } -} - -/** - * Batch finished callback. - */ -function metatag_bulk_revert_batch_finished($success, $results, $operations) { - if ($success) { - if (!count($results)) { - drupal_set_message(t('No metatags were reverted.')); - } - else { - $message = theme('item_list', array('items' => $results)); - drupal_set_message($message); - } - } - else { - $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)))); - } -} - -/** - * Misc settings page. - */ -function metatag_admin_settings_form() { - $form = array(); - - $form['#attached'] = array( - 'js' => array( - drupal_get_path('module', 'metatag') . '/metatag.admin.js', - ), - 'css' => array( - drupal_get_path('module', 'metatag') . '/metatag.admin.css', - ), - ); - - $form['entities'] = array( - '#type' => 'fieldset', - '#title' => t('Master controls for all entities'), - '#description' => t('By enabling and disabling items here, it is possible to control which entities (e.g. nodes, taxonomy terms) and bundles (e.g. content types, vocabularies) will have the meta tag form available on their respective edit pages. If an entity type is disabled it also disables it for all of that entity type\'s bundles.
Technical note: Entity types must not be configuration entities and must have view modes in order to be compatible.'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - ); - - foreach (entity_get_info() as $entity_type => $entity_info) { - // Only show entities that are capable of using meta tags. - if (metatag_entity_type_is_suitable($entity_type, $entity_info)) { - $entity_enabled = metatag_entity_supports_metatags($entity_type); - $form['entities']['metatag_enable_' . $entity_type] = array( - '#type' => 'checkbox', - '#title' => t($entity_info['label']), - '#default_value' => $entity_enabled, - // '#description' => t('Enable meta tags for all pages of this entity type.'), - ); - - // Some entities, e.g. User, (core) File, have a single bundle with the - // same name as the entity, so only show the bundles list if there is - // more than one of them and the bundle's name isn't the same as the - // entity type's. - if (!empty($entity_info['bundles'])) { - foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) { - if (count($entity_info['bundles']) > 1 || $entity_type != $bundle_name) { - // If the entity type was disabled, automatically enable the bundle. - // This will have the effect that if the entity type is enabled in - // the form then all of the bundles will then also be enabled. This - // is safe to do because in the rest of the module the bundle will - // be ignored if the entity is disabled. - $form['entities']['metatag_enable_' . $entity_type . '__' . $bundle_name] = array( - '#type' => 'checkbox', - '#title' => t($bundle_info['label']), - '#default_value' => !$entity_enabled || metatag_entity_supports_metatags($entity_type, $bundle_name), - '#attributes' => array( - // Add some theming that'll indent this bundle. - 'class' => array('metatag-bundle-checkbox'), - ), - '#states' => array( - 'visible' => array( - ':input[name="metatag_enable_' . $entity_type . '"]' => array('checked' => TRUE), - ), - ), - ); - } - } - } - } - } - - $form['additional'] = array( - '#type' => 'fieldset', - '#title' => t('Additional settings'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - ); - - $form['additional']['metatag_pager_string'] = array( - '#title' => t('Custom pager string'), - '#type' => 'textfield', - '#description' => t('When the current page includes a pager, e.g. the URL contains "?page=42", the [current-page:pager] token may be added to a meta tag to differentiate between two pages that would otherwise have the same meta tags. The value "PAGER" (must be in uppercase) will be replaced by the actual page count. Note: the pager will only output if the page number is 2 or above and the string "page=NUMBER" is in the URL.
For best use, it may be worthwhile to add the [current-page:pager] to the page title to the left of the site name, to the start of description tags, etc.'), - '#default_value' => variable_get('metatag_pager_string', 'Page PAGER | '), - ); - - $form['additional']['metatag_summary_text_field'] = array( - '#title' => t('Add summary tokens for regular text fields'), - '#type' => 'checkbox', - '#description' => t("By default Metatag's summary tokens are added to long text fields. Enabling this option will also add summary tokens for all plain text fields."), - '#default_value' => variable_get('metatag_summary_text_field', FALSE), - ); - $form['additional']['metatag_summary_length'] = array( - '#title' => t('Length of summary'), - '#type' => 'textfield', - '#description' => t("How long each of the summary tokens will be after it is truncated."), - '#default_value' => variable_get('metatag_summary_length', 200), - ); - - $form['i18n'] = array( - '#type' => 'fieldset', - '#title' => t('Internationalization options'), - '#description' => t('Additional options are available when using the Internationalization module.', array('@url' => 'https://www.drupal.org/project/i18n')), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - ); - - $form['i18n']['metatag_i18n_disabled'] = array( - '#title' => t('Disable i18n integration'), - '#type' => 'checkbox', - '#description' => t('If the i18n_string module is enabled but the site does not need to translate Metatag strings, the integration may be disabled to avoid a large volume of records being added to the translation system.'), - '#default_value' => variable_get('metatag_i18n_disabled', FALSE), - '#disabled' => !module_exists('i18n_string'), - ); - - $form['i18n']['metatag_i18n_translate_output'] = array( - '#title' => t('Translate output'), - '#type' => 'checkbox', - '#description' => t('Optionally translate the final page output.'), - '#default_value' => variable_get('metatag_i18n_translate_output', FALSE), - '#disabled' => !module_exists('i18n_string'), - ); - - $form['i18n']['metatag_i18n_enable_watchdog'] = array( - '#title' => t('Enable logging of translations to Watchdog'), - '#type' => 'checkbox', - '#description' => t('Optionally log to Watchdog any changes that happen.'), - '#default_value' => variable_get('metatag_i18n_enable_watchdog', FALSE), - '#disabled' => !module_exists('i18n_string'), - ); - - $form['advanced'] = array( - '#type' => 'fieldset', - '#title' => t('Advanced settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - - $form['advanced']['metatag_load_all_pages'] = array( - '#type' => 'checkbox', - '#title' => t('Output meta tags even if only global settings apply'), - '#description' => t('By default Metatag will load the global default values for all pages that do not have meta tags assigned via the normal entity display or via Metatag Context. This may be disabled so that meta tags will only be output on pages that specifically have meta tags configured for them.'), - '#default_value' => variable_get('metatag_load_all_pages', TRUE), - ); - - $form['advanced']['metatag_tag_admin_pages'] = array( - '#type' => 'checkbox', - '#title' => t('Output meta tags on admin pages'), - '#description' => t('By default meta tags will not be output on admin pages, but it may be beneficial for some sites to do so.'), - '#default_value' => variable_get('metatag_tag_admin_pages', FALSE), - ); - - $form['advanced']['metatag_extended_permissions'] = array( - '#type' => 'checkbox', - '#title' => t('Advanced permissions'), - '#description' => t('Optionally add a permission for each individual meta tag. This provides tremendous flexibility for the editorial process, at the expense of making the permissions configuration more tedious.'), - '#default_value' => variable_get('metatag_extended_permissions', FALSE), - ); - - $form['advanced']['metatag_entity_no_lang_default'] = array( - '#type' => 'checkbox', - '#title' => t("Don't load entity's default language values if no languages match"), - '#description' => t("On a site with multiple languages it is possible for an entity to not have meta tag values assigned for the language of the current page. By default the meta tags for an entity's default language value will be used in this scenario, with the canonical URL pointing to the URL. This option may be disabled, i.e. to only load meta tags for languages that specifically have them assigned, otherwise using defaults."), - '#default_value' => variable_get('metatag_entity_no_lang_default', FALSE), - ); - - $form['advanced']['metatag_load_defaults'] = array( - '#type' => 'checkbox', - '#title' => t("Load the module's default configurations"), - '#description' => t("Control whether the module's default configuration is used. This will not affect configurations exported via Features."), - '#default_value' => variable_get('metatag_load_defaults', TRUE), - ); - - $form['advanced']['metatag_cache_output'] = array( - '#type' => 'checkbox', - '#title' => t('Cache meta tag output'), - '#description' => t('Enabling this will cause all meta tag output to be cached for each page, which may aid with site performance in some circumstances. Should not be used if there are paths which include user-specific meta tags for the current user, they may lead to information about the user being accidentally leaked; this problem does not affect the "user/[uid]" pages. It may also cause the {cache_metatag} cache table to grow to be extremely large in certain circumstances.'), - '#default_value' => variable_get('metatag_cache_output', FALSE), - ); - - $form['advanced']['metatag_leave_core_tags'] = array( - '#type' => 'checkbox', - '#title' => t("Leave core's meta tags as-is"), - '#description' => t("Drupal core outputs a number of meta tags itself: canonical, shortlink, and generator. Metatag can be used to replace these with custom values. Should Metatag not have values for these meta tags, core's tags will normally be removed. Enabling this option will leave those meta tags on the page, even if Metatag is not replacing them."), - '#default_value' => variable_get('metatag_leave_core_tags', FALSE), - ); - - $form['advanced']['metatag_page_region'] = array( - '#type' => 'select', - '#title' => t("Page region to use"), - '#description' => t("By default Metatag uses the 'Content' region to trigger output of the meta tags. Some themes do not have this region, so it can be necessary to pick another."), - '#options' => system_region_list(variable_get('theme_default', 'bartik')), - '#default_value' => variable_get('metatag_page_region', 'content'), - ); - - $form['advanced']['metatag_token_sanitize'] = array( - '#type' => 'checkbox', - '#title' => t('Sanitize content during token replacement'), - '#description' => t('If checked, will ensure that metatag value output is encoded and text filters are processed.'), - '#default_value' => variable_get('metatag_token_sanitize', FALSE), - ); - - $form['lengths'] = array( - '#type' => 'fieldset', - '#title' => t('Maximum meta tag lengths'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#description' => t('Many meta tags may be shortened to a certain length. To reset to the default, leave the field blank. To keep the entire meta tag, regardless of length, set the value to zero (0). Note: the meta tag will be shortened after the tokens have been replaced, not before.'), - ); - $info = metatag_get_info(); - $groups = $info['groups']; - $tags = $info['tags']; - foreach ($tags as $tag => $info) { - if (isset($info['maxlength'])) { - $default = $info['maxlength']; - $var_name = 'metatag_maxlength_' . $tag; - $title = $info['label']; - if (!empty($info['group']) && isset($groups[$info['group']])) { - $title = $groups[$info['group']]['label'] . ': ' . $title; - } - $form['lengths'][$var_name] = array( - '#type' => 'textfield', - '#title' => $title, - '#default_value' => intval(variable_get($var_name, $default)), - ); - } - } - - // Extra submission logic. - $form['#submit'][] = 'metatag_admin_settings_form_submit'; - - return system_settings_form($form); -} - -/** - * Form API submission callback for metatag_admin_settings_form(). - */ -function metatag_admin_settings_form_submit($form, &$form_state) { - // Only keep maxlength values that are numeric. Any empty, non-zero values - // will be removed. - foreach ($form_state['values'] as $name => $value) { - if (strpos($name, 'metatag_maxlength_') !== FALSE) { - if ((empty($value) && $value !== 0 && $value !== '0') || !is_numeric($value)) { - unset($form_state['values'][$name]); - variable_del($name); - } - else { - $form_state['values'][$name] = intval($value); - } - } - } - - // If the token option was disabled, clear the token cache too. - $old_var = (bool) variable_get('metatag_summary_text_field', FALSE); - $new_var = !empty($form_state['values']['metatag_summary_text_field']); - if ($old_var != $new_var) { - token_clear_cache(); - } - - // Make sure the metatag_summary_length value is a number. - if (!empty($form_state['values']['metatag_summary_length'])) { - $form_state['values']['metatag_summary_length'] = intval($form_state['values']['metatag_summary_length']); - } - - // Clear the Metatag caches so any settings changes will be available. - cache_clear_all('*', 'cache_metatag', TRUE); - drupal_set_message(t('The Metatag cache has been cleared so all meta tags can be reloaded.')); -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/metatag.admin.js b/source/webapp/sites/all/modules/contrib/metatag/metatag.admin.js deleted file mode 100644 index b157e6ed79..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/metatag.admin.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file - * Custom admin-side JS for the Metatag module. - */ - -(function ($) { - 'use strict'; - - Drupal.behaviors.metatagUIConfigListing = { - attach: function (context) { - // Hidden elements to be visible if JavaScript is enabled. - $('.js-show').show(); - - // Make the leaf arrow clickable. - $('.metatag-config-label').hover(function(){ - $(this).css({'cursor': 'pointer'}); - }) - .click(function(){ - $(this).find('a.toggle-details', context).trigger('click'); - }); - - // Show or hide the summary. - $('table.metatag-config-overview a.toggle-details', context).click(function(event) { - $(this).parent('div').siblings('div.metatag-config-details').each(function() { - if ($(this).hasClass('js-hide')) { - $(this).slideDown('slow').removeClass('js-hide'); - } - else { - $(this).slideUp('slow').addClass('js-hide'); - } - }); - - // Change the expanded or collapsed state of the instance label. - if ($(this).parent('div').hasClass('collapsed')) { - $(this).parent('div').removeClass('collapsed').addClass('expanded'); - } - else { - $(this).parent('div').removeClass('expanded').addClass('collapsed'); - } - - // This event may be triggered by a parent element click - so we don't - // want the click to bubble up otherwise we get recursive click events. - event.stopPropagation(); - }); - } - }; - -})(jQuery); diff --git a/source/webapp/sites/all/modules/contrib/metatag/metatag.api.php b/source/webapp/sites/all/modules/contrib/metatag/metatag.api.php deleted file mode 100644 index 242ef71401..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/metatag.api.php +++ /dev/null @@ -1,482 +0,0 @@ -disabled boolean attribute indicates whether the Metatag - * instance should be enabled (FALSE) or disabled (TRUE) by default. - * - * @return array - * An associative array containing the structures of Metatag instances, as - * generated from the Export tab, keyed by the Metatag config name. - * - * @see metatag_metatag_config_default() - * @see metatag_ctools_plugin_api() - */ -function hook_metatag_config_default() { - $configs = array(); - - $config = new stdClass(); - $config->instance = 'config1'; - $config->api_version = 1; - $config->disabled = FALSE; - $config->config = array( - 'title' => array('value' => '[current-page:title] | [site:name]'), - 'generator' => array('value' => 'Drupal 7 (https://www.drupal.org)'), - 'canonical' => array('value' => '[current-page:url:absolute]'), - 'shortlink' => array('value' => '[current-page:url:unaliased]'), - ); - $configs[$config->instance] = $config; - - $config = new stdClass(); - $config->instance = 'config2'; - $config->api_version = 1; - $config->disabled = FALSE; - $config->config = array( - 'title' => array('value' => '[user:name] | [site:name]'), - ); - $configs[$config->instance] = $config; - - return $configs; -} - -/** - * Allow the exported configurations to be changed prior to being cached. - */ -function hook_metatag_config_default_alter(&$config) { -} - -/** - * Internal hook for adding further configuration values in bundled submodules. - * - * The defaults provided by the main Metatag module need to be extended by the - * bundled submodules before they are presented to other modules for altering - * via hook_metatag_config_default_alter(), in case differences in module - * weights and loading priorities cause the submodules' settings to run after - * those of any custom modules. - * - * @see hook_metatag_config_default() - * @see hook_metatag_config_default_alter() - */ -function hook_metatag_bundled_config_alter(&$config) { -} - -/** - * Allow modules to act upon the record insertion. - */ -function hook_metatag_config_instance_info() { - return array(); -} - -/** - * Alter record insertion provided by modules with the previous hook. - * - * @see hook_metatag_config_instance_info() - */ -function hook_metatag_config_instance_info_alter(&$info) { -} - -/** - * Allow the Metatag config instance name to be changed. - * - * By default, Metatag module define config instance per entity bundle, making - * it impossible to store set of meta tags based on other criteria. Combining - * this hook with hook_metatag_config_instance_info_alter() it is possible to - * alter the logic of how instances are named based on any custom criteria. - * - * @param string $instance - * The name of the instance generated by default. - * @param object $entity - * The entity object to generate the Metatag instance name for. - * @param string $entity_type - * The entity type of the entity. - * @param string $bundle - * The bundle of the entity. - */ -function hook_metatag_get_entity_metatags_instance_alter(&$instance, $entity, $entity_type, $bundle) { - if ($entity_type == 'user') { - // Split config instances based on user roles. - foreach (array_reverse(user_roles(), TRUE) as $rid => $role) { - if ($rid == DRUPAL_AUTHENTICATED_RID) { - continue; - } - - if (isset($entity->roles[$rid])) { - $instance = 'user:' . $role; - break; - } - } - } -} - -/** - * Never triggered? - * - * @todo Confirm whether this still exists. - */ -function hook_metatag_config_load() { -} - -/** - * Never triggered? - * - * @todo Confirm whether this still exists. - */ -function hook_metatag_config_load_presave() { -} - -/** - * Allow a Metatag configuration to be modified prior to being saved. - * - * @param object $config - * The configuration object that is about to be saved. - */ -function hook_metatag_config_presave($config) { -} - -/** - * Triggered when a Metatag configuration is created. - * - * @param object $config - * The configuration object that was created. - */ -function hook_metatag_config_insert($config) { -} - -/** - * Triggered when a Metatag configuration is updated. - * - * @param object $config - * The configuration object that was modified. - */ -function hook_metatag_config_update($config) { -} - -/** - * Triggered when a Metatag configuration is removed. - * - * @param object $config - * The name of the configuration object that was removed. - */ -function hook_metatag_config_delete($config) { -} - -/** - * Definition of the meta tags and groups. - * - * @return array - * A nested array of 'tags' and 'groups', each keyed off the machine name for - * their respective structure type, with the following values: - * Tags: - * 'label' - The name for this meta tag. - * 'description' - An explanation of what this meta tag is used for and what - * values are permissible. - * 'class' - The class name that controls this meta tag. - * 'weight' - Used to sort the meta tags during output. - * 'group' - The machine name of a group this meta tag will be contained - * within. - * 'context' - Optionally control the type of configuration the meta tag - * will be available from. Possible values are: - * [empty] - All meta tags apply to all possible objects, by default. - * 'global' - This will make it only show in the global meta tag - * configuration form. - * [entity type] - Makes the meta tag only show for specific entity types. - * 'header' - Optionally output the meta tag as an HTTP header value. - * 'element' - Optional attributes for rendering the meta tag. Should - * contain the following: - * '#theme' - The theming function used to render the meta tag. - * 'replaces' - An optional array of meta tags that this meta tag replaces. - * Used to indicate that these deprecated meta tags will be replaced by - * this newer one, their values will be used, upon the next object save - * the deprecated tag will be entirely replaced by the new meta tag. While - * one meta tag can replace several others, only one of the possible - * values will be used, the others will be silently purged upon the next - * configuration/object save. - * 'multiple' - If set to TRUE the output will be comma-separated and output - * as multiple tags. - * 'image' - If set to TRUE some additional effort will be added to attempt - * extracting image URLs from the value. Currently limited to matching - * the default output of core image theming, i.e. the following string: - * src="[URL]" width= - * 'url' - If set to TRUE, relative paths will be converted to absolute. - * 'is_language' - If set to TRUE, will not allow the Drupal default - * language value "und" to be output. - * 'maxlength' - If set to a numeric value, meta tag values will be trimmed - * to this limit, which may be overridden via the settings page. Note: any - * meta tags with this value assigned can have its maxlength controlled, - * so setting the attribute to an empty string will allow site builders to - * adjust the meta tag lengths as needed. - * 'select_or_other' - If set to TRUE, form[#type] is set to 'select' and - * the "select_or_other" module is available, that module will be used to - * provide a text field to manually insert another option. - * 'form' - Optional items to be passed directly to the form; uses standard - * Form API values. - * 'devel_generate' - Optional values to be passed to the Devel Generate - * submodule. Should be an array containing one of the following values: - * 'type' - One of the following: - * 'canonical' - The token for the absolute URL for the current page. - * 'email' - An email address randomly generated at the site's hostname. - * 'float' - A random floating point number between 0.0 and 999.999. - * 'image' - A randomly generated image. - * 'integer' - A random integer between 0 and 999. - * 'phone' - A phone number in the format 999-999-9999. - * 'select' - A value randomly selected from the available form options. - * 'text' - Random text string. - * 'twitter' - A Twitter username. - * 'url' - A randomly generated URL on this site. - * 'maxlength' - The maximum length / number of iterations of this value, - * defaults to 10. - * 'dependencies' - Optional nested array of values to indicate other meta - * tags that must be present in order for this meta tag to be visible. See - * The Open Graph and Twitter Cards submodules for example usage. Each - * dependency must contain the following elements: - * 'dependency' - The name of the meta tag that is required. - * 'attribute' - The name of the other meta tag that is to be checked, - * most meta tags use "value" as the attribute name. - * 'condition' - The state condition to be checked against, e.g. "filled" - * to check text values, "checked" for a checkbox, "value" to compare - * the raw selection; see https://api.drupal.org/drupal_process_states - * for more details. - * 'value' - The field value to check the 'condition' against. see - * https://api.drupal.org/drupal_process_states for further details. - * Groups: - * 'label' - The name for this group. - * 'description' - A detailed explanation of these meta tags. - * 'form' - Additional items to be passed directly to the form. - * Note: 'label', 'description', and any text strings passed in 'form', should - * be translated. - * - * @see metatag_metatag_info() - */ -function hook_metatag_info() { - return array(); -} - -/** - * Alter record insertion provided by modules with the previous hook. - * - * @see hook_metatag_info() - */ -function hook_metatag_info_alter(&$info) { -} - -/** - * Alter raw metatags before being cached. - * - * This hook is invoked prior to the meta tags for a given page are converted to - * a render array and cached. - * - * @param array $metatags - * All of the meta tags to be output for this page in their raw format, keyed - * by tag name. Each tag is an array with a "value" field to hold the - * respective value or values. - * @param string $instance - * An identifier for the current page's page type, typically a combination - * of the entity name and bundle name, e.g. "node:story". - * @param array $options - * All of the options used to generate the meta tags. - */ -function hook_metatag_metatags_alter(array &$metatags, array $instance, array $options) { - if (isset($metatags['description']['value'])) { - $metatags['description']['value'] = '0 rly?'; - } -} - -/** - * Alter metatags before being cached. - * - * This hook is invoked prior to the meta tags for a given page are cached. - * - * @param array $output - * All of the meta tags to be output for this page in their render format. - * This is a heavily nested array. - * @param string $instance - * An identifier for the current page's page type, typically a combination - * of the entity name and bundle name, e.g. "node:story". - * @param array $options - * All of the options used to generate the meta tags. - */ -function hook_metatag_metatags_view_alter(&$output, $instance, $options) { - if (isset($output['description']['#attached']['drupal_add_html_head'][0][0]['#value'])) { - $output['description']['#attached']['drupal_add_html_head'][0][0]['#value'] = 'O rly?'; - } -} - -/** - * Allow other modules to customize the data to generate the cache ID. - */ -function hook_metatag_page_cache_cid_parts_alter(&$cid_parts) { -} - -/** - * Allow other modules to alter the meta tags prior to saving. - */ -function hook_metatag_presave(&$metatags, $entity_type, $entity_id, $revision_id, $langcode) { -} - -/** - * Allows modules to alter the defined list of tokens available - * for metatag patterns replacements. - * - * By default only context (for example: global, node, etc...) - * related tokens are made available to metatag patterns replacements. - * This hook allows other modules to extend the default declared tokens. - * - * @param array $options - * (optional) An array of options including the following keys and values: - * - token types: An array of token types to be passed to theme_token_tree(). - * - context: An identifier for the configuration instance type, typically - * an entity name or object name, e.g. node, views, taxonomy_term. - * - * @see metatag_config_edit_form() - * @see metatag_field_attach_form() - */ -function hook_metatag_token_types_alter(&$options) { - // Watchout: $options['token types'] might be empty. - if (!isset($options['token types'])) { - $options['token types'] = array(); - } - - if ($options['context'] == 'config1') { - $options['token types'] += array('token_type1', 'token_type2'); - } - elseif ($options['context'] == 'config2') { - $options['token types'] += array('token_type3', 'token_type4'); - } -} - -/** - * Allows modules to alter defined token patterns and values before replacement. - * - * The metatag module defines default token patterns replacements depending on - * the different configuration instances (contexts, such as global, node, ...). - * This hook provides an opportunity for other modules to alter the patterns or - * the values for replacements, before tokens are replaced (token_replace). - * - * See facetapi and facetapi_bonus modules for an example of implementation. - * - * @param string $pattern - * A string potentially containing replaceable tokens. The pattern could also - * be altered by reference, allowing modules to implement further logic, such - * as tokens lists or masks/filters. - * @param array $types - * Corresponds to the 'token data' property of the $options object. - * (optional) An array of keyed objects. For simple replacement scenarios - * 'node', 'user', and others are common keys, with an accompanying node or - * user object being the value. Some token types, like 'site', do not require - * any explicit information from $data and can be replaced even if it is - * empty. - * @param string $tag_name - * The name of the meta tag being altered. - * - * @see DrupalTextMetaTag::getValue() - */ -function hook_metatag_pattern_alter(&$pattern, &$types, $tag_name) { - if (strpos($pattern, 'token_type1') !== FALSE) { - $types['token_type1'] = "data to be used in hook_tokens for replacement"; - } - if (strpos($pattern, 'token_type2') !== FALSE) { - // Load something or do some operations. - $types['token_type2'] = array("Then fill in the array with the right data"); - // $pattern could also be altered, for example, strip off [token_type3]. - $pattern = str_replace('[token_type3]', '', $pattern); - } -} - -/** - * Allow modules to override whether entity types are enabled for use. - * - * By default the system only support entities that are not configuration - * entities, have multiple view modes (excluding those created by the ical, - * diff and token modules), are fieldable, and are not one of the following: - * - field_collection_item (from the Field Collection module) - * - paragraphs_item (from the Paragraphs module) - * - * @param bool $suitable - * Whether or not the entity type is enabled for use with Metatag. - * @param string $entity_type - * The machine name of the entity type. - * @param array $entity_info - * The full specifications for this entity type, as returned by - * entity_get_info(). - */ -function hook_metatag_entity_type_is_supported_alter(&$suitable, $entity_type, $entity_info) { - // Enable Metatag support for a custom entity that might otherwise be - // ignored, e.g. it doesn't allow fields. - if ($entity_type == 'my_entity') { - $suitable = TRUE; - } -} - -/** - * Identify the entity type provided by a specific view. - * - * When a view is used to display a page it can be difficult to identify what - * entity type is being managed. Use this hook to inform Metatag what type of - * entity is being displayed. - * - * @param object $view - * The view object being displayed. - * - * @return string|NULL - * Should return a string indicating an entity type that will be paired with - * the views' first argument ($view->args[0]) to load that entity. - */ -function hook_metatag_views_post_render_get_entity($view) { - $display = $view->display[$view->current_display]; - if ($display->display_options['path'] == 'coolpage/%') { - return 'my_entity'; - } -} - -/** - * Allow the context string being passed to i18n_string to be changed before it - * is used. - * - * If the string is set to an empty value it will cause this meta tag to not - * be translated. - * - * @param string $context - * The context string being passed into i18n_string. Will usually be in the - * format "[category]:[path-identifier]", e.g. "[node:123]", "[page:contact]", - * etc. - * @param string $tag_name - * The name of the meta tag being translated. - */ -function hook_metatag_i18n_context_alter(&$context, $tag_name) { - // Don't bother translating the canonical URL. - if ($tag_name == 'canonical') { - $context = ''; - } -} - -/** - * Allow modules to overide the expiration of metatag caches. - * - * By default Metatag caches everything as CACHE_PERMANENT, this alter allows to - * change that. - * - * @param $expire - * The expire value to change. - * @param $cid - * The cid about to be cached. - * @param $data - * The data to be cached. - */ -function hook_metatag_cache_set_expire_alter(&$expire, $cid, $data) { - $expire = CACHE_TEMPORARY; -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/metatag.drush.inc b/source/webapp/sites/all/modules/contrib/metatag/metatag.drush.inc deleted file mode 100644 index 710e96ac5a..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/metatag.drush.inc +++ /dev/null @@ -1,22 +0,0 @@ - $name) { - if (is_object($name)) { - $name = $name->instance; - } - if ($config = metatag_config_load($name)) { - $export = new stdClass(); - $export->instance = $config->instance; - if (isset($config->disabled)) { - $export->disabled = $config->disabled; - } - $export->config = $config->config; - $export = features_var_export($export, ' '); - $key = features_var_export($name); - $code[] = " // Exported Metatag config instance: {$name}."; - $code[] = " \$config[{$key}] = {$export};"; - $code[] = ""; - } - } - $code[] = ' return $config;'; - $code = implode("\n", $code); - return array('metatag_export_default' => $code); -} - -/** - * Implements hook_features_revert(). - */ -function metatag_features_revert($module) { - if ($feature_conf = features_get_default('metatag', $module)) { - foreach (array_keys($feature_conf) as $config) { - if ($conf = metatag_config_load($config)) { - db_delete('metatag_config')->condition('instance', $config)->execute(); - } - unset($feature_conf[$config]['cid']); - $object = new stdClass(); - $object->cid = NULL; - $object->instance = $config; - $object->config = $feature_conf[$config]['config']; - metatag_config_save($object); - - if (!empty($feature_conf[$config]['disabled'])) { - ctools_export_crud_disable('metatag_config', $config); - } - else { - ctools_export_crud_enable('metatag_config', $config); - } - } - } -} - -/** - * Implements hook_features_export_options(). - */ -function metatag_features_export_options() { - $instances = metatag_config_instance_info(); - foreach ($instances as $key => $instance) { - $options[$key] = $key; - }; - return $options; -} - -/** - * Implements hook_features_rebuild(). - */ -function metatag_features_rebuild($module) { - metatag_features_revert($module); -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/metatag.feeds.inc b/source/webapp/sites/all/modules/contrib/metatag/metatag.feeds.inc deleted file mode 100644 index 3d29f247b4..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/metatag.feeds.inc +++ /dev/null @@ -1,73 +0,0 @@ - $tag) { - $targets['meta_' . $name] = array( - 'name' => t('Meta tag: !label', array('!label' => $tag['label'])), - 'callback' => 'metatag_feeds_set_target', - 'description' => $tag['description'], - ); - } - } -} - -/** - * Callback function to set value of a metatag tag. - */ -function metatag_feeds_set_target($source, $entity, $target, $values) { - // Don't do anything if we weren't given any data. - if (empty($values)) { - return; - } - - // The Feed API was changed so that the $values are passed as an array rather - // than a single value. For backwards compatibility, support both. - if (!is_array($values)) { - $values = array($values); - } - - // Strip the prefix that was added above. - $name = str_replace('meta_', '', $target); - - // Identify the type of entity being imported. - $entity_type = $entity->feeds_item->entity_type; - - // Check for any existing data that may not have been loaded already. - if (!isset($entity->metatags) && !empty($entity->feeds_item->entity_id) && is_numeric($entity->feeds_item->entity_id)) { - $entity->metatags = array(); - $entity_id = $entity->feeds_item->entity_id; - - // Load the existing entity. - $stored_entities = entity_load($entity_type, array($entity_id)); - if (!empty($stored_entities)) { - $stored_entity = reset($stored_entities); - if (!empty($stored_entity)) { - // Only load meta tags for the current revision. - list(, $revision_id) = entity_extract_ids($entity_type, $stored_entity); - - // This function returns all values for all revisions. - $metatags = metatag_metatags_load($entity_type, $entity_id, $revision_id); - if (!empty($metatags)) { - if (!empty($metatags[$revision_id])) { - // Just copy all meta tags for all languages. - $entity->metatags = $metatags[$revision_id]; - } - } - } - } - } - - // Assign the value. - $langcode = metatag_entity_get_language($entity_type, $entity); - $entity->metatags[$langcode][$name]['value'] = $values[0]; -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/metatag.i18n.inc b/source/webapp/sites/all/modules/contrib/metatag/metatag.i18n.inc deleted file mode 100644 index 7f884c37c0..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/metatag.i18n.inc +++ /dev/null @@ -1,147 +0,0 @@ - t('Metatag'), - 'description' => t('Configurable meta tags.'), - - // This group does not have strings with text formats. - 'format' => FALSE, - - // This group can list all strings. - // @todo What does this actually do? - 'list' => TRUE, - ); - return $groups; -} - -/** - * Implements hook_i18n_object_info(). - */ -function metatag_i18n_object_info() { - // Compile all of the tags to add to the translation stack. - $meta_tag_info = metatag_get_info(); - $groups = $meta_tag_info['groups']; - $config_properties = $output_properties = array(); - foreach ($meta_tag_info['tags'] as $tag_name => $tag_info) { - // Ignore certain field types that aren't translatable, mostly fields that - // list predetermined options in various forms. - if (!empty($tag_info['class']) && $tag_info['class'] == 'DrupalListMetaTag') { - continue; - } - elseif (!empty($tag_info['form']['#type']) && $tag_info['form']['#type'] == 'select') { - continue; - } - elseif (!empty($tag_info['form']['#options'])) { - continue; - } - - // Build a suitable structure for this meta tag. - if (!empty($tag_info['group']) && !empty($groups[$tag_info['group']]['label'])) { - $group_label = $groups[$tag_info['group']]['label'] . ': '; - } - elseif (!empty($tag_info['group'])) { - $group_label = $tag_info['group'] . ': '; - } - else { - $group_label = ''; - } - - // Configuration items. - $config_properties[$tag_name] = array( - 'title' => $group_label . $tag_info['label'], - 'field' => "config.{$tag_name}.value", - ); - - // Output items. - $output_properties[$tag_name] = array( - 'title' => $group_label . ': ' . $tag_info['label'], - 'field' => "data.{$tag_name}.value", - ); - } - - // The main Metatag configuration items. - $info['metatag_config'] = array( - 'title' => t('Metatag configuration'), - // Callback to load all config objects. - 'list callback' => 'metatag_i18n_list_metatag_config', - // The object load callback. - 'load callback' => 'metatag_config_load', - // @todo Custom i18n object overrides. - // 'class' => 'metatag_i18n_metatag', - // @todo Is this needed? What does it do? - // 'translation set' => TRUE, - // The object key field. - 'key' => 'instance', - // Placeholders for automatic paths. This connects the 'key' to strings in - // the paths listed below. - 'placeholders' => array( - '%instance' => 'instance', - ), - // To produce edit links automatically. - 'edit path' => 'admin/config/search/metatags/config/%instance', - // Auto-generate a 'translate' tab. - 'translate tab' => 'admin/config/search/metatags/config/%instance/translate', - - // Properties for string translation. - 'string translation' => array( - // The textgroup, type and (below) name will be concatenated into a single - // string as the {locales_source} context. - 'textgroup' => 'metatag', - 'type' => 'metatag_config', - // Table where the object is stored, to automate string lists. - 'table' => 'metatag_config', - // Translatable properties of these objects. - 'properties' => $config_properties, - // The path to translate individual strings. - 'translate path' => 'admin/config/search/metatags/config/%instance/translate/%i18n_language', - ), - ); - - // The final meta tags being output on the page. - if (variable_get('metatag_i18n_translate_output', FALSE)) { - $info['output'] = array( - 'title' => t('Metatag final tag output'), - - // Properties for string translation. - 'string translation' => array( - // The textgroup, type and (below) name will be concatenated into a - // single string as the {locales_source} context. - 'textgroup' => 'metatag', - 'type' => 'output', - // Translatable properties of these objects. - 'properties' => $output_properties, - ), - ); - } - - return $info; -} - -/** - * List callback for {metatag_config} strings. - */ -function metatag_i18n_list_metatag_config() { - ctools_include('export'); - $configs = ctools_export_crud_load_all('metatag_config'); - - if (!empty($configs)) { - // Unserialize the config array. - foreach ($configs as &$config) { - if (is_string($config->config)) { - $config->config = unserialize($config->config); - } - } - } - - return $configs; -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/metatag.inc b/source/webapp/sites/all/modules/contrib/metatag/metatag.inc deleted file mode 100644 index 22c2571b52..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/metatag.inc +++ /dev/null @@ -1,777 +0,0 @@ - ''); - - /** - * This item's weight; used for sorting the output. - * - * @var float - */ - protected $weight = 0; - - /** - * Constructor. - */ - function __construct(array $info, array $data = NULL) { - $this->info = $info; - if (isset($data)) { - $this->data = $data; - } - } - - /** - * Calculate the weight of this meta tag. - * - * @return int - * Weight. - */ - function getWeight() { - static $counter = 0; - - // If no weight value is found, stack this meta tag at the end. - $weight = 100; - if (!empty($this->info['weight'])) { - $weight = $this->info['weight']; - } - - return $weight + ($counter++ * 0.1); - } - - /** - * Build the form for this meta tag. - * - * @return array - * A standard FormAPI array. - */ - public function getForm(array $options = array()) { - return array(); - } - - /** - * Get the string value of this meta tag. - * - * @return string - * The value of this meta tag. - */ - public function getValue(array $options = array()) { - $value = $this->tidyValue($this->data['value']); - - // Translate the final output string prior to output. Use the - // 'output' i18n_string object type, and pass along the meta tag's - // options as the context so it can be handled appropriately. - $value = metatag_translate_metatag($value, $this->info['name'], $options, NULL, TRUE); - - return $this->truncate($this->tidyValue($this->data['value'])); - } - - /** - * Get the HTML tag for this meta tag. - * - * @return array - * A render array for this meta tag. - */ - public function getElement(array $options = array()) { - $value = $this->getValue($options); - if (strlen($value) === 0) { - return array(); - } - - // The stack of elements that will be output. - $elements = array(); - - // Dynamically add each option to this setting. - $base_element = isset($this->info['element']) ? $this->info['element'] : array(); - - // Single item. - if (empty($this->info['multiple'])) { - $values = array($value); - } - - // Multiple items. - else { - $values = array_filter(explode(',', $value)); - } - - // Loop over each item. - if (!empty($values)) { - foreach ($values as $ctr => $value) { - $value = trim($value); - - // Some meta tags must be output as secure URLs. - if (!empty($this->info['secure'])) { - $value = str_replace('http://', 'https://', $value); - } - - // Combine the base configuration for this meta tag with the value. - $element = $base_element + array( - '#theme' => 'metatag', - '#tag' => 'meta', - '#id' => 'metatag_' . $this->info['name'] . '_' . $ctr, - '#name' => $this->info['name'], - '#value' => $value, - '#weight' => $this->getWeight(), - ); - - // Add header information if desired. - if (!empty($this->info['header'])) { - $element['#attached']['drupal_add_http_header'][] = array($this->info['header'], $value); - } - - $elements[] = array($element, $element['#id']); - } - } - - if (!empty($elements)) { - return array( - '#attached' => array('drupal_add_html_head' => $elements), - ); - } - } - - /** - * Remove unwanted formatting from a meta tag. - * - * @param string $value - * The meta tag value to be tidied up. - * - * @return string - * The meta tag value after it has been tidied up. - */ - public function tidyValue($value) { - // This shouldn't happen, but protect against tokens returning arrays. - if (!is_string($value)) { - return ''; - } - - // Check for Media strings from the WYSIWYG submodule. - if (module_exists('media_wysiwyg') && strpos($value, '[[{') !== FALSE) { - // In https://www.drupal.org/node/2129273 media_wysiwyg_filter() was - // changed to require several additional arguments. - $langcode = language_default('language'); - $value = media_wysiwyg_filter($value, NULL, NULL, $langcode, NULL, NULL); - } - - // Specifically replace encoded spaces, because some WYSIWYG editors are - // silly. Do this before decoding the other HTML entities so that the output - // doesn't end up with a bunch of a-circumflex characters. - $value = str_replace(' ', ' ', $value); - - // Decode HTML entities. - $value = decode_entities($value); - - // First off, remove the Mango.", - 'format' => filter_default_format(), - ), - ), - ), - )); - - // Load the node page. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Verify the style does not get output. - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual($xpath[0]['content'], "Mango."); - $this->assertNotEqual($xpath[0]['content'], "body{color:red;}Mango."); - - // Create a node with a style tag that has line breaks. - $node = $this->drupalCreateNode(array( - 'title' => $this->randomName() . ' ' . $this->randomName(), - 'body' => array( - LANGUAGE_NONE => array( - array( - 'value' => "\nMango.", - 'format' => filter_default_format(), - ), - ), - ), - )); - - // Load the node page. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Verify the style does not get output. - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual($xpath[0]['content'], "Mango."); - $this->assertNotEqual($xpath[0]['content'], "body{color:red;} Mango."); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreStringHandlingWithI18nTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreStringHandlingWithI18nTest.test deleted file mode 100644 index d5347397a2..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreStringHandlingWithI18nTest.test +++ /dev/null @@ -1,32 +0,0 @@ - 'Metatag core tests for string handling w i18n', - 'description' => "Tests Metatag's string handling when i18n is enabled.", - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'i18n'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - parent::setUp(array('i18n', 'i18n_string')); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTagRemovalTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTagRemovalTest.test deleted file mode 100644 index 6d6a8ce812..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTagRemovalTest.test +++ /dev/null @@ -1,78 +0,0 @@ - 'Metatag core tag handling', - 'description' => 'Test Metatag integration with the locale module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token'), - ); - } - - /** - * Test that the core meta tags work correctly. - */ - function testCoreTagRemoval() { - // The default generator strings from core and Metatag. - $generator_core = 'Drupal 7 (http://drupal.org)'; - $generator_metatag = 'Drupal 7 (https://www.drupal.org)'; - - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200); - - // Confirm that the Generator tag is the default. - $xpath = $this->xpath("//meta[@name='generator']"); - $this->assertEqual(count($xpath), 1, 'Exactly one generator meta tag found.'); - $this->assertEqual($xpath[0]['content'], $generator_metatag); - - // Update the global config to remove the 'generator' value. - $config = metatag_config_load('global'); - unset($config->config['generator']); - metatag_config_save($config); - // Dump out the current config, to aid with debugging. - $this->verbose($config); - - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200); - - // Confirm that the Generator tag no longer exists. - $xpath = $this->xpath("//meta[@name='generator']"); - $this->assertEqual(count($xpath), 0, 'No generator meta tag found.'); - - // Tell Metatag to leave core's meta tags in place. - variable_set('metatag_leave_core_tags', TRUE); - - // Clear the Metatag caches. - metatag_flush_caches(); - - // Clear the page caches. - drupal_flush_all_caches(); - - // Load the front page again. - $this->drupalGet(''); - $this->assertResponse(200); - - // Confirm that the Generator tag is using core's default again, i.e. core - // is responsible for adding it. Also, core uses the meta tag name - // "Generator" instead of 'generator' like Metatag uses. - $xpath = $this->xpath("//meta[@name='Generator']"); - $this->assertEqual(count($xpath), 1, 'Exactly one generator meta tag found.'); - $this->assertEqual($xpath[0]['content'], $generator_core); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermTest.test deleted file mode 100644 index e9ae0054e6..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermTest.test +++ /dev/null @@ -1,169 +0,0 @@ - 'Metatag core tests for terms', - 'description' => 'Test Metatag edit functionality for terms.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - // Need the Path module to set a alias which can then be loaded. - $modules[] = 'path'; - parent::setUp($modules); - } - - /** - * Tests creation of a standard entity. - */ - public function testEntityCreationWorkflow() { - $content_type = 'metatag_test'; - $content_type_path = str_replace('_', '-', $content_type); - $content_type_label = 'Test'; - $vocab_name = 'test_vocab'; - $term_name = 'Who likes magic'; - $term_path = 'term-test'; - - // Create a content type. - $this->createContentType($content_type, $content_type_label); - - // Create a vocabulary. - $vocabulary = $this->createVocabulary($vocab_name, $content_type); - - // Create an admin user and log them in. - $perms = array( - // Needed for the content type. - 'create ' . $content_type . ' content', - 'delete any ' . $content_type . ' content', - 'edit any ' . $content_type . ' content', - - // Needed for the vocabulary. - 'administer taxonomy', - 'edit terms in ' . $vocabulary->vid, - 'delete terms in ' . $vocabulary->vid, - - // Needed for the Path module. - 'create url aliases', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Assign default values for the new vocabulary. - // Load the "add default configuration" page. - $this->drupalGet('admin/config/search/metatags/config/add'); - $this->assertResponse(200); - - // Verify the page loaded correct. - $this->assertText(t('Select the type of default meta tags you would like to add.')); - - // Submit the initial form to select an entity bundle. - $this->drupalPost(NULL, array( - 'instance' => 'taxonomy_term:' . $vocabulary->name, - ), t('Add and configure')); - $this->assertResponse(200); - - // @todo Update this to extract the H1 tag. - $this->assertText(strip_tags('Taxonomy term: ' . $vocabulary->name)); - - // Submit the form with some values. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[term:name]', - ), t('Save')); - $this->assertResponse(200); - - // Verify the page loaded correct. - $this->assertText(strip_tags(t('The meta tag defaults for @label have been saved.', array('@label' => 'Taxonomy term: ' . $vocabulary->name)))); - - // Verify that the user was redirected to the settings page again. - $this->assertEqual($this->getUrl(), url('admin/config/search/metatags', array('absolute' => TRUE))); - - // Create a test term. - // Load the term form. - $this->drupalGet('admin/structure/taxonomy/' . $vocabulary->machine_name . '/add'); - $this->assertResponse(200); - - // Verify the page loaded correctly. - // @todo Update this to extract the H1 tag. - // $this->assertText(strip_tags(t('Create @name', array('@name' => $vocabulary->name)))); - // Verify that it's possible to submit values to the form. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[term:name] ponies', - 'name' => $term_name, - 'path[alias]' => $term_path, - ), t('Save')); - $this->assertResponse(200); - - // Verify that the node saved correctly. - $t_args = array('%name' => $term_name); - // This doesn't work for some reason, it seems the HTML is stripped off - // during output so the %name's standard Drupal wrappers don't match. - // $this->assertText(t('Created new term %name.', $t_args)); - // .. so this has to be done instead. - $this->assertText(strip_tags(t('Created new term %name.', $t_args))); - - // Verify the term data saved correctly. - $this->drupalGet($term_path); - $this->assertResponse(200); - - // Try to extract the 'edit' link. - $xpaths = $this->xpath("//ul/li/a"); - $matches = array(); - $tid = 0; - if (!empty($xpaths)) { - foreach ($xpaths as $xpath) { - $attributes = $xpath->attributes(); - if (!empty($attributes['href'])) { - if (preg_match('@taxonomy/term/(\d+)/edit$@', $attributes['href'], $matches)) { - $tid = $matches[1]; - } - } - } - } - - // Presuing a term ID was found, load the term. - if (!empty($tid)) { - $term = taxonomy_term_load($tid); - - // Only the non-default values are stored. - $expected = array( - 'und' => array( - 'abstract' => array( - 'value' => '[term:name] ponies', - ), - ), - ); - $this->assertEqual($expected, $term->metatags); - } - - // This shouldn't happen, it indicates a problem. - else { - $this->fail(t('Could not determine the ID for created term.')); - } - - // Verify the title is using the custom default for this vocabulary. - $xpath = $this->xpath("//meta[@name='abstract']"); - $this->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.'); - $this->assertEqual($xpath[0]['content'], "Who likes magic ponies"); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermWithI18nTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermWithI18nTest.test deleted file mode 100644 index 46ad1ef0cc..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreTermWithI18nTest.test +++ /dev/null @@ -1,118 +0,0 @@ - 'Metatag core term tests with i18n', - 'description' => 'Test Metatag taxonomy config integration with the i18n module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'i18n'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - // Need the i18n and i18n_strings modules. - $modules[] = 'i18n'; - $modules[] = 'i18n_string'; - - // Enable all of the modules that are needed. - parent::setUp($modules); - - // Add more locales. - $this->setupLocales(); - - // Set up the locales. - $perms = array( - 'administer languages', - 'translate interface', - // From i18n. - 'translate admin strings', - 'translate user-defined strings', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Reload the translations. - drupal_flush_all_caches(); - module_load_include('admin.inc', 'i18n_string'); - i18n_string_refresh_group('metatag'); - } - - /** - * Test translations of the main taxonomy term configuration. - */ - public function testI18nTermConfig() { - // Plan out the different translation string tests. - $string_en = 'It is a term page!'; - $config_name = 'metatag_config:taxonomy_term:title'; - - // Confirm the translation page exists and has some Metatag strings. - $this->searchTranslationPage('', $config_name); - - // Confirm the string is not present yet. - $this->searchTranslationPage($string_en, $config_name, FALSE); - - // Load the meta tags. - $instance = 'taxonomy_term'; - $config = metatag_config_load($instance); - - // Set something specific as the homepage. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Confirm the string is present now. - $this->searchTranslationPage($string_en, $config_name); - - // Get the translation string lid for the term's title. - $lid = $this->getTranslationLidByContext($config_name); - $this->assertNotEqual($lid, 0, 'Found the locales_source string for the taxonomy term title tag.'); - } - - /** - * Test translations of the 'tags' vocabulary configuration. - */ - public function testI18nTermTagsConfig() { - // Plan out the different translation string tests. - $string_en = 'It is a taxonomy term Tags page!'; - $config_name = 'metatag_config:taxonomy_term:tags:title'; - - // Confirm the translation page exists and has some Metatag strings. - $this->searchTranslationPage('', $config_name); - - // Confirm the string is not present yet. - $this->searchTranslationPage($string_en, $config_name, FALSE); - - // Create a new config object for the taxonomy_term:tags structure. - $config = new StdClass(); - $config->instance = 'taxonomy_term:tags'; - - // Set an example tag. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Confirm the string is present now. - $this->searchTranslationPage($string_en, $config_name); - - // Get the translation string lid for the term's title. - $lid = $this->getTranslationLidByContext($config_name); - $this->assertNotEqual($lid, 0, 'Found the locales_source string for the taxonomy term title tag.'); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUnitTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUnitTest.test deleted file mode 100644 index d90f019ed5..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUnitTest.test +++ /dev/null @@ -1,147 +0,0 @@ - 'Metatag unit tests', - 'description' => 'Test basic meta tag functionality for entities.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token'), - ); - } - - /** - * Test the metatag_config_load_with_defaults() function. - */ - public function testConfigLoadDefaults() { - // Load the global defaults, inc the fake entity. - $defaults = metatag_config_load_with_defaults('test:foo'); - - // Load the example values and verify they're the same as the globals. - $extra_tags = array( - // Fake meta tag. - 'test:foo' => array('value' => 'foobar'), - ); - $new_values = array_merge($extra_tags, $this->getTestDefaults()); - - // Confirm that the values are equal. - $this->assertEqual($defaults, $new_values); - } - - /** - * Test the basic entity handling. - */ - public function testEntitySupport() { - $test_cases[1] = array('type' => 'node', 'bundle' => 'article', 'expected' => TRUE); - $test_cases[2] = array('type' => 'node', 'bundle' => 'page', 'expected' => TRUE); - $test_cases[3] = array('type' => 'node', 'bundle' => 'invalid-bundle', 'expected' => FALSE); - $test_cases[4] = array('type' => 'user', 'expected' => TRUE); - $test_cases[5] = array('type' => 'taxonomy_term', 'bundle' => 'tags', 'expected' => TRUE); - $test_cases[6] = array('type' => 'taxonomy_term', 'bundle' => 'invalid-bundle', 'expected' => FALSE); - foreach ($test_cases as $test_case) { - $test_case += array('bundle' => NULL); - $this->assertMetatagEntitySupportsMetatags($test_case['type'], $test_case['bundle'], $test_case['expected']); - } - - // Disable meta tags for these. - metatag_entity_type_disable('node', 'page'); - metatag_entity_type_disable('user'); - - $test_cases[2]['expected'] = FALSE; - $test_cases[4]['expected'] = FALSE; - $test_cases[6]['expected'] = FALSE; - foreach ($test_cases as $test_case) { - $test_case += array('bundle' => NULL); - $this->assertMetatagEntitySupportsMetatags($test_case['type'], $test_case['bundle'], $test_case['expected']); - } - } - - /** - * Confirm an entity supports meta tags. - * - * @param string $entity_type - * The name of the entity type to test. - * @param string $bundle - * The name of the entity bundle to test. - * @param array $expected - * The expected results. - * - * @return object - * An assertion. - */ - function assertMetatagEntitySupportsMetatags($entity_type, $bundle, $expected) { - $entity = entity_create_stub_entity($entity_type, array(0, NULL, $bundle)); - return $this->assertEqual( - metatag_entity_supports_metatags($entity_type, $bundle), - $expected, - t("metatag_entity_supports_metatags(:type, :bundle) is :expected", array( - ':type' => var_export($entity_type, TRUE), - ':bundle' => var_export($bundle, TRUE), - ':expected' => var_export($expected, TRUE), - )) - ); - } - - /** - * Test the metatag_config_instance_label() function. - */ - public function testConfigLabels() { - $test_cases = array( - 'node' => 'Node', - 'node:article' => 'Node: Article', - 'node:article:c' => 'Node: Article: Unknown (c)', - 'node:b' => 'Node: Unknown (b)', - 'node:b:c' => 'Node: Unknown (b): Unknown (c)', - 'a' => 'Unknown (a)', - 'a:b' => 'Unknown (a): Unknown (b)', - 'a:b:c' => 'Unknown (a): Unknown (b): Unknown (c)', - 'a:b:c:d' => 'Unknown (a): Unknown (b): Unknown (c): Unknown (d)', - ); - - foreach ($test_cases as $input => $expected_output) { - drupal_static_reset('metatag_config_instance_label'); - $actual_output = metatag_config_instance_label($input); - $this->assertEqual($actual_output, $expected_output); - } - } - - /** - * Test the _metatag_config_instance_sort() function. - */ - public function testConfigInstanceSort() { - $input = array( - 'node:article', - 'global:frontpage', - 'file', - 'node:page', - 'global', - 'node', - 'global:404', - ); - usort($input, '_metatag_config_instance_sort'); - $this->assertIdentical($input, array( - 'global', - 'global:404', - 'global:frontpage', - 'file', - 'node', - 'node:article', - 'node:page', - )); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUserTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUserTest.test deleted file mode 100644 index 01b1d89021..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreUserTest.test +++ /dev/null @@ -1,94 +0,0 @@ - 'Metatag core tests for users', - 'description' => 'Test Metatag edit functionality for users.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token'), - ); - } - - /** - * Tests creation of a standard entity. - */ - public function testEntityCreationWorkflow() { - // Create an admin user and log them in. - if (!isset($this->adminUser)) { - $this->adminUser = $this->createAdminUser(); - } - $this->drupalLogin($this->adminUser); - - // Assign default values for the new vocabulary. - // Load the page for overriding the User configuration. - $this->drupalGet('admin/config/search/metatags/config/user'); - $this->assertResponse(200); - - // Verify the page loaded correct. - // @todo Update this to extract the H1 tag. - $this->assertText(strip_tags('User')); - - // Submit the form with some values. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[user:name]', - ), t('Save')); - $this->assertResponse(200); - - // Verify the page loaded correct. - $this->assertText(strip_tags(t('The meta tag defaults for @label have been saved.', array('@label' => 'User')))); - - // Verify that the user was redirected to the settings page again. - $this->assertEqual($this->getUrl(), url('admin/config/search/metatags', array('absolute' => TRUE))); - - // Load the user's edit form. - $this->drupalGet('user/' . $this->adminUser->uid . '/edit'); - $this->assertResponse(200); - - // Verify the page loaded correctly. - // @todo Update this to extract the H1 tag. - // $this->assertText(strip_tags(t('Create @name', array('@name' => $vocabulary->name)))); - // Verify that it's possible to submit values to the form. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[user:name] ponies', - ), t('Save')); - $this->assertResponse(200); - - // Verify that the user object saved correctly. - // $t_args = array('%name' => $this->adminUser->name); - // This doesn't work for some reason, it seems the HTML is stripped off - // during output so the %name's standard Drupal wrappers don't match. - // $this->assertText(t('The changes have been saved.')); - // .. so this has to be done instead. - $this->assertText(strip_tags(t('The changes have been saved.'))); - - // Manually load the admin account. - $account = user_load($this->adminUser->uid); - - // Only the non-default values are stored. - $expected = array( - 'und' => array( - 'abstract' => array( - 'value' => '[user:name] ponies', - ), - ), - ); - $this->assertEqual($expected, $account->metatags); - - // Confirm the user profile tags work correctly. - $this->assertUserEntityTags($this->adminUser); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nConfigTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nConfigTest.test deleted file mode 100644 index 7b04cbdb01..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nConfigTest.test +++ /dev/null @@ -1,331 +0,0 @@ - 'Metatag core tests with i18n: configs', - 'description' => 'Test Metatag configuration integration with the i18n module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'i18n'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - // Need the i18n and i18n_strings modules. - $modules[] = 'i18n'; - $modules[] = 'i18n_string'; - - // Enable all of the modules that are needed. - parent::setUp($modules); - - // Add more locales. - $this->setupLocales(); - - // Set up the locales. - $perms = array( - 'administer languages', - 'translate interface', - // From i18n. - 'translate admin strings', - 'translate user-defined strings', - // Needed for content type management. - 'bypass node access', - 'administer content types', - 'administer nodes', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Reload the translations. - drupal_flush_all_caches(); - module_load_include('admin.inc', 'i18n_string'); - i18n_string_refresh_group('metatag'); - } - - /** - * Test translation functionality with i18n on config defaults. - */ - public function testI18nDefaultConfig() { - // Plan out the different translation string tests. - $string_en = 'Drupal 7 (https://www.drupal.org)'; - $string_fr = 'French Drupal'; - $config_name = 'metatag_config:global:generator'; - - // Confirm the translation page exists and has some Metatag strings. - $this->searchTranslationPage('', $config_name); - - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the homepage.'); - - // Confirm the page's title is what we set it to. - $xpath = $this->xpath("//meta[@name='generator']"); - $this->assertEqual(count($xpath), 1, 'Exactly one generator meta tag found.'); - $this->assertEqual($xpath[0]['content'], $string_en); - - // Confirm the string is present. - $this->searchTranslationPage($string_en, $config_name); - - // Get the translation string lid for the generator tag. - $lid = $this->getTranslationLidByContext($config_name); - $this->assertNotEqual($lid, 0, 'Found the locales_source string for the generator tag.'); - - // Save the translation string. - $this->saveTranslationString($lid, $config_name, 'fr', $string_en, $string_fr); - - // Load the English front page again. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the default homepage.'); - - // Confirm the page's generator tag is what we set it to. - $xpath = $this->xpath("//meta[@name='generator']"); - $this->assertEqual(count($xpath), 1, 'Exactly one generator meta tag found.'); - $this->assertEqual($xpath[0]['content'], $string_en); - - // Load the French front page. - $this->drupalGet('fr'); - $this->assertResponse(200, 'Loaded the French homepage.'); - - // Confirm the generator string was translated. - $xpath = $this->xpath("//meta[@name='generator']"); - $this->assertEqual(count($xpath), 1, 'Exactly one generator meta tag found.'); - $this->assertEqual($xpath[0]['content'], $string_fr); - } - - /** - * Test translations of the custom configurations. - */ - public function testI18nCustomConfig() { - // Plan out the different translation string tests. - $string_en = 'Welcome to the homepage!'; - $string_fr = 'Bonjour pour le homepage!'; - $config_name = 'metatag_config:global:frontpage:title'; - - // Confirm the translation page exists and has some Metatag strings. - $this->searchTranslationPage('', $config_name); - - // Confirm the string is not present yet. - $this->searchTranslationPage($string_en, $config_name, FALSE); - - // Load the front page's meta tags. - $instance = 'global:frontpage'; - $config = metatag_config_load($instance); - - // Set something specific as the homepage. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Confirm the string is present now. - $this->searchTranslationPage($string_en, $config_name); - - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - - // Get the translation string lid for the front page's title. - $lid = $this->getTranslationLidByContext($config_name); - $this->assertNotEqual($lid, 0, 'Found the locales_source string for the front page title tag.'); - - // Save the translation string. - $this->saveTranslationString($lid, $config_name, 'fr', $string_en, $string_fr); - - // Load the English front page again. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the default homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - - // Load the French front page. - $this->drupalGet('fr'); - $this->assertResponse(200, 'Loaded the French homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_fr); - } - - /** - * Confirm that translations will be deleted when configs are deleted. - */ - public function testI18nDeleteConfig() { - // Plan out the different translation string tests. - $string_en = 'Hey, an article!'; - $string_fr = 'Alors! Un article!'; - $config_name = 'metatag_config:node:article:title'; - - // Create a config for the 'article' content type's meta tags. - $instance = 'node:article'; - $label = t('Node: Article'); - $config = new StdClass(); - $config->instance = $instance; - $config->api_version = 1; - $config->disabled = FALSE; - $config->export_module = 'metatag'; - $config->config = array(); - - // Set something specific as the page title. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Confirm the string is present now. - $this->searchTranslationPage($string_en, $config_name); - - // Load the 'delete' page. - $this->drupalGet('admin/config/search/metatags/config/' . $instance . '/delete'); - $this->assertResponse(200); - - // Confirm this is the correct page. - $this->assertText(t('Are you sure you want to delete the meta tag defaults for @label?', array('@label' => $label))); - $this->assertText(t('This action cannot be undone.')); - $this->assertFieldByName('op'); - $this->assertFieldByName('op', t('Confirm')); - - // Submit the form. - $this->drupalPost(NULL, array(), t('Confirm')); - $this->assertResponse(200); - $this->assertText(t('The meta tag defaults for @label have been deleted.', array('@label' => $label))); - - // Confirm the string has been removed. - $this->searchTranslationPage($string_en, $config_name, FALSE); - } - - /** - * Confirm that translations will be deleted when entity bundles are deleted. - */ - public function testI18nDeleteEntityBundle() { - // Plan out the different translation string tests. - $string_en = 'Hey, an article!'; - $string_fr = 'Alors! Un article!'; - $config_name = 'metatag_config:node:article:title'; - - // Create a config for the 'article' content type's meta tags. - $content_type = 'article'; - $content_type_label = t('Article'); - $instance = 'node:article'; - $instance_label = t('Node: Article'); - $config = new StdClass(); - $config->instance = $instance; - $config->api_version = 1; - $config->disabled = FALSE; - $config->export_module = 'metatag'; - $config->config = array(); - - // Set something specific as the page title. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Confirm the string is present now. - $this->searchTranslationPage($string_en, $config_name); - - // Load the 'delete' page. - $this->drupalGet('admin/structure/types/manage/' . $content_type); - $this->assertResponse(200); - - // Confirm this is the correct page. - $this->assertFieldByName('op', t('Delete content type')); - - // Submit the form. - $this->drupalPost(NULL, array(), t('Delete content type')); - $this->assertResponse(200); - - // Confirm this is the correct page. - $this->assertText(t('Are you sure you want to delete the content type @label?', array('@label' => $content_type_label))); - $this->assertText(t('This action cannot be undone.')); - $this->assertFieldByName('op'); - $this->assertFieldByName('op', t('Delete')); - - // Submit the form. - $this->drupalPost(NULL, array(), t('Delete')); - $this->assertResponse(200); - $this->assertText(t('The content type @label has been deleted.', array('@label' => $content_type_label))); - - // Confirm the config was deleted. - $config = metatag_config_load($instance); - $this->assertEqual($config, array()); - - // Confirm the string has been removed. - $this->searchTranslationPage($string_en, $config_name, FALSE); - } - - /** - * Test translations of the custom configurations. - */ - public function testI18nDifferentSourceLanguage() { - // Make French the default source locale. - variable_set('i18n_string_source_language', 'fr'); - - // Verify that the default language and source language are different. - $this->assertNotEqual(i18n_string_source_language(), language_default('language')); - - // Plan out the different translation string tests. - $string_en = 'Welcome to the homepage!'; - $string_fr = 'Bonjour pour le homepage!'; - $config_name = 'metatag_config:global:frontpage:title'; - - // Confirm the translation page exists and has some Metatag strings. - $this->searchTranslationPage('', $config_name); - - // Confirm the string is not present yet. - $this->searchTranslationPage($string_en, $config_name, FALSE); - - // Load the front page's meta tags. - $instance = 'global:frontpage'; - $config = metatag_config_load($instance); - - // Set something specific as the homepage. - $config->config['title']['value'] = $string_fr; - metatag_config_save($config); - - // Confirm the string is present now. - $this->searchTranslationPage($string_fr, $config_name); - - // Load the front page. - $this->drupalGet('fr'); - $this->assertResponse(200, 'Loaded the homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_fr); - - // Get the translation string lid for the front page's title. - $lid = $this->getTranslationLidByContext($config_name); - $this->assertNotEqual($lid, 0, 'Found the locales_source string for the front page title tag.'); - - // Save the translation string. - $this->saveTranslationString($lid, $config_name, 'en', $string_fr, $string_en); - - // Load the English front page again. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the default homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - - // Load the French front page. - $this->drupalGet('fr'); - $this->assertResponse(200, 'Loaded the French homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_fr); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nDisabledTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nDisabledTest.test deleted file mode 100644 index de843634ea..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nDisabledTest.test +++ /dev/null @@ -1,105 +0,0 @@ - 'Metatag core tests with i18n disabled', - 'description' => 'Test Metatag integration with the i18n module enabled but the integration disabled.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'i18n'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - // Need the i18n and i18n_strings modules. - $modules[] = 'i18n'; - $modules[] = 'i18n_string'; - - // Enable all of the modules that are needed. - parent::setUp($modules); - - // Add more locales. - $this->setupLocales(); - - // Set up the locales. - $perms = array( - 'administer languages', - 'translate interface', - // From i18n. - 'translate admin strings', - 'translate user-defined strings', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Turn off i18n integration. - variable_set('metatag_i18n_disabled', TRUE); - - // Reload the translations. - drupal_flush_all_caches(); - module_load_include('admin.inc', 'i18n_string'); - i18n_string_refresh_group('metatag'); - } - - /** - * Test translations of the output tags. - */ - public function testI18nOutput() { - // Plan out the different translation string tests. - $string_en = 'Welcome to the homepage!'; - $string_fr = 'Bonjour pour le homepage!'; - $config_name = 'metatag:frontpage:title'; - - $this->searchTranslationPage('', $config_name); - - // Confirm the string is not present yet. - $this->searchTranslationPage($string_en, $config_name, FALSE); - - // Load the front page's meta tags. - $instance = 'global:frontpage'; - $config = metatag_config_load($instance); - - // Set something specific as the homepage. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - - // Confirm the string is still not translatable. - $this->searchTranslationPage($string_en, $config_name, FALSE); - - // Get the translation string lid for the front page's title. - $lid = $this->getTranslationLidByContext($config_name); - $this->assertEqual($lid, 0, 'Did not find a locales_source string for the front page output title tag.'); - - // Load the French front page. - $this->drupalGet('fr'); - $this->assertResponse(200, 'Loaded the French homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nOutputTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nOutputTest.test deleted file mode 100644 index 6a87986a3c..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithI18nOutputTest.test +++ /dev/null @@ -1,185 +0,0 @@ - 'Metatag core tests with i18n: output', - 'description' => 'Test Metatag integration with the i18n module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'i18n'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - // Need the i18n and i18n_strings modules. - $modules[] = 'i18n'; - $modules[] = 'i18n_string'; - - // Enable all of the modules that are needed. - parent::setUp($modules); - - // Add more locales. - $this->setupLocales(); - - // Set up the locales. - $perms = array( - 'administer languages', - 'translate interface', - // From i18n. - 'translate admin strings', - 'translate user-defined strings', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - } - - /** - * Test translations of the output tags. - */ - public function testI18nOutputTranslationsEnabled() { - // Enable output translations. - $this->toggleOutputTranslations(TRUE); - - // Plan out the different translation string tests. - $string_en = 'Welcome to the homepage!'; - $string_fr = 'Bonjour pour le homepage!'; - $string_context = 'output:frontpage:title'; - - $this->searchTranslationPage('', $string_context); - - // Confirm the string is not present yet. - $this->searchTranslationPage($string_en, $string_context, FALSE); - - // Load the front page's meta tags. - $instance = 'global:frontpage'; - $config = metatag_config_load($instance); - - // Set something specific as the homepage. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - - // Confirm the string is translatable. - $this->searchTranslationPage($string_en, $string_context); - - // Get the translation string lid for the front page's title. - $lid = $this->getTranslationLidByContext($string_context); - $this->assertNotEqual($lid, 0, 'Found the locales_source string for the front page output title tag.'); - - // Save the translation string. - $this->saveTranslationString($lid, $string_context, 'fr', $string_en, $string_fr); - - // Load the English front page again. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the default homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - - // Load the French front page. - $this->drupalGet('fr'); - $this->assertResponse(200, 'Loaded the French homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_fr); - - // Make doubly sure there are output translations. - $lids = $this->getTranslationsByContext($string_context); - $this->assertNotEqual($lids, array()); - } - - /** - * Verify that no output translation records are generated when it's disabled. - */ - public function testI18nOutputTranslationsDisabled() { - // Make sure output translations are disabled. - $this->toggleOutputTranslations(FALSE); - - // Plan out the different translation string tests. - $string_en = 'Welcome to the homepage!'; - $string_fr = 'Bonjour pour le homepage!'; - $string_context = 'output:frontpage:title'; - - $this->searchTranslationPage('', $string_context); - - // Confirm the string is not present yet. - $this->searchTranslationPage($string_en, $string_context, FALSE); - - // Load the front page's meta tags. - $instance = 'global:frontpage'; - $config = metatag_config_load($instance); - - // Set something specific as the homepage. - $config->config['title']['value'] = $string_en; - metatag_config_save($config); - - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200, 'Loaded the homepage.'); - - // Confirm the page's title is what we set it to. - $this->assertTitle($string_en); - - // Confirm the string is still not translatable. - $this->searchTranslationPage($string_en, $string_context, FALSE); - - // Make doubly sure there are no output translations. - $lids = $this->getTranslationsByContext($string_context); - $this->assertEqual($lids, array()); - } - - /** - * - */ - public function testMenuPaths() { - $paths = metatag_test_menu(); - $test_string = 'read-more-books-every-day'; - foreach ($paths as $path => $menu_item) { - if (substr($path, -1) == '%') { - $path = substr($path, 0, -1) . $test_string; - } - $this->drupalGet($path); - $this->assertResponse(200, 'Loaded a page: ' . $path); - } - } - - /** - * Enable or disable output translations. - * - * @param bool $enable - * Whether or not to enable translations; defaults to TRUE. - */ - private function toggleOutputTranslations($enable = TRUE) { - // Enable output translation. - variable_set('metatag_i18n_translate_output', $enable); - - // Reload the translations. - drupal_flush_all_caches(); - module_load_include('admin.inc', 'i18n_string'); - i18n_string_refresh_group('metatag'); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMeTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMeTest.test deleted file mode 100644 index 98fb3f234d..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMeTest.test +++ /dev/null @@ -1,73 +0,0 @@ - 'Metatag core tests with Me', - 'description' => 'Test Metatag integration with the Me module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'me'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - $modules[] = 'me'; - - parent::setUp($modules); - } - - /** - * Make sure the /user/me path doesn't load any meta tags. - */ - public function testMePath() { - // Create an admin user and log them in. - if (!isset($this->adminUser)) { - $this->adminUser = $this->createAdminUser(); - } - $this->drupalLogin($this->adminUser); - - // Load the user's profile page. - // Load the 'me' page. - $this->drupalGet('user/' . $this->adminUser->uid); - $this->assertResponse(200); - - // Look for some meta tags that should exist. - $xpath = $this->xpath("//meta[@name='generator']"); - $this->assertEqual(count($xpath), 1, 'Exactly one generator meta tag found.'); - $this->assertEqual($xpath[0]['content'], 'Drupal 7 (https://www.drupal.org)'); - $xpath = $this->xpath("//link[@rel='canonical']"); - $this->assertEqual(count($xpath), 1, 'Exactly one canonical meta tag found.'); - $this->assertEqual($xpath[0]['href'], url('user/' . $this->adminUser->uid, array('absolute' => TRUE))); - $xpath = $this->xpath("//link[@rel='shortlink']"); - $this->assertEqual(count($xpath), 1, 'Exactly one shortlink meta tag found.'); - $this->assertEqual($xpath[0]['href'], url('user/' . $this->adminUser->uid, array('absolute' => TRUE))); - - // Load the 'me' page. - $this->drupalGet('user/me'); - $this->assertResponse(200); - - // Confirm the meta tags defined above don't exist. - $xpath = $this->xpath("//meta[@name='generator']"); - $this->assertEqual(count($xpath), 0, 'Did not find the generator meta tag.'); - $xpath = $this->xpath("//link[@rel='canonical']"); - $this->assertEqual(count($xpath), 0, 'Did not find the canonical meta tag.'); - $xpath = $this->xpath("//link[@rel='shortlink']"); - $this->assertEqual(count($xpath), 0, 'Did not find the shortlink meta tag.'); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMediaTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMediaTest.test deleted file mode 100644 index 46410104f4..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithMediaTest.test +++ /dev/null @@ -1,240 +0,0 @@ - 'Metatag core tests with Media', - 'description' => 'Test Metatag integration with the Media module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'file_entity', 'media'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - $modules[] = 'file_entity'; - $modules[] = 'media'; - // The filter is in the WYSIWYG submodule. - $modules[] = 'media_wysiwyg'; - - parent::setUp($modules); - } - - /** - * Make sure the media filter is enabled. - */ - public function testMediaFilter() { - $desc = 'The description.'; - - // Create a node and check how the meta tag is displayed. - $node = $this->drupalCreateNode(array( - 'body' => array( - LANGUAGE_NONE => array( - array( - 'value' => $desc . '[[' - . json_encode(array( - 'fid' => 1, - 'view_mode' => 'default', - 'type' => 'media', - 'attributes' => array( - 'height' => '100', - 'width' => '100', - 'class' => 'media-element file-default', - ), - )) - . ']]', - 'format' => filter_default_format(), - ), - ), - ), - )); - - // Load the node page. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Check the 'description' tag to make sure the Media string was filtered. - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual($xpath[0]['content'], $desc); - } - - /** - * Make sure extremely long media tags are properly handled. - */ - public function testMediaFilterLongToken() { - $desc = 'The description with long token.'; - - $node = $this->drupalCreateNode(array( - 'body' => array( - LANGUAGE_NONE => array( - array( - 'value' => $desc . '[[' - . json_encode(array( - 'fid' => 1, - 'view_mode' => 'default', - 'fields' => array( - 'alt' => 'alt text field value', - 'style' => 'height: auto;', - 'class' => 'media-element file-default cke_widget_element', - 'data-delta' => 25, - 'format' => 'default', - 'alignment' => 'center', - 'field_image_width[und][0][value]' => '', - 'field_file_image_alt_text[und][0][value]' => 'alt text field value', - 'field_caption[und][0][value]' => '', - 'field_file_image_title_text[und][0][value]' => FALSE, - ), - 'type' => 'media', - 'field_deltas' => array( - 25 => array( - 'alt' => 'alt text field value', - 'style' => 'height: auto;', - 'class' => 'media-element file-default cke_widget_element', - 'data-delta' => 25, - 'format' => 'default', - 'alignment' => 'center', - 'field_image_width[und][0][value]' => '', - 'field_file_image_alt_text[und][0][value]' => 'alt text field value', - 'field_caption[und][0][value]' => '', - 'field_file_image_title_text[und][0][value]' => FALSE, - ), - ), - 'attributes' => array( - 'alt' => 'alt text field value', - 'style' => 'height:auto', - 'class' => 'file-default media-element media-wysiwyg-align-center', - 'data-delta' => '25', - ), - )) - .']]', - 'format' => filter_default_format(), - ), - ), - ), - )); - - // Load the node page. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Check the 'description' tag to make sure the Media string was filtered. - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual($xpath[0]['content'], $desc); - } - - /** - * Make sure body text starting with a media token is properly handled. - */ - public function testMediaFilterTokenAtBeginning() { - $desc = 'The description with token at beginning.'; - - $node = $this->drupalCreateNode(array( - 'body' => array( - LANGUAGE_NONE => array( - array( - 'value' => '[[' - . json_encode(array( - 'fid' => '1', - 'view_mode' => 'default', - 'type' => 'media', - 'attributes' => array( - 'height' => '100', - 'width' => '100', - 'class' => 'media-element file-default', - ), - )) - . ']]' . $desc, - 'format' => filter_default_format(), - ), - ), - ), - )); - - // Load the node page. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Check the 'description' tag to make sure the Media string was filtered. - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual($xpath[0]['content'], $desc); - } - - /** - * Make sure body text starting with an extremely long media token is handled. - */ - public function testMediaFilterTokenAtBeginningLongToken() { - $desc = 'The description with long token at beginning.'; - - $node = $this->drupalCreateNode(array( - 'body' => array( - LANGUAGE_NONE => array( - array( - 'value' => '[[' - . json_encode(array( - 'fid' => '1', - 'view_mode' => 'default', - 'fields' => array( - 'alt' => 'alt text field value', - 'style' => 'height: auto;', - 'class' => 'media-element file-default cke_widget_element', - 'data-delta' => 25, - 'format' => 'default', - 'alignment' => 'center', - 'field_image_width[und][0][value]' => '', - 'field_file_image_alt_text[und][0][value]' => 'alt text field value', - 'field_caption[und][0][value]' => '', - 'field_file_image_title_text[und][0][value]' => FALSE, - ), - 'type' => 'media', - 'field_deltas' => array( - 25 => array( - 'alt' => 'alt text field value', - 'style' => 'height: auto;', - 'class' => 'media-element file-default cke_widget_element', - 'data-delta' => 25, - 'format' => 'default', - 'alignment' => 'center', - 'field_image_width[und][0][value]' => '', - 'field_file_image_alt_text[und][0][value]' => 'alt text field value', - 'field_caption[und][0][value]' => '', - 'field_file_image_title_text[und][0][value]' => FALSE, - ), - ), - 'attributes' => array( - 'alt' => 'alt text field value', - 'style' => 'height:auto', - 'class' => 'file-default media-element media-wysiwyg-align-center', - 'data-delta' => 25, - ), - )) - . ']]' . $desc, - 'format' => filter_default_format(), - ), - ), - ), - )); - - // Load the node page. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Check the 'description' tag to make sure the Media string was filtered. - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual($xpath[0]['content'], $desc); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithPanelsTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithPanelsTest.test deleted file mode 100644 index c33ff4b6d0..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithPanelsTest.test +++ /dev/null @@ -1,183 +0,0 @@ - 'Metatag core tests with Panels', - 'description' => 'Test Metatag integration with the Panels module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'panels', 'page_manager'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - // We'll be using Panels but most of the work is actually in Page Manager. - $modules[] = 'page_manager'; - $modules[] = 'panels'; - - parent::setUp($modules); - } - - /** - * Test out a node_view Panels display with Metatag. - */ - public function testPanelsNodeView() { - $content_type = 'metatag_test'; - $content_type_path = str_replace('_', '-', $content_type); - $label = 'Test'; - - // Create a content type. - $this->createContentType($content_type, $label); - - // Create an admin user and log them in. - $perms = array( - // Needed for the content type. - 'create ' . $content_type . ' content', - 'delete any ' . $content_type . ' content', - 'edit any ' . $content_type . ' content', - - // Needed for Panels et al. - 'use page manager', - 'administer page manager', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Create a test node. - - // Load the node form. - $this->drupalGet('node/add/' . $content_type_path); - $this->assertResponse(200); - - // Verify the page loaded correctly. - // @todo Update this to extract the page title. - $this->assertText(strip_tags(t('Create @name', array('@name' => $label)))); - - // Verify that it's possible to submit values to the form. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[node:title] ponies', - 'title' => 'Who likes magic', - ), t('Save')); - $this->assertResponse(200); - - // Verify that the node saved correctly. - // $xpath = $this->xpath("//h1"); - $t_args = array('@type' => 'Test', '%title' => 'Who likes magic'); - // This doesn't work for some reason, it seems the HTML is stripped off - // during output so the %title's standard Drupal wrappers don't match. - // $this->assertText(t('@type %title has been created.', $t_args)); - // .. so this has to be done instead. - $this->assertText(strip_tags(t('@type %title has been created.', $t_args))); - - // Save the node URL for later. - $node_url = $this->getUrl(); - - // Confirm the tags load correctly. - $this->confirmNodeTags(); - - // Enable the Page Manager display for nodes. - variable_set('page_manager_node_view_disabled', FALSE); - - // Confirm that the main Panels page loads correctly. - $this->drupalGet('admin/structure/pages'); - $this->assertResponse(200); - - // Confirm that the Panels node_view page loads. - $this->drupalGet('admin/structure/pages/edit/node_view'); - $this->assertResponse(200); - - // Confirm that a new variant can be added. - $this->drupalGet('admin/structure/pages/nojs/operation/node_view/actions/add'); - $this->assertResponse(200); - - // Create a variant. This is done as a series of form submissions. - $args = array( - 'title' => 'Test', - 'name' => 'test', - 'handler' => 'panel_context', - ); - $this->drupalPost('admin/structure/pages/nojs/operation/node_view/actions/add', $args, t('Create variant')); - $this->assertResponse(200); - $args = array( - 'layout' => 'flexible', - ); - $this->drupalPost(NULL, $args, t('Continue')); - $this->assertResponse(200); - $args = array(); - $this->drupalPost(NULL, $args, t('Continue')); - $this->assertResponse(200); - $args = array(); - $this->drupalPost(NULL, $args, t('Create variant')); - $this->assertResponse(200); - $this->assertText(t('The page has been updated. Changes will not be permanent until you save.')); - $args = array(); - $this->drupalPost(NULL, $args, t('Save')); - $this->assertResponse(200); - - // Confirm the process completed successfully. - $this->assertEqual($this->getUrl(), url('admin/structure/pages/edit/node_view', array('absolute' => TRUE))); - $this->assertText(t('Panel') . ': Test'); - - // Clear all caches, so we can start off properly. - drupal_flush_all_caches(); - - // Load the node page again. - $this->confirmNodeTags($node_url); - } - - /** - * Confirm that the meta tags for the requested node load properly. - * - * @param string $path - * Optional path to load, if not present the current path will be used. - */ - function confirmNodeTags($path = NULL) { - if (!empty($path)) { - $this->drupalGet($path); - $this->assertResponse(200); - } - - // Verify the title is using the custom default for this content type. - $xpath = $this->xpath("//meta[@name='abstract']"); - $this->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.'); - $this->assertEqual($xpath[0]['content'], 'Who likes magic ponies'); - } - - /** - * Test out a term_view Panels display with Metatag. - * - * @todo Write this. - */ - // public function testPanelsTermView() { - // // Enable the Page Manager display for terms. - // variable_set('page_manager_term_view_disabled', FALSE); - // } - - /** - * Test out a user_view Panels display with Metatag. - * - * @todo Write this. - */ - // public function testPanelsUserView() { - // // Enable the Page Manager display for users. - // variable_set('page_manager_user_view_disabled', FALSE); - // } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithProfile2Test.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithProfile2Test.test deleted file mode 100644 index 031da77f8d..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithProfile2Test.test +++ /dev/null @@ -1,133 +0,0 @@ - 'Metatag core tests with Profile2', - 'description' => 'Test Metatag integration with the Profile2 module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'profile2'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - $modules[] = 'profile2'; - - parent::setUp($modules); - - // Add extra permissions for the admin user, this way it can be ready for - // use by the other user tests. - $perms = array( - // Let the user edit & view their own profile. - 'edit own main profile', - 'view own main profile', - // Manage profile entity definitions. - 'administer profile types', - // Need this permission to access the Field UI pages for Profile2. - 'administer site configuration', - 'administer fields', - 'administer profiles', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - } - - /** - * Make sure that the Profile2 entity doesn't interfere with the user entity. - */ - public function testUserProfilePage() { - // Add a custom meta tag to the user's profile. - $this->drupalGet('user/' . $this->adminUser->uid . '/edit'); - $this->assertResponse(200); - - // Verify that it's possible to submit values to the form. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[user:name] ponies', - ), t('Save')); - $this->assertResponse(200); - - // Verify that the user object saved correctly. - $this->assertText(strip_tags(t('The changes have been saved.'))); - - // Confirm the user profile tags work correctly. - $this->assertUserEntityTags($this->adminUser); - - // Load the 'main' Profile2 fields admin page. - $this->drupalGet('admin/structure/profiles'); - $this->assertResponse(200); - // Load the 'main' Profile2 fields admin page. - $this->drupalGet('admin/structure/profiles/manage/main'); - $this->assertResponse(200); - // Load the 'main' Profile2 fields admin page. - $this->drupalGet('admin/structure/profiles/manage/main/fields'); - $this->assertResponse(200); - - // Verify that the page loaded correctly. - $this->assertFieldByName('fields[_add_new_field][label]'); - $this->assertFieldByName('fields[_add_new_field][field_name]'); - $this->assertFieldByName('fields[_add_new_field][type]'); - $this->assertFieldByName('fields[_add_new_field][widget_type]'); - - // Add a text field to the Main profile. - $edit = array( - 'fields[_add_new_field][label]' => 'Test field', - 'fields[_add_new_field][field_name]' => 'test', - 'fields[_add_new_field][type]' => 'text', - 'fields[_add_new_field][widget_type]' => 'text_textfield', - ); - $this->drupalPost(NULL, $edit, t('Save')); - $this->drupalPost(NULL, array(), t('Save field settings')); - $this->drupalPost(NULL, array(), t('Save settings')); - $this->assertText(strip_tags(t('Saved %label configuration.', array('%label' => 'Test field')))); - - // Edit the user's Profile2 entity. - $this->drupalGet('user/' . $this->adminUser->uid . '/edit/main'); - $this->assertResponse(200); - $this->assertFieldByName('profile_main[field_test][und][0][value]'); - $edit = array( - 'profile_main[field_test][und][0][value]' => 'test string', - ); - $this->drupalPost(NULL, $edit, t('Save')); - - // Add a custom meta tag to the user's profile. - $this->drupalGet('user/' . $this->adminUser->uid . '/edit'); - $this->assertResponse(200); - - // Verify that it's possible to submit values to the form. - $edit = array( - 'metatags[und][abstract][value]' => '[user:name] ponies', - ); - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertResponse(200); - - // Verify that the user object saved correctly. - $this->assertText(strip_tags(t('The changes have been saved.'))); - - // Clear all caches. - drupal_flush_all_caches(); - - // Confirm the user profile tags still work correctly. - $this->assertUserEntityTags($this->adminUser); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithSearchApiTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithSearchApiTest.test deleted file mode 100644 index 94b575c78e..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithSearchApiTest.test +++ /dev/null @@ -1,139 +0,0 @@ - 'Metatag Search API tests', - 'description' => 'Tests the Metatag Search API integration.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'entity', 'search_api'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - // Needed for Search API. - $modules[] = 'entity'; - // The module. - $modules[] = 'search_api'; - // Used to help test the integration. - $modules[] = 'metatag_search_test'; - - parent::setUp($modules); - - // Create an admin user and log them in. - $perms = array( - // Needed for the content type. - 'edit any page content', - - // Needed for Search API. - 'administer search_api', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Create an index. - $this->indexId = 'test_index'; - $this->index = entity_create('search_api_index', array( - 'id' => $this->indexId, - 'name' => 'test', - 'machine_name' => 'test_index', - 'enabled' => 1, - 'item_type' => 'node', - 'options' => array( - 'data_alter_callbacks' => array( - 'search_api_metatag_alter_callback' => array( - 'status' => 1, - ), - ), - 'fields' => array( - 'metatag_keywords' => array( - 'type' => 'text', - ), - ), - ), - )); - $this->index->save(); - - // Set up a Search API server. - $this->serverId = 'test_server'; - $values = array( - 'name' => 'Search API test server', - 'machine_name' => $this->serverId, - 'enabled' => 1, - 'description' => 'A server used for testing.', - 'class' => 'metatag_search_test_service', - ); - $this->drupalPost('admin/config/search/search_api/add_server', $values, 'Create server'); - - // Configure the server. - $this->drupalPost(NULL, array(), 'Create server'); - $this->assertText(t('The server was successfully created.')); - $this->drupalGet('admin/config/search/search_api'); - $values = array( - 'server' => $this->serverId, - ); - $this->drupalPost("admin/config/search/search_api/index/{$this->indexId}/edit", $values, 'Save settings'); - $this->clickLink(t('enable')); - - // Enable meta tags for the 'page' content type. - metatag_entity_type_enable('node', 'page'); - } - - /** - * Test that the alter callback indexes the keywords. - */ - public function testAlter() { - // Add a node with keywords. - $node = $this->drupalCreateNode(); - $keywords = 'puppies, rainbows'; - $values = array( - 'metatags[' . LANGUAGE_NONE . '][keywords][value]' => $keywords, - ); - $this->drupalPost('node/' . $node->nid . '/edit', $values, 'Save'); - - // Index the node. - $this->drupalPost("admin/config/search/search_api/index/{$this->indexId}", array(), 'Index now'); - - // Check whether the keywords have been indexed. - $this->assertIdentical(variable_get('metatag_search_test_keywords', FALSE), $keywords); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithViewsTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithViewsTest.test deleted file mode 100644 index f7346ef972..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithViewsTest.test +++ /dev/null @@ -1,191 +0,0 @@ - 'Metatag core tests with Views', - 'description' => 'Test Metatag integration with the Views module.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'views'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - $modules[] = 'views'; - $modules[] = 'views_ui'; - - // Need the Path module to set a alias which can then be loaded. - $modules[] = 'path'; - - parent::setUp($modules); - } - - /** - * Test the taxonomy term page still works when displayed via Views. - */ - public function testTermViews() { - $vocab_name = 'test_vocab'; - $term_name = 'Who likes magic'; - $term_path = 'term-test'; - - // Create a vocabulary. - $vocabulary = $this->createVocabulary($vocab_name); - - // Create an admin user and log them in. - $perms = array( - // Global admin access. - 'administer site configuration', - - // Needed for the vocabulary. - 'administer taxonomy', - 'edit terms in ' . $vocabulary->vid, - 'delete terms in ' . $vocabulary->vid, - - // Needed for the Path module. - 'create url aliases', - - // Needed for Views. - 'administer views', - ); - $this->adminUser = $this->createAdminUser($perms); - - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Load the "add default configuration" page. - $this->drupalGet('admin/config/search/metatags/config/add'); - $this->assertResponse(200); - - // Verify the page loaded correct. - $this->assertText(t('Select the type of default meta tags you would like to add.')); - - // Submit the initial form to select an entity bundle. - $this->drupalPost(NULL, array( - 'instance' => 'taxonomy_term:' . $vocabulary->name, - ), t('Add and configure')); - $this->assertResponse(200); - - // @todo Update this to extract the H1 tag. - $this->assertText(strip_tags('Taxonomy term: ' . $vocabulary->name)); - - // Submit the form with some values. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[term:name]', - ), t('Save')); - $this->assertResponse(200); - - // Verify the page loaded correct. - $this->assertText(strip_tags(t('The meta tag defaults for @label have been saved.', array('@label' => 'Taxonomy term: ' . $vocabulary->name)))); - - // Verify that the user was redirected to the settings page again. - $this->assertEqual($this->getUrl(), url('admin/config/search/metatags', array('absolute' => TRUE))); - - // Create a test term. - // Load the term form. - $this->drupalGet('admin/structure/taxonomy/' . $vocabulary->machine_name . '/add'); - $this->assertResponse(200); - - // Verify the page loaded correctly. - // @todo Update this to extract the H1 tag. - // $this->assertText(strip_tags(t('Create @name', array('@name' => $vocabulary->name)))); - // Verify that it's possible to submit values to the form. - $this->drupalPost(NULL, array( - 'metatags[und][abstract][value]' => '[term:name] ponies', - 'name' => $term_name, - 'path[alias]' => $term_path, - ), t('Save')); - $this->assertResponse(200); - - // Verify that the node saved correctly. - $t_args = array('%name' => $term_name); - // This doesn't work for some reason, it seems the HTML is stripped off - // during output so the %name's standard Drupal wrappers don't match. - // $this->assertText(t('Created new term %name.', $t_args)); - // .. so this has to be done instead. - $this->assertText(strip_tags(t('Created new term %name.', $t_args))); - - // Verify the term data saved correctly. - $this->drupalGet($term_path); - $this->assertResponse(200); - - // Confirm the page is managed by the default taxonomy term page. - $this->assertText(t('There is currently no content classified with this term.')); - - // Enable the taxonomy_term default display. - $view = views_get_view('taxonomy_term'); - ctools_include('export'); - ctools_export_set_object_status($view, 0); - $this->clearAllCaches(); - - $this->drupalGet('admin/structure/views'); - $this->assertResponse(200); - - $vars = variable_get('views_defaults'); - $this->verbose($vars); - $this->assertFalse($vars['taxonomy_term'], 'Taxonomy term page is enabled.'); - - // Load the page again. - $this->drupalGet($term_path); - $this->assertResponse(200); - - // Confirm this page is managed by Views - if it's managed by the default - // taxonomy term page this text will show. - $this->assertNoText(t('There is currently no content classified with this term.')); - - // Try to extract the 'edit' link. - $xpaths = $this->xpath("//ul/li/a"); - $matches = array(); - $tid = 0; - if (!empty($xpaths)) { - foreach ($xpaths as $xpath) { - $attributes = $xpath->attributes(); - if (!empty($attributes['href'])) { - if (preg_match('@taxonomy/term/(\d+)/edit$@', $attributes['href'], $matches)) { - $tid = $matches[1]; - } - } - } - } - - // Presuing a term ID was found, load the term. - if (!empty($tid)) { - $term = taxonomy_term_load($tid); - - // Only the non-default values are stored. - $expected = array( - 'und' => array( - 'abstract' => array( - 'value' => '[term:name] ponies', - ), - ), - ); - $this->assertEqual($expected, $term->metatags); - } - - // This shouldn't happen, it indicates a problem. - else { - $this->fail(t('Could not determine the ID for created term.')); - } - - // Verify the title is using the custom default for this vocabulary. - $xpath = $this->xpath("//meta[@name='abstract']"); - $this->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.'); - $this->assertEqual($xpath[0]['content'], "Who likes magic ponies"); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithWorkbenchModerationTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithWorkbenchModerationTest.test deleted file mode 100644 index 118855e15a..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreWithWorkbenchModerationTest.test +++ /dev/null @@ -1,117 +0,0 @@ - 'Metatag core tests with Workbench Moderation v3', - 'description' => 'Test Metatag integration with the Workbench Moderation module (v3).', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token', 'workbench_moderation'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - $modules[] = 'workbench_moderation'; - - parent::setUp($modules); - } - - /** - * Confirm that WM-based node edit workflows work properly. - */ - public function testNodeEdit() { - // Create a new content type and enable moderation on it. - $content_type = 'metatag_test'; - $content_type_path = str_replace('_', '-', $content_type); - $label = 'Test'; - $this->createContentType($content_type, $label); - variable_set('node_options_' . $content_type, array('revision', 'moderation')); - - // Create a brand new unpublished node programmatically. - $settings = array( - 'title' => 'Who likes magic', - 'type' => $content_type, - 'metatags' => array( - LANGUAGE_NONE => array( - 'abstract' => array('value' => '[node:title] ponies'), - ), - ), - 'status' => NODE_NOT_PUBLISHED, - ); - $node = $this->drupalCreateNode($settings); - - // Check that page is not published. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(403); - - // Create and login user. - $moderator_user = $this->drupalCreateUser(array( - 'access content', - 'view revisions', - 'view all unpublished content', - 'view moderation history', - 'view moderation messages', - 'bypass workbench moderation', - "create {$content_type} content", - "edit any {$content_type} content", - )); - $this->drupalLogin($moderator_user); - - // Publish the node via the moderation form. - $moderate = array('state' => workbench_moderation_state_published()); - $this->drupalPost("node/{$node->nid}/moderation", $moderate, t('Apply')); - - // Create draft with different node title. - $edit = array( - 'title' => 'I like magic', - ); - $this->drupalPost("node/{$node->nid}/edit", $edit, t('Save')); - - // Logout user. - $this->drupalLogout(); - - // Check that page is already published. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Verify the title is using the custom default for this content type. - $xpath = $this->xpath("//meta[@name='abstract']"); - $this->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.'); - $this->assertEqual($xpath[0]['content'], 'Who likes magic ponies'); - - // Login user again. - $this->drupalLogin($moderator_user); - - // Publish draft via the moderation form. - $moderate = array('state' => workbench_moderation_state_published()); - $this->drupalPost("node/{$node->nid}/moderation", $moderate, t('Apply')); - - // Logout user. - $this->drupalLogout(); - - // Check that page is already published. - $this->drupalGet('node/' . $node->nid); - $this->assertResponse(200); - - // Verify the title is using the custom default for this content type. - $xpath = $this->xpath("//meta[@name='abstract']"); - $this->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.'); - $this->assertEqual($xpath[0]['content'], 'I like magic ponies'); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreXSSTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreXSSTest.test deleted file mode 100644 index 95b95b157c..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagCoreXSSTest.test +++ /dev/null @@ -1,210 +0,0 @@ -alert("xss");Mango.'; - - /** - * String that causes an alert when metatags aren't filtered for xss. - * - * @var string - */ - private $xssString = '">Mango. 'Metatag core tests for XSS.', - 'description' => 'Test Metatag for XSS vulnerabilities.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token'), - ); - } - - /** - * {@inheritdoc} - */ - function setUp(array $modules = array()) { - parent::setUp($modules); - - $content_type = 'page'; - - // Create an admin user and log them in. - $perms = array( - // Needed for the content type. - 'create ' . $content_type . ' content', - 'delete any ' . $content_type . ' content', - 'edit any ' . $content_type . ' content', - - // This permission is required in order to create new revisions. - 'administer nodes', - ); - $this->adminUser = $this->createAdminUser($perms); - $this->drupalLogin($this->adminUser); - - // Generate the encoded version of $xssImageString. - // '' - $prefix = ''; - $this->escapedXssImageTag = $prefix . $url . $value . $suffix; - } - - /** - * Verify XSS injected in global Node config is not rendered. - */ - function testXssMetatagConfig() { - // Submit the form with some example XSS values. - $this->drupalGet('admin/config/search/metatags/config/global'); - $this->assertResponse(200); - $edit = array( - 'metatags[und][title][value]' => $this->xssTitleString, - 'metatags[und][abstract][value]' => $this->xssString, - 'metatags[und][image_src][value]' => $this->xssImageString, - ); - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertResponse(200); - - // Use front page to test. - $this->drupalGet(''); - - // Verify title is clean. - $this->assertNoTitle($this->xssTitleString); - $this->assertNoRaw($this->xssTitleString); - - // Verify the abstract is clean. - $this->assertRaw($this->escapedXssTag); - $this->assertNoRaw($this->xssString); - - // Verify the image_src is clean. - $this->assertRaw($this->escapedXssImageTag); - $this->assertNoRaw($this->xssImageString); - } - - /** - * Verify XSS injected in the entity metatag override field is not rendered. - */ - public function testXssEntityOverride() { - $title = 'Test Page'; - - // Load a page node. - $this->drupalGet('node/add/page'); - $this->assertResponse(200); - - // Submit the node with some example XSS values. - $edit = array( - 'title' => $title, - 'metatags[und][title][value]' => $this->xssTitleString, - 'metatags[und][description][value]' => $this->xssString, - 'metatags[und][abstract][value]' => $this->xssString, - ); - $this->drupalPost(NULL, $edit, t('Save')); - - // Verify the page saved. - $this->assertResponse(200); - $this->assertText(t('Basic page @title has been created.', array('@title' => $title))); - - // Verify title is not the injected string and thus cleaned. - $this->assertNoTitle($this->xssTitleString); - $this->assertNoRaw($this->xssTitleString); - - // Verify the description and abstract are clean. - $this->assertRaw($this->escapedXssTag); - $this->assertNoRaw($this->xssString); - } - - /** - * Verify XSS injected in the entity titles are not rendered. - */ - public function testXssEntityTitle() { - // Load a page node. - $this->drupalGet('node/add/page'); - $this->assertResponse(200); - - // Submit the node with some example XSS values. - $edit = array( - 'title' => $this->xssTitleString, - 'body[und][0][value]' => 'hello world', - ); - $this->drupalPost(NULL, $edit, t('Save')); - - // Verify the page saved. - $this->assertResponse(200); - $this->assertText(t('has been created.')); - - // Verify title is not the injected string and thus cleaned. - $this->assertNoRaw($this->xssTitleString); - } - - /** - * Verify XSS injected in the body field is not rendered. - */ - public function testXssEntityBody() { - $title = 'Hello World'; - - // Load a page node. - $this->drupalGet('node/add/page'); - $this->assertResponse(200); - - // Submit the node with a test body value. - $edit = array( - 'title' => $title, - 'body[und][0][value]' => $this->xssString, - ); - $this->drupalPost(NULL, $edit, t('Save')); - - // Verify the page saved. - $this->assertResponse(200); - $this->assertText(t('Basic page @title has been created.', array('@title' => $title))); - - // Verify body field is clean. - $this->assertNoRaw($this->xssString); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTest.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTest.test deleted file mode 100644 index 60fb40aaa4..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTest.test +++ /dev/null @@ -1,299 +0,0 @@ - 'Metatag tags: Basic', - 'description' => 'Test the basic meta tags.', - 'group' => 'Metatag', - 'dependencies' => array('ctools', 'devel', 'token'), - ); - } - - /** - * {@inheritdoc} - */ - public $tags = array( - 'abstract', - 'author', - 'cache-control', - 'canonical', - 'content-language', - 'description', - 'expires', - 'generator', - 'geo.placename', - 'geo.position', - 'geo.region', - 'google', - 'icbm', - 'image_src', - 'keywords', - 'news_keywords', - 'next', - 'original-source', - 'pragma', - 'prev', - 'rating', - 'referrer', - 'refresh', - // @todo 'revisit-after', - 'rights', - 'robots', - // 'set_cookie', - 'shortlink', - 'standout', - 'title', - ); - - /** - * Implements {meta_tag_name}_test_field_xpath() for 'abstract'. - */ - public function abstract_test_field_xpath() { - return "//textarea[@name='metatags[und][abstract][value]']"; - } - - /** - * Implements {meta_tag_name}_test_output_xpath() for 'cache_control'. - */ - public function cache_control_test_output_xpath() { - return "//meta[@http-equiv='cache-control']"; - } - - /** - * Implements {meta_tag_name}_test_value_attribute() for 'canonical'. - */ - public function canonical_test_value_attribute() { - return 'href'; - } - - /** - * Implements {meta_tag_name}_test_output_xpath() for 'canonical'. - */ - public function canonical_test_output_xpath() { - return "//link[@rel='canonical']"; - } - - /** - * Implements {meta_tag_name}_test_name_attribute() for 'content_language'. - */ - public function content_language_test_name_attribute() { - return 'http-equiv'; - } - - /** - * Implements {meta_tag_name}_test_tag_name() for 'content_language'. - */ - public function content_language_test_tag_name() { - return 'content-language'; - } - - /** - * Implements {meta_tag_name}_test_field_xpath() for 'description'. - */ - public function description_test_field_xpath() { - return "//textarea[@name='metatags[und][description][value]']"; - } - - /** - * Implements {meta_tag_name}_test_tag_name() for 'geo_placename'. - */ - public function geo_placename_test_tag_name() { - return 'geo.placename'; - } - - /** - * Implements {meta_tag_name}_test_tag_name() for 'geo_position'. - */ - public function geo_position_test_tag_name() { - return 'geo.position'; - } - - /** - * Implements {meta_tag_name}_test_tag_name() for 'geo_region'. - */ - public function geo_region_test_tag_name() { - return 'geo.region'; - } - - /** - * Implements {meta_tag_name}_test_output_xpath() for 'image_src'. - */ - public function image_src_test_output_xpath() { - return "//link[@rel='image_src']"; - } - - /** - * Implements {meta_tag_name}_test_value_attribute() for 'image_src'. - */ - public function image_src_test_value_attribute() { - return 'href'; - } - - /** - * Implements {meta_tag_name}_test_value() for 'image_src'. - */ - public function image_src_test_value() { - return 'http://example.com/images/test-image.gif'; - } - - /** - * Implements {meta_tag_name}_test_output_xpath() for 'next'. - */ - public function next_test_output_xpath() { - return "//link[@rel='next']"; - } - - /** - * Implements {meta_tag_name}_test_value_attribute() for 'next'. - */ - public function next_test_value_attribute() { - return 'href'; - } - - /** - * Implements {meta_tag_name}_test_tag_name() for 'original-source'. - */ - public function original_source_test_tag_name() { - return 'original-source'; - } - - /** - * Implements {meta_tag_name}_test_name_attribute() for 'pragma'. - */ - public function pragma_test_name_attribute() { - return 'http-equiv'; - } - - /** - * Implements {meta_tag_name}_test_output_xpath() for 'prev'. - */ - public function prev_test_output_xpath() { - return "//link[@rel='prev']"; - } - - /** - * Implements {meta_tag_name}_test_value_attribute() for 'prev'. - */ - public function prev_test_value_attribute() { - return 'href'; - } - - /** - * Implements {meta_tag_name}_test_key() for 'rating'. - */ - public function rating_test_key() { - return 'metatags[und][rating][value]'; - } - - /** - * Implements {meta_tag_name}_test_value() for 'general'. - */ - public function rating_test_value() { - return 'general'; - } - - /** - * Implements {meta_tag_name}_test_field_xpath() for 'rating'. - */ - public function rating_test_field_xpath() { - return "//select[@name='metatags[und][rating][value]']"; - } - - /** - * Implements {meta_tag_name}_test_key() for 'referrer'. - */ - public function referrer_test_key() { - return 'metatags[und][referrer][value]'; - } - - /** - * Implements {meta_tag_name}_test_value() for 'referrer'. - */ - public function referrer_test_value() { - return 'origin'; - } - - /** - * Implements {meta_tag_name}_test_field_xpath() for 'referrer'. - */ - public function referrer_test_field_xpath() { - return "//select[@name='metatags[und][referrer][value]']"; - } - - /** - * Implements {meta_tag_name}_test_name_attribute() for 'refresh'. - */ - public function refresh_test_name_attribute() { - return 'http-equiv'; - } - - /** - * Implements {meta_tag_name}_test_value() for 'robots'. - */ - public function robots_test_key() { - return 'metatags[und][robots][value][index]'; - } - - /** - * Implements {meta_tag_name}_test_value() for 'robots'. - */ - public function robots_test_value() { - return TRUE; - } - - /** - * Implements {meta_tag_name}_test_field_xpath() for 'robots'. - */ - public function robots_test_field_xpath() { - return "//input[@name='metatags[und][robots][value][index]' and @type='checkbox']"; - } - - /** - * Implements {meta_tag_name}_test_value() for 'revisit-after'. - */ - public function revisit_after_test_value() { - return 2; - } - - /** - * Implements {meta_tag_name}_test_output_xpath() for 'shortlink'. - */ - public function shortlink_test_output_xpath() { - return "//link[@rel='shortlink']"; - } - - /** - * Implements {meta_tag_name}_test_value_attribute() for 'shortlink'. - */ - public function shortlink_test_value_attribute() { - return 'href'; - } - - /** - * Implements {meta_tag_name}_test_output_xpath() for 'title'. - */ - public function title_test_output_xpath() { - return "//title"; - } - - /** - * Implements {meta_tag_name}_test_value_attribute() for 'title'. - */ - public function title_test_value_attribute() { - return ''; - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTestBase.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTestBase.test deleted file mode 100644 index 21849d6274..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTagsTestBase.test +++ /dev/null @@ -1,283 +0,0 @@ -createAdminUser(); - $this->drupalLogin($account); - } - - /** - * Confirm that it's possible to load the front page. - * - * This is a simple test to confirm the site didn't blow up when this module - * was enabled. It's particularly useful when this test is extended on - * submodules. - */ - public function testFrontPage() { - // Load the front page. - $this->drupalGet(''); - $this->assertResponse(200); - - // Confirm the page is correct. - $this->assertText(t('No front page content has been created yet.')); - } - - /** - * Tests that this module's tags are available. - */ - function testTagsArePresent() { - // Load the global config. - $this->drupalGet('admin/config/search/metatags/config/global'); - $this->assertResponse(200); - - // Confirm the various meta tags are available. - foreach ($this->tags as $tag) { - // Convert tag names to something more suitable for a function name. - $tag_name = str_replace(array('.', '-', ':'), '_', $tag); - - // Look for a custom method named "{$tag_name}_test_field_xpath", 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 = "{$tag_name}_test_field_xpath"; - if (method_exists($this, $method)) { - $xpath = $this->$method(); - } - else { - $xpath = "//input[@name='metatags[und][{$tag}][value]' and @type='text']"; - } - $this->assertFieldByXPath($xpath, NULL, format_string('The "%tag" tag field was found.', array('%tag' => $tag))); - } - } - - /** - * Confirm that each tag can be saved and that the output of each tag is - * correct. - */ - function testTagsInputOutput() { - // Load the global config. - $this->drupalGet('admin/config/search/metatags/config/global'); - $this->assertResponse(200); - - // Update the Global defaults and test them. - $all_values = $values = array(); - foreach ($this->tags as $tag_raw) { - // Convert tag names to something more suitable for a function name. - $tag_name = str_replace(array('.', '-', ':', ' '), '_', $tag_raw); - - // Look for a custom method named "{$tag_name}_test_key", if found use - // that method to get the test string for this meta tag, otherwise it - // defaults to the meta tag's name. - $method = "{$tag_name}_test_key"; - if (method_exists($this, $method)) { - $test_key = $this->$method(); - } - else { - $test_key = "metatags[und][{$tag_raw}][value]"; - } - - // Look for a custom method named "{$tag_name}_test_value", if found use - // that method to get the test string for this meta tag, otherwise it - // defaults to just generating a random string. - $method = "{$tag_name}_test_value"; - if (method_exists($this, $method)) { - $test_value = $this->$method(); - } - else { - // Generate a random string. - $test_value = $this->getTestTagValue(); - } - - $values[$test_key] = $test_value; - - // Look for a custom method named "{$tag_name}_test_preprocess_output", if - // found use that method provide any additional processing on the value - // e.g. adding a prefix. - $method = "{$tag_name}_test_preprocess_output"; - if (method_exists($this, $method)) { - $test_value = $this->$method($test_value); - } - - $all_values[$tag_name] = $test_value; - } - $this->drupalPost(NULL, $values, 'Save'); - $this->assertText(strip_tags(t('The meta tag defaults for @label have been saved.', array('@label' => 'Global')))); - - // Load the test page. - $this->drupalGet('moosqueakoinkmeow'); - $this->assertResponse(200); - $this->assertText(t('Test page.')); - - // Look for the values. - foreach ($this->tags as $tag_raw) { - // Convert tag names to something more suitable for a function name. - $tag_name = str_replace(array('.', '-', ':', ' '), '_', $tag_raw); - - // Verify this meta tag was output. - $this->assertTrue(!empty($all_values[$tag_name])); - - // Look for a custom method named "{$tag_name}_test_output_xpath", 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: - // <$test_tag $test_name_attribute=$tag_name $test_value_attribute=$value /> - $method = "{$tag_name}_test_output_xpath"; - if (method_exists($this, $method)) { - $xpath_string = $this->$method(); - } - else { - // Look for a custom method named "{$tag_name}_test_tag", if - // found use that method to get the xpath definition for this meta tag, - // otherwise it defaults to $this->test_tag. - $method = "{$tag_name}_test_tag"; - if (method_exists($this, $method)) { - $xpath_tag = $this->$method(); - } - else { - $xpath_tag = $this->test_tag; - } - - // Look for a custom method named "{$tag_name}_test_name_attribute", if - // found use that method to get the xpath definition for this meta tag, - // otherwise it defaults to $this->test_name_attribute. - $method = "{$tag_name}_test_name_attribute"; - if (method_exists($this, $method)) { - $xpath_name_attribute = $this->$method(); - } - else { - $xpath_name_attribute = $this->test_name_attribute; - } - - // Look for a custom method named "{$tag_name}_test_tag_name", if - // found use that method to get the xpath definition for this meta tag, - // otherwise it defaults to $tag_name. - $method = "{$tag_name}_test_tag_name"; - 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}']"; - } - - // Something should have been found. - $this->assertTrue(!empty($xpath_string)); - - // Look for a custom method named "{$tag_name}_test_value_attribute", if - // found use that method to get the xpath definition for this meta tag, - // otherwise it defaults to $this->test_value_attribute. - $method = "{$tag_name}_test_value_attribute"; - if (method_exists($this, $method)) { - $xpath_value_attribute = $this->$method(); - } - else { - $xpath_value_attribute = $this->test_value_attribute; - } - - // Extract the meta tag from the HTML. - $xpath = $this->xpath($xpath_string); - $this->assertEqual(count($xpath), 1, format_string('One @name tag found.', array('@name' => $tag_name))); - - // 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."); - } - } - } - - /** - * 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. - */ - public 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. - */ - public function getTestTagValue() { - return $this->randomMachineName() . ' ' . $this->randomMachineName(); - } - - /** - * Generate a URL for an image. - * - * @return string - * An absolute URL to a non-existant image. - */ - public function randomImageUrl() { - return 'http://www.example.com/images/' . $this->randomMachineName() . '.png'; - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTestBase.test b/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTestBase.test deleted file mode 100644 index 5c3b89da48..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/MetatagTestBase.test +++ /dev/null @@ -1,772 +0,0 @@ -\n" . print_r($message, TRUE) . "\n\n"; - } - - // Optional title to go before the output. - if (!empty($title)) { - $title = '

' . check_plain($title) . "

\n"; - } - - parent::verbose($title . $message); - } - - /** - * Load the Performance admin page and clear all caches. - */ - public function clearAllCaches() { - $this->drupalGet('admin/config/development/performance'); - $this->assertResponse(200); - $this->assertText(t('Performance')); - $this->assertText(t('Clear cache')); - $this->drupalPost(NULL, array(), t('Clear all caches')); - $this->assertResponse(200); - $this->assertText(t('Caches cleared')); - } - - /** - * Create a content type for the tests. - */ - function createContentType($machine_name, $label) { - // Create a content type. - $content_type = $this->drupalCreateContentType(array( - 'type' => $machine_name, - 'name' => $label, - )); - - // Enable meta tags for this new content type. - metatag_entity_type_enable('node', $machine_name, TRUE); - - return $content_type; - } - - /** - * Create an admin user for the tests. - * - * @param array $extra_permissions - * An array of permission strings to be added to the user. - * - * @return object - * A user object. - */ - function createAdminUser($extra_permissions = array()) { - $permissions = array( - // Basic permissions for the module. - 'administer meta tags', - 'edit meta tags', - - // General admin access. - 'access administration pages', - ); - - // Reset the static variable used to identify permissions, otherwise it's - // possible the permissions check in drupalCreateUser will fail. - $this->checkPermissions(array(), TRUE); - cache_clear_all(); - - return $this->drupalCreateUser(array_merge($permissions, $extra_permissions)); - } - - /** - * Create a normal user for the tests. - * - * @param array $extra_permissions - * An array of permission strings to be added to the user. - * - * @return object - * A user object. - */ - function createUser($extra_permissions) { - // Basic permissions for the module. - $permissions = array( - 'edit meta tags', - ); - - // Reset the static variable used to identify permissions, otherwise it's - // possible the permissions check in drupalCreateUser will fail. - $this->checkPermissions(array(), TRUE); - cache_clear_all(); - - return $this->drupalCreateUser(array_merge($permissions, $extra_permissions)); - } - - /** - * Returns a new vocabulary with random properties. - * - * @param $vocab_name - * If empty a random string will be used. - * @param $content_type - * Any content types listed will have a Taxonomy Term reference field added - * that points to the new vocabulary. - * - * @return object - * A vocabulary object. - */ - function createVocabulary($vocab_name = NULL, $content_type = NULL) { - if (empty($vocab_name)) { - $vocab_name = $this->randomName(); - } - - // Create a vocabulary. - $vocabulary = new stdClass(); - $vocabulary->name = $vocab_name; - $vocabulary->description = $vocab_name; - $vocabulary->machine_name = drupal_strtolower($vocab_name); - $vocabulary->help = ''; - $vocabulary->weight = mt_rand(0, 10); - if (!empty($content_type)) { - $vocabulary->nodes = array($content_type => $content_type); - } - taxonomy_vocabulary_save($vocabulary); - - // Enable meta tags for this new vocabulary. - metatag_entity_type_enable('taxonomy_term', $vocab_name, TRUE); - - return $vocabulary; - } - - /** - * Returns a new taxonomy term in a specific vocabulary. - * - * @param object $vocabulary - * The vocabulary to add the term to. - * @param string $term_name - * The name to use for the new vocabulary. If none is provided one will be - * generated randomly. - * - * @return object - * A taxonomy term object. - */ - function createTerm($vocabulary, $term_name = NULL) { - if (empty($term_name)) { - $term_name = $this->randomName(); - } - - // Create an object to save. - $term = new stdClass(); - $term->name = $term_name; - $term->description = $term_name; - // Use the first available text format. - $term->format = db_query_range('SELECT format FROM {filter_format}', 0, 1)->fetchField(); - $term->vid = $vocabulary->vid; - - // Save the term. - taxonomy_term_save($term); - - return $term; - } - - /** - * Return an list of default values. - * - * This should cover all of the default meta tags provided for a test:foo - * entity. - * - * @todo Expand to cover more meta tags. - * - * @see metatag_test_metatag_config_default() - */ - function getTestDefaults() { - return array( - // Basic meta tags. - 'title' => array('value' => 'Test altered title'), - 'description' => array('value' => 'Test foo description'), - 'abstract' => array('value' => 'Test foo abstract'), - // 'keywords' => array('value' => ''), - // Advanced meta tags. - // 'robots' => array('value' => ''), - // 'news_keywords' => array('value' => ''), - // 'standout' => array('value' => ''), - // 'robots' => array('value' => ''), - // 'standout' => array('value' => ''), - 'generator' => array('value' => 'Drupal 7 (https://www.drupal.org)'), - // 'standout' => array('value' => ''), - // 'image_src' => array('value' => ''), - 'canonical' => array('value' => '[current-page:url:absolute]'), - 'shortlink' => array('value' => '[current-page:url:unaliased]'), - // 'publisher' => array('value' => ''), - // 'author' => array('value' => ''), - // 'original-source' => array('value' => ''), - // 'revisit-after' => array('value' => ''), - // 'content-language' => array('value' => ''),' - ); - } - - /** - * Add a locale to the site. - * - * This assumes the Locale module is enabled. - */ - public function addSiteLanguage($langcode) { - // Load the language-add page. - $this->drupalGet('admin/config/regional/language/add'); - $this->assertResponse(200, 'Loaded the language-add admin page.'); - - // Submit the language-add form. - $args = array( - 'langcode' => $langcode, - ); - $this->drupalPost(NULL, $args, t('Add language')); - $this->assertResponse(200); - - // Verify that the browser was returned to the main languages admin page. - $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Redirected back to the main languages admin page.'); - - // Clear the language list cache so it can be reloaded. - drupal_static_reset('language_list'); - - // Get all language definitions. - $languages = language_list(); - $language = $languages[$langcode]->name; - $this->assertText(strip_tags(t('The language %language has been created and can now be used. More information is available on the help screen.', array('%language' => t($language), '@locale-help' => url('admin/help/locale')))), 'A new language has been added.'); - } - - /** - * Set up a basic starting point for the locales. - * - * This assumes the Locale module is enabled. This also must be done before - * other user accounts are logged in. - * - * @param array $locales - * A list of locales to be enabled, in langcode format. - */ - public function setupLocales(array $locales = array()) { - // If no locales were requested, add Spanish and French. - if (empty($locales)) { - $locales[] = 'es'; - $locales[] = 'fr'; - } - - // Log in as an admin user with privs to just set up the locales. - $perms = array( - 'administer languages', - 'translate interface', - 'access administration pages', - ); - $admin_user = $this->drupalCreateUser($perms); - $this->drupalLogin($admin_user); - - // Load the admin page, just to have a point of reference. - $this->drupalGet('admin'); - $this->assertResponse(200, 'Loaded the main admin page.'); - - // Identify the site's default language. - $default_language = language_default('language'); - - // Add the locales. - foreach ($locales as $langcode) { - // Don't create the default language, it's already present. - if ($langcode != $default_language) { - $this->addSiteLanguage($langcode); - } - } - - // Enable URL language detection and selection. - $this->drupalGet('admin/config/regional/language/configure'); - $this->assertResponse(200); - $edit = array( - 'language[enabled][locale-url]' => TRUE, - ); - // Also enable path handling for Entity Translation if it is installed. - if (module_exists('entity_translation')) { - $edit['language_content[enabled][locale-url]'] = TRUE; - } - $this->drupalPost(NULL, $edit, t('Save settings')); - $this->assertResponse(200); - - // Once all the setup is done, log out the user. - $this->drupalLogout(); - } - - /** - * Get the {locales_source} lid value for a specific context. - * - * @param string $context - * The context string to search for. - * @param string $textgroup - * This string's textgroup; defaults to 'metatag'. - * - * @return integer - * The {locales_source}.lid value for this string. - */ - function getTranslationLidByContext($context, $textgroup = 'metatag') { - // Extra debug output. - $this->debugLocalesSourcesByContext($context); - - // Look for the string that's actually being requested. - return (int) db_query("SELECT lid - FROM {locales_source} - WHERE textgroup = :textgroup - AND context = :context", - array( - ':textgroup' => $textgroup, - ':context' => $context, - )) - ->fetchField(); - } - - /** - * Get the {locales_source} lid value for a specific source. - * - * @param string $string - * The translation string to search for. - * @param string $textgroup - * This string's textgroup; defaults to 'metatag'. - * - * @return integer - * The {locales_source}.lid value for this string. - */ - function getTranslationLidBySource($string, $textgroup = 'metatag') { - // Extra debug output. - $this->debugLocalesSourcesByContext('', $textgroup); - - // Look for the string that's actually being requested. - return (int) db_query("SELECT lid - FROM {locales_source} - WHERE textgroup = :textgroup - AND source = :source", - array( - ':textgroup' => $textgroup, - ':source' => $string, - )) - ->fetchField(); - } - - /** - * Get the {locales_source} lid values for a specific context. - * - * @param string $context - * The context string to search for. - * @param string $textgroup - * This string's textgroup; defaults to 'metatag'. - * - * @return integer - * The {locales_source}.lid value for this string. - */ - function getTranslationsByContext($context, $textgroup = 'metatag') { - return db_query("SELECT lid - FROM {locales_source} - WHERE textgroup = :textgroup - AND context = :context", - array( - ':textgroup' => $textgroup, - ':context' => $context, - )) - ->fetchCol(); - } - - /** - * Generate a debug dump of the {locales_source} records for a specific context. - * - * @param string $context - * The translation context to search against. - * @param string $textgroup - * This string's textgroup; defaults to 'metatag'. - */ - function debugLocalesSourcesByContext($context, $textgroup = 'metatag') { - // Get a dump of all i18n strings for Metatag. - $records = db_query("SELECT lid, location, textgroup, source, context, version - FROM {locales_source} - WHERE textgroup = :textgroup", - array( - ':textgroup' => $textgroup, - )) - ->fetchAllAssoc('lid'); - foreach ($records as $key => $record) { - $records[$key] = (array) $record; - } - $args = array( - 'caption' => 'i18n source check for . ' . $context, - 'header' => array( - 'lid', - 'location', - 'textgroup', - 'source', - 'context', - 'version', - ), - 'rows' => $records, - ); - $this->verbose(theme('table', $args)); - } - - /** - * Save a {locales_target} translation string to the database. - * - * @param int $lid - * The {locales_source}.lid primary key. - * @param string $context - * The {locales_source}.context value for this string. - * @param string $langcode - * The language the string is being translated into. - * @param string $string_source - * The string that is being translated. - * @param string $string_target - * The destination string. - */ - function saveTranslationString($lid, $context, $langcode, $string_source, $string_target) { - // Load the translation page for the front page's title tag. - $this->drupalGet('admin/config/regional/translate/edit/' . $lid); - $this->assertResponse(200, 'Loaded the front page title tag string translation page.'); - $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/edit/' . $lid, array('absolute' => TRUE))); - - // Confirm that the permission-check text is not found. - $this->assertNoText(t('This is a user-defined string. You are not allowed to translate these strings.')); - - // Look for the existing string. The string gets mungled by the Locale - // module, so need to replicate its behaviour. - $this->assertText(check_plain(wordwrap($string_source, 0))); - - // Look for the context value; the context value is empty for all default - // i.e. interface strings, so don't test this when the context is empty. - if (!empty($context)) { - $this->assertText($context); - } - - // Confirm that the destination strings exist. - $source_locale = language_default('language'); - if (function_exists('i18n_string_source_language')) { - $source_locale = i18n_string_source_language(); - } - if ($source_locale != 'en') { - $this->assertField('translations[en]', 'Found the English translation string field.'); - } - if ($source_locale != 'fr') { - $this->assertField('translations[fr]', 'Found the French translation string field.'); - } - if ($source_locale != 'es') { - $this->assertField('translations[es]', 'Found the Spanish translation string field.'); - } - - // Translate the string. - $edit = array( - "translations[{$langcode}]" => $string_target, - ); - $this->drupalPost(NULL, $edit, t('Save translations')); - $this->assertResponse(200); - - // Confirm the save worked. - $this->assertText(t('The string has been saved.')); - $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE))); - - // Debug output. - $this->debugLocalesTargetsByContext($context); - - // Clear the Metatag caches. - metatag_flush_caches(); - } - - /** - * Generate a debug dump of the {locales_target} records for a specific context. - * - * @param string $context - * The translation context to search against. - */ - function debugLocalesTargetsByContext($context) { - // , lt.i18n_status - $records = db_query("SELECT lt.lid, lt.translation, lt.language, lt.plid, lt.plural - FROM {locales_target} lt - INNER JOIN {locales_source} ls - ON lt.lid = ls.lid - WHERE ls.textgroup = 'metatag' - AND ls.context = :context", - array(':context' => $context)) - ->fetchAllAssoc('lid'); - foreach ($records as $key => $record) { - $records[$key] = (array) $record; - } - $args = array( - 'caption' => 'Locale target check for . ' . $context, - 'header' => array( - 'lid', - 'translation', - 'language', - 'plid', - 'plural', - // 'i18n_status', - ), - 'rows' => $records, - ); - $this->verbose(theme('table', $args)); - } - - /** - * Creates an object which can be used for generating and checking behavior. - * - * @param string $identifier - * The machine name to identify this object in source code. - * @param string $path - * Path where generate metatags. - * - * @return object - * A mapping object. - */ - function createTestObject($identifier, $path) { - $test_object = new stdClass(); - $test_object->name = $identifier; - $test_object->path = $path; - $test_object->title = "My $identifier title"; - $test_object->description = "My $identifier description"; - $test_object->abstract = "My $identifier abstract"; - $test_object->keywords = "My $identifier keywords"; - - return $test_object; - } - - /** - * Generates meta tags by path from a test_object. - * - * @return $test_object - * Metatag mapping object. - */ - function generateByPathConfig($test_object) { - // Verify the "add context" page works. - $this->drupalGet('admin/config/search/metatags/context'); - $this->assertResponse(200); - $this->assertText(t('Add a meta tag by path')); - - // Verify the "add context" page works. - $this->drupalGet('admin/config/search/metatags/context/add'); - $this->assertResponse(200); - $this->assertText(t('The unique ID for this metatag path context rule. This must contain only lower case letters, numbers and underscores.')); - - // Add new Metatag object for this configuration. - $values = array( - 'name' => $test_object->name, - ); - - $this->drupalPost('admin/config/search/metatags/context/add', $values, t('Add and configure')); - $this->assertResponse(200); - } - - /** - * Edits meta tags by path from a test_object. - * - * @return $test_object - * Metatag mapping object. - */ - function editByPathConfig($test_object) { - $edit = array( - 'paths' => $test_object->path, - 'metatags[und][title][value]' => $test_object->title, - 'metatags[und][description][value]' => $test_object->description, - 'metatags[und][abstract][value]' => $test_object->abstract, - 'metatags[und][keywords][value]' => $test_object->keywords, - ); - $this->drupalPost('admin/config/search/metatags/context/' . $test_object->name, $edit, t('Save')); - $this->assertResponse(200); - } - - /** - * Checks if meta tags have been added correctly from a test_object. - * - * @return $test_object - * Metatag mapping object. - */ - function checkByPathConfig($test_object) { - $this->drupalGet($test_object->path); - $this->assertResponse(200); - - // Manually test the page title. - if (!empty($test_object->title)) { - $this->assertTitle($test_object->title, 'Title found in ' . $test_object->path); - } - - // Test the other meta tags. - $tags = array('description', 'abstract', 'keywords'); - foreach ($tags as $tag) { - if (!empty($test_object->{$tag})) { - $this->assertRaw($test_object->{$tag}, $tag . ' found in ' . $test_object->path); - } - else { - $this->assertNoRaw('assertTrue($count >= 1, 'Found Metatag strings to translate.'); - $this->assertNoText(t('No strings available.')); - $xpath = $this->xpath("//body//div[@class='content']//table//tbody//tr"); - $this->verbose("Found {$count} items to translate."); - if (!empty($string)) { - $this->assertText($context); - $this->assertText('metatag:' . $context); - } - } - // If the string is not supposed to be found, then confirm the context is - // not available. - else { - $this->assertNoText($context); - $this->assertNoText('metatag:' . $context); - } - } - - /** - * Create an image of a specific size & type. - * - * @param string $image_size - * The size of the requested image in 'XxY' format; defaults to '200x200'. - * @param string $format - * The image format to use, defaults to 'png'. - * - * @return string - * The URL to a public file. - */ - function generateImage($image_size = '200x200', $format = 'png') { - // Only proceed if the Devel Generate module is installed. - if (module_exists('devel_generate')) { - // Load the Devel Generate image generator logic. - module_load_include('inc', 'devel_generate', 'image.devel_generate'); - - $image_format = 'png'; - $image_size = '200x200'; - $temp_image = devel_generate_image($image_format, $image_size, $image_size); - - return file_unmanaged_move($temp_image, 'public://'); - } - else { - $this->error('The Devel Generate module is not enabled, it must be added to the $modules array in the setUp() method for this test class.'); - } - } - - /** - * Create an image file object of a specific size & type. - * - * @param string - * The size of the requested image in 'XxY' format; defaults to '200x200'. - * @param string - * The image format to use, defaults to 'png'. - * - * @return object - * The file object for the generated image. - */ - function generateImageFile($image_size = '200x200', $format = 'png') { - // Generate a test image. - $image_uri = $this->generateImage(); - - // Create a file object for this image. - $file = new StdClass(); - $file->fid = NULL; - $file->uid = 1; - $file->uri = $image_uri; - $file->filemime = file_get_mimetype($image_uri); - $file->filesize = filesize($image_uri); - $file->status = 1; - $file->timestamp = filemtime($image_uri); - $saved_file = file_save($file); - - return $saved_file; - } - - /** - * Verify a user entity's meta tags load correctly. - * - * @param object $user - * A user object that is to be tested. - */ - function assertUserEntityTags($user) { - // Load the user's profile page. - $this->drupalGet('user/' . $user->uid); - $this->assertResponse(200); - - // Verify the title is using the custom default for this vocabulary. - $xpath = $this->xpath("//meta[@name='abstract']"); - $this->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.'); - $this->assertEqual($xpath[0]['content'], $user->name . " ponies"); - } - - /** - * Generate a string that is allowable as a machine name. - * - * @param int $length - * How long the machine name will be, defaults to eight characters. - * - * @return string - * A string that contains lowercase letters and numbers, with a letter as - * the first character. - */ - function randomMachineName($length = 8) { - return strtolower($this->randomName($length)); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.info b/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.info deleted file mode 100644 index 580901aeb4..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.info +++ /dev/null @@ -1,15 +0,0 @@ -name = Metatag Search API test -description = "Test module for the Metatag Search API integration." -core = 7.x -package = Metatag - -dependencies[] = metatag:metatag -dependencies[] = search_api:search_api - -hidden = TRUE - -; Information added by Drupal.org packaging script on 2020-02-10 -version = "7.x-1.27" -core = "7.x" -project = "metatag" -datestamp = "1581369088" diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.module b/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.module deleted file mode 100644 index bed7ddac10..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_search_test.module +++ /dev/null @@ -1,48 +0,0 @@ - 'metatag_search_test_service', - 'description' => 'metatag_search_test_service description', - 'class' => 'MetatagSearchTestSearchApiService', - ); - return $services; -} - -/** - * Dummy Search API service class. - */ -class MetatagSearchTestSearchApiService extends SearchApiAbstractService { - - /** - * @inheritdoc - */ - public function indexItems(SearchApiIndex $index, array $items) { - variable_set('metatag_search_test_keywords', FALSE); - foreach (array_values($items) as $item) { - if (isset($item['metatag_keywords']['value'])) { - variable_set('metatag_search_test_keywords', $item['metatag_keywords']['value']); - } - } - return array_keys($items); - } - - /** - * @inheritdoc - */ - public function deleteItems($ids = 'all', SearchApiIndex $index = NULL) {} - - /** - * @inheritdoc - */ - public function search(SearchApiQueryInterface $query) {} - -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.info b/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.info deleted file mode 100644 index 7f2bdf1033..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.info +++ /dev/null @@ -1,14 +0,0 @@ -name = Meta Tag Test -description = Helper module for testing metatag.module. -core = 7.x - -; Don't show this on the modules admin page. -hidden = TRUE - -dependencies[] = metatag:metatag - -; Information added by Drupal.org packaging script on 2020-02-10 -version = "7.x-1.27" -core = "7.x" -project = "metatag" -datestamp = "1581369088" diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.metatag.inc b/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.metatag.inc deleted file mode 100644 index f026d1e9d8..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.metatag.inc +++ /dev/null @@ -1,70 +0,0 @@ -instance = 'test'; - $config->api_version = 1; - $config->disabled = FALSE; - $config->config = array( - 'description' => array('value' => 'Test description'), - ); - $configs[$config->instance] = $config; - - $config = new stdClass(); - $config->instance = 'test:foo'; - $config->api_version = 1; - $config->disabled = FALSE; - $config->config = array( - 'title' => array('value' => 'Test title'), - 'abstract' => array('value' => 'Test foo abstract'), - 'description' => array('value' => 'Test foo description'), - 'test:foo' => array('value' => 'foobar'), - ); - $configs[$config->instance] = $config; - - return $configs; -} - -/** - * Implements hook_metatag_config_default_alter(). - */ -function metatag_test_metatag_config_default_alter(array &$configs) { - if (isset($configs['test:foo'])) { - $configs['test:foo']->config['title']['value'] = 'Test altered title'; - } -} - -/** - * Implements hook_metatag_info(). - */ -function metatag_test_metatag_info() { - $info['groups']['testing'] = array( - 'label' => t('Testing'), - 'form' => array( - '#weight' => 100, - ), - ); - - $info['test:foo'] = array( - 'label' => t('Foo meta tag'), - 'description' => t('Testing metatag.'), - 'class' => 'DrupalTextMetaTag', - 'group' => 'testing', - ); - - return $info; -} diff --git a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.module b/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.module deleted file mode 100644 index 53b7dc19cc..0000000000 --- a/source/webapp/sites/all/modules/contrib/metatag/tests/metatag_test.module +++ /dev/null @@ -1,73 +0,0 @@ - 1); - } -} - -/** - * Implements hook_menu(). - * - * Provides simple pages to test against. - */ -function metatag_test_menu() { - $string = 'moosqueakoinkmeow'; - $defaults = array( - 'page callback' => 'metatag_test_page_callback', - 'access callback' => TRUE, - 'type' => MENU_NORMAL_ITEM, - ); - - $items[$string] = array( - 'title' => 'Test page', - 'description' => 'An average page.', - ) + $defaults; - - // 255 / 19 chars = 13. - $long_path = implode('/', array_pad(array(), 13, $string)); - $items[$long_path . '/%'] = array( - 'title' => 'Test page with really long URL', - 'description' => 'The URL is really, really, really long.', - 'page arguments' => array(13), - ) + $defaults; - - // User-specific meta tags. - $items['account-test-page'] = array( - 'title' => 'User test page', - 'description' => 'Test how user tokens are handled.', - 'page callback' => 'metatag_test_user_page_callback', - ) + $defaults; - - return $items; -} - -/** - * Simple page callback for test pages. - */ -function metatag_test_page_callback() { - return t('Test page.'); -} - -/** - * Simple page callback for the user test page. - */ -function metatag_test_user_page_callback() { - global $user; - - $username = 'Anonymous visitor'; - if (isset($user->name)) { - $username = $user->name; - } - drupal_set_title('Hello ' . $username); - - return t('Test page for user tokens.'); -} diff --git a/source/webapp/sites/all/modules/contrib/site_verify/LICENSE.txt b/source/webapp/sites/all/modules/contrib/site_verify/LICENSE.txt deleted file mode 100644 index d159169d10..0000000000 --- a/source/webapp/sites/all/modules/contrib/site_verify/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/source/webapp/sites/all/modules/contrib/site_verify/site_verify.admin.inc b/source/webapp/sites/all/modules/contrib/site_verify/site_verify.admin.inc deleted file mode 100644 index 24043937bd..0000000000 --- a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.admin.inc +++ /dev/null @@ -1,323 +0,0 @@ - t('Engine'), 'field' => 'engine'), - array('data' => t('Meta tag'), 'field' => 'meta'), - array('data' => t('File'), 'field' => 'file'), - array('data' => t('Operations')), - ); - - $query = db_select('site_verify'); - $query->fields('site_verify'); - $query->extend('TableSort')->orderByHeader($header); - //$query->extend('PagerDefault')->limit(50); - $verifications = $query->execute(); - - $rows = array(); - foreach ($verifications as $verification) { - $row = array('data' => array()); - $row['data'][] = $engines[$verification->engine]['name']; - $row['data'][] = $verification->meta ? '' . t('Yes') . '' : t('No'); - $row['data'][] = $verification->file ? l($verification->file, $verification->file) : t('None'); - $operations = array(); - $operations['edit'] = array( - 'title' => t('Edit'), - 'href' => "admin/config/search/verifications/{$verification->svid}/edit", - 'query' => $destination, - ); - $operations['delete'] = array( - 'title' => t('Delete'), - 'href' => "admin/config/search/verifications/{$verification->svid}/delete", - 'query' => $destination, - ); - $row['data']['operations'] = array( - 'data' => array( - '#theme' => 'links', - '#links' => $operations, - '#attributes' => array('class' => array('links', 'inline')), - ), - ); - $rows[] = $row; - } - - $build['verification_tabe'] = array( - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => t('No verifications available. Add verification.', array('@add' => url('admin/config/search/verifications/add'))), - ); - //$build['verification_pager'] = array('#theme' => 'pager'); - return $build; -} - -/** - * Form to add/edit a verification record. - * - * Step 1: Choose ENGINE (Bing, Google, etc). - * Step 2: Enter verification details (meta-tag or verification file). - */ -function site_verify_edit_form($form, &$form_state, $record = array(), $engine = NULL) { - if (!isset($form_state['storage']['step'])) { - // Add default placeholders. - $record += array( - 'svid' => NULL, - 'file' => '', - 'file_contents' => t('This is a verification page.'), - 'meta' => '', - 'engine' => $engine, - ); - $form_state['storage']['record'] = $record; - $form_state['storage']['step'] = $record['engine'] ? 2 : 1; - } - else { - $record = $form_state['storage']['record']; - } - - $form['actions'] = array('#type' => 'actions'); - - switch ($form_state['storage']['step']) { - case 1: - // Build list of possible verification engines. - $engines = site_verify_get_engines(); - $options = array(); - foreach ($engines as $key => $engine) { - $options[$key] = $engine['name']; - } - asort($options); - - $form['engine'] = array( - '#type' => 'select', - '#title' => t('Search engine'), - '#options' => $options, - ); - $form['actions']['next'] = array( - '#type' => 'submit', - '#value' => t('Next'), - ); - break; - - case 2: - $form['svid'] = array( - '#type' => 'value', - '#value' => $record['svid'], - ); - $form['engine'] = array( - '#type' => 'value', - '#value' => $record['engine']['key'], - ); - $form['engine_name'] = array( - '#type' => 'item', - '#title' => t('Search engine'), - '#value' => $record['engine']['name'], - ); - $form['#engine'] = $record['engine']; - - $form['meta'] = array( - '#type' => 'textfield', - '#title' => t('Verification META tag'), - '#default_value' => $record['meta'], - '#description' => t('This is the full meta tag provided for verification. Note that this meta tag will only be visible in the source code of your front page.', array('@frontpage' => url(''))), - '#element_validate' => $record['engine']['meta_validate'], - '#access' => $record['engine']['meta'], - '#maxlength' => NULL, - ); - - //@TODO: display errror or lock form if upload exists, but user doesn't have perm - if (user_access('administer site verify uploads')) { - $form['file_upload'] = array( - '#type' => 'file', - '#title' => t('Upload an existing verification file'), - '#description' => t('If you have been provided with an actual file, you can simply upload the file.'), - '#access' => $record['engine']['file'], - ); - $form['file'] = array( - '#type' => 'textfield', - '#title' => t('Verification file'), - '#default_value' => $record['file'], - '#description' => t('The name of the HTML verification file you were asked to upload.'), - '#element_validate' => $record['engine']['file_validate'], - '#access' => $record['engine']['file'], - ); - $form['file_contents'] = array( - '#type' => 'textarea', - '#title' => t('Verification file contents'), - '#default_value' => $record['file_contents'], - '#element_validate' => $record['engine']['file_contents_validate'], - '#wysiwyg' => FALSE, - '#access' => $record['engine']['file_contents'], - ); - } - - // Add a warning message if Clean URLs is not available. - if (!variable_get('clean_url', 0)) { - drupal_set_message(t('Using verification files will not work if clean URLs are disabled.', array('@clean-urls' => url('admin/settings/clean-url'))), 'error', FALSE); - $form['file']['#disabled'] = TRUE; - $form['file_contents']['#disabled'] = TRUE; - $form['file_upload']['#disabled'] = TRUE; - } - - //@TODO: $record['engine']['file'] is always TRUE - if ($record['engine']['file']) { - $form['#attributes'] = array('enctype' => 'multipart/form-data'); - } - - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => t('Save'), - '#weight' => 10, - ); - break; - } - - $form['actions']['cancel'] = array( - '#type' => 'link', - '#href' => isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/verifications', - '#title' => t('Cancel'), - '#weight' => 15, - ); - - return $form; -} - -/** - * Validation callback; sanitize metatag and save the uploaded file - */ -function site_verify_edit_form_validate($form, &$form_state) { - if ($form_state['storage']['step']) { - // validate metatag - if (isset($form_state['values']['meta']) && $form_state['values']['meta']) { - $valid_metatag_set = FALSE; - - $html = $form_state['values']['meta']; - $dom = new DOMDocument; - $dom->loadHTML($html); - //@TODO: If we only care about the first metatag... why foreach? why not [0]? - foreach ($dom->getElementsByTagName('meta') as $tag) { - if ($tag->getAttribute('name') && $tag->getAttribute('content')) { - $form_state['values']['meta'] = ''; - $valid_metatag_set = TRUE; - } - } - - if (!$valid_metatag_set) { - form_set_error('meta', t('A valid metatag was not found')); - } - } - - // - if (isset($form_state['values']['file']) && $form_state['values']['file']) { - $values = &$form_state['values']; - // Import the uploaded verification file. - $validators = array('file_validate_extensions' => array()); - if ($file = file_save_upload('file_upload', $validators, FALSE, FILE_EXISTS_REPLACE)) { - $contents = @file_get_contents($file->uri); - file_delete($file); - if ($contents === FALSE) { - drupal_set_message(t('The verification file import failed, because the file %filename could not be read.', array('%filename' => $file->filename)), 'error'); - } - else { - $values['file'] = $file->filename; - $values['file_contents'] = $contents; - //drupal_set_message(t('The verification file @filename was successfully imported.', array('@filename' => $file->filename))); - } - } - - // Confirm that the desired filename isn't already in use by another - // verification. - if ($values['file']) { - $existing_file = db_query("SELECT svid FROM {site_verify} WHERE LOWER(file) = LOWER(:file) AND svid <> :svid", array(':file' => $values['file'], ':svid' => $values['svid']))->fetchField(); - if ($existing_file) { - form_set_error('file', t('The file %filename is already being used in another verification.', array('%filename' => $values['file']))); - } - } - } - else { - $form_state['values']['file_contents'] = NULL; - } - } - -} - -/** - * Submission callback; send form to the next step or save the verification. - */ -function site_verify_edit_form_submit($form, &$form_state) { - if ($form_state['storage']['step'] == 1) { - // Send the form to step 2 (verification details). - $form_state['storage']['record']['engine'] = site_verify_engine_load($form_state['values']['engine']); - $form_state['storage']['step']++; - $form_state['rebuild'] = TRUE; - } - else { - // Save the verification to the database. - if ($form_state['values']['svid']) { - drupal_write_record('site_verify', $form_state['values'], array('svid')); - } - else { - drupal_write_record('site_verify', $form_state['values']); - } - - drupal_set_message(t('Verification saved.')); - $form_state['storage'] = $form_state['rebuild'] = NULL; - $form_state['redirect'] = 'admin/config/search/verifications'; - - // Clear front page caches and set the menu to be rebuilt. - cache_clear_all(url('', array('absolute' => TRUE)), 'cache_page'); - cache_clear_all(url(variable_get('site_frontpage', 'node'), array('absolute' => TRUE)), 'cache_page'); - variable_set('menu_rebuild_needed', TRUE); - } -} - -/** - * Delete form: found at admin/config/search/verifications/xxx/delete - */ -function site_verify_delete_form($form, $form_state, $record) { - $form['record'] = array( - '#type' => 'value', - '#value' => $record, - ); - - return confirm_form( - $form, - t('Are you sure you want to delete the site verification for %engine?', array('%engine' => $record['engine']['name'])), - 'admin/config/search/verifications', - t('This action cannot be undone.'), - t('Delete'), - t('Cancel') - ); -} - -function site_verify_delete_form_submit($form, &$form_state) { - $record = $form_state['values']['record']; - db_delete('site_verify')->condition('svid', $record['svid'])->execute(); - drupal_set_message(t('Verification for %engine has been deleted.', array('%engine' => $record['engine']['name']))); - watchdog('site_verify', 'Verification for %engine deleted.', array('%engine' => $record['engine']['name']), WATCHDOG_NOTICE); - $form_state['redirect'] = 'admin/config/search/verifications'; - - // Clear front page caches and set the menu to be rebuilt. - cache_clear_all(url('', array('absolute' => TRUE)), 'cache_page'); - cache_clear_all(url(variable_get('site_frontpage', 'node'), array('absolute' => TRUE)), 'cache_page'); - variable_set('menu_rebuild_needed', TRUE); -} - - -/** - * Validate that the 'meta' property uses the correct pattern for Google. - */ -function site_verify_validate_meta_google($element, &$form_state) { - $value = strtolower(trim($element['#value'])); - if ($value != '' && !preg_match('%\A\Z%', $value)) { - form_error($element, t('Invalid verification meta tag.')); - } -} - -function site_verify_validate_page_google($element, &$form_state) { - $value = strtolower(trim($element['#value'])); - if ($value != '' && !preg_match('%\Agoogle[\da-f]+\.html\Z%', $value)) { - form_error($element, t('Invalid verification file.')); - } -} diff --git a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.api.php b/source/webapp/sites/all/modules/contrib/site_verify/site_verify.api.php deleted file mode 100644 index cb45084f0f..0000000000 --- a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.api.php +++ /dev/null @@ -1,44 +0,0 @@ - t('My search engine'), - 'page' => TRUE, - 'page_example' => 'myengine.html', - 'page_validate' => 'myengine_validate_page', - 'page_contents' => FALSE, - 'page_contents_validate' => FALSE, - 'meta' => TRUE, - 'meta_validate' => 'myengine_validate_meta', - ); - return $engines; -} - -/** - * Alter the list of supported search engines. - * - * @param $engines - * An array (passed by reference) of the list of engines, keyed by engine - * type. - */ -function hook_site_verify_engine_alter(&$engines) { - $engines['myengine']['meta'] = FALSE; -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.info b/source/webapp/sites/all/modules/contrib/site_verify/site_verify.info deleted file mode 100644 index 060667c772..0000000000 --- a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.info +++ /dev/null @@ -1,15 +0,0 @@ -name = Site Verification -description = "Verifies ownership of a site for use with search engines." -core = 7.x -files[] = site_verify.module -files[] = site_verify.admin.inc -files[] = site_verify.install -files[] = site_verify.test -configure = admin/config/search/verifications - -; Information added by Drupal.org packaging script on 2017-05-24 -version = "7.x-1.2" -core = "7.x" -project = "site_verify" -datestamp = "1495647186" - diff --git a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.install b/source/webapp/sites/all/modules/contrib/site_verify/site_verify.install deleted file mode 100644 index a1177d5d25..0000000000 --- a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.install +++ /dev/null @@ -1,130 +0,0 @@ - '', - 'fields' => array( - 'svid' => array( - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Primary Key: Unique site verification ID.', - ), - 'engine' => array( - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - 'default' => '', - 'description' => '', - ), - 'file' => array( - 'type' => 'varchar', - 'length' => 255, - 'default' => '', - 'description' => '', - ), - 'file_contents' => array( - 'type' => 'text', - 'not null' => TRUE, - 'size' => 'big', - 'description' => '', - ), - 'meta' => array( - 'type' => 'text', - 'not null' => TRUE, - 'description' => '', - ), - ), - 'primary key' => array('svid'), - 'indexes' => array( - 'engine' => array('engine'), - ), - ); - - return $schema; -} - -/** - * Implements hook_install(). - */ -function site_verify_install() { - // Import data from deprecated modules. - site_verify_import_xmlsitemap(); - site_verify_import_ghs(); -} - -/** - * Drop the unique key on file names. - */ -function site_verify_update_1() { - db_drop_unique_key('site_verify', 'file'); -} - -/** - * Update engine Live Search to Bing. - */ -function site_verify_update_2() { - db_update('site_verify') - ->fields(array( - 'engine' => 'bing', - )) - ->condition('engine', 'live_search') - ->execute(); -} - -/** - * Run imports from other contrib modules. - */ -function site_verify_update_3() { - site_verify_import_xmlsitemap(); - site_verify_import_ghs(); -} - -/** - * Import data from XML sitemap engines. - */ -function site_verify_import_xmlsitemap() { - $engines = array('google', 'bing', 'yahoo'); - foreach ($engines as $engine) { - if ($file = variable_get('xmlsitemap_engines_' . $engine . '_verify', '')) { - db_merge('site_verify') - ->key(array( - 'engine' => $engine, - 'file' => $file, - 'file_contents' => variable_get('xmlsitemap_engines_' . $engine . '_verify_string', ''), - 'meta' => '', - )) - ->execute(); - } - variable_del('xmlsitemap_engines_' . $engine . '_verify'); - variable_del('xmlsitemap_engines_' . $engine . '_verify_string'); - } -} - -/** - * Import data from Google Apps Verification. - */ -function site_verify_import_ghs() { - if ($google_content = variable_get('ghs_string_verify', '')) { - db_merge('site_verify') - ->key(array( - 'engine' => 'google', - 'file' => 'googlehostedservice.html', - )) - ->fields(array( - 'file_contents' => $google_content, - 'meta' => '', - )) - ->execute(); - } - variable_del('ghs_string_verify'); - module_disable(array('ghs')); -} diff --git a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.module b/source/webapp/sites/all/modules/contrib/site_verify/site_verify.module deleted file mode 100755 index aeac7f51ca..0000000000 --- a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.module +++ /dev/null @@ -1,218 +0,0 @@ - 'Verifications', - 'description' => 'Add, change or remove verifications for your site.', - 'page callback' => 'site_verify_list', - 'access arguments' => array('administer site verify'), - 'file' => 'site_verify.admin.inc', - ); - // Add a verification record. - $items['admin/config/search/verifications/add'] = array( - 'title' => 'Add verification', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('site_verify_edit_form'), - 'access arguments' => array('administer site verify'), - 'file' => 'site_verify.admin.inc', - 'type' => MENU_LOCAL_ACTION, - ); - $items['admin/config/search/verifications/add/%site_verify_engine'] = array( - 'title' => 'Add', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('site_verify_edit_form', array(), 5), - 'access arguments' => array('administer site verify'), - 'file' => 'site_verify.admin.inc', - ); - $items['admin/config/search/verifications/%site_verify/edit'] = array( - 'page callback' => 'drupal_get_form', - 'page arguments' => array('site_verify_edit_form', 4), - 'access arguments' => array('administer site verify'), - 'file' => 'site_verify.admin.inc', - ); - $items['admin/config/search/verifications/%site_verify/delete'] = array( - 'page callback' => 'drupal_get_form', - 'page arguments' => array('site_verify_delete_form', 4), - 'access arguments' => array('administer site verify'), - 'file' => 'site_verify.admin.inc', - ); - - // Add the verification paths. - $verifications = db_query("SELECT svid, file FROM {site_verify} WHERE file <> ''")->fetchAll(); - foreach ($verifications as $verification) { - $items[$verification->file] = array( - 'page callback' => 'site_verify_output', - 'page arguments' => array((string) $verification->svid), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - } - - return $items; -} - -/** - * - * Implements hook_permission(). - * -*/ -function site_verify_permission() { - return array( - 'administer site verify' => array( - 'title' => t('Administer site verification meta tags'), - 'description' => t('Administer search engine site ownership verification meta tags.'), - ), - 'administer site verify uploads' => array( - 'title' => t('Administer site verification uploads'), - 'description' => t('Administer search engine site ownership verification that requires file uploads.'), - 'restrict access' => TRUE, - ), - ); -} - -/** - * Implements hook_init(). - * - * @todo Move this to hook_html_head_alter()? - */ -function site_verify_init() { - // Add the verification meta tags to the front page. - if (drupal_is_front_page()) { - $meta_tags = db_query("SELECT svid, meta FROM {site_verify} WHERE meta <> ''")->fetchAllKeyed(); - foreach ($meta_tags as $svid => $meta_tag) { - $data = array( - '#type' => 'markup', - '#markup' => $meta_tag . "\n", - ); - drupal_add_html_head($data, 'site_verify:' . $svid); - } - } -} - -/** - * Menu load callback; loads a site verification record. - * - * This also loads the engine details if the record was found. - * - * @param $svid - * A site verification ID. - * @return - * An array of the site verification record, or FALSE if not found. - */ -function site_verify_load($svid) { - $record = db_query("SELECT svid, engine, file, file_contents, meta FROM {site_verify} WHERE svid = :svid", array(':svid' => $svid))->fetchAssoc(); - if ($record) { - $record['engine'] = site_verify_engine_load($record['engine']); - } - return $record; -} - -/** - * Menu load callback; loads engine details. - * - * @param $engine - * A string with the engine shortname. - * @return - * An arary of the engine details, or FALSE if not found. - */ -function site_verify_engine_load($engine) { - $engines = site_verify_get_engines(); - return isset($engines[$engine]) ? $engines[$engine] : FALSE; -} - -/** - * Implements hook_site_verify_engine_info(). - */ -function site_verify_site_verify_engine_info() { - $engines['google'] = array( - 'name' => t('Google'), - 'file' => TRUE, - 'file_contents' => TRUE, - 'file_example' => 'google1234567890abcdef.html', - 'meta' => TRUE, - 'meta_example' => '', - ); - $engines['yahoo'] = array( - 'name' => t('Yahoo!'), - 'file' => TRUE, - 'file_contents' => TRUE, - 'meta' => TRUE, - ); - $engines['bing'] = array( - 'name' => t('Bing'), - 'file' => TRUE, - 'file_contents' => TRUE, - 'meta' => TRUE, - ); - $engines['yandex'] = array( - 'name' => t('Yandex'), - 'file' => TRUE, - 'file_example' => 'yandex_b5741169901f6c20.txt', - 'meta' => TRUE, - 'meta_example' => '', - ); - $engines['custom'] = array( - 'name' => t('Custom verification'), - 'file' => TRUE, - 'file_contents' => TRUE, - 'meta' => TRUE, - ); - return $engines; -} - -/** - * Fetch an array of supported search engines. - */ -function site_verify_get_engines() { - static $engines; - - if (!isset($engines)) { - // Fetch the list of engines and allow other modules to alter it. - $engines = module_invoke_all('site_verify_engine_info'); - drupal_alter('site_verify_engine', $engines); - - // Merge the default values for each engine entry. - foreach ($engines as $key => $engine) { - $engines[$key] += array( - 'key' => $key, - //'name' => drupal_ucfirst($engine), - 'file' => FALSE, - 'file_example' => FALSE, - 'file_validate' => array(), - 'file_contents' => FALSE, - 'file_contents_example' => FALSE, - 'file_contents_validate' => array(), - 'meta' => FALSE, - 'meta_example' => FALSE, - 'meta_validate' => array(), - ); - } - } - - return $engines; -} - -/** - * Output the page contents for a file-based custom verification page. - */ -function site_verify_output($svid) { - $verification = site_verify_load($svid); - if ($verification['file_contents'] && $verification['engine']['file_contents']) { - echo $verification['file_contents']; - } - else { - drupal_set_title(t('Verification page')); - return t('This is a verification page for the @title search engine.', array('!title' => $verification['engine']['name'])); - } -} diff --git a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.test b/source/webapp/sites/all/modules/contrib/site_verify/site_verify.test deleted file mode 100644 index 6d891eaf95..0000000000 --- a/source/webapp/sites/all/modules/contrib/site_verify/site_verify.test +++ /dev/null @@ -1,49 +0,0 @@ - 'Site verification functional tests', - 'description' => 'Test site verification functionality.', - 'group' => 'Site verification', - ); - } - - function setUp() { - parent::setUp(array('site_verify')); - - $user = $this->drupalCreateUser(array('administer site configuration')); - $this->drupalLogin($user); - } - - function testMetaTag() { - $this->drupalGet('admin/config/search/verifications'); - $this->assertText('No verifications available.'); - $this->clickLink('Add verification'); - - // Add a dummy Google meta tag. - $edit = array('engine' => 'google'); - $this->drupalPost('admin/config/search/verifications/add', $edit, t('Next')); - $meta_tag = ''; - $edit = array('meta' => $meta_tag); - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertText('Verification saved.'); - $this->assertText('Google'); - - // Check if it displays on the front page. - $this->drupalGet(''); - $this->assertRaw($meta_tag, 'Verification code displayed on front page.'); - - // Now try to delete it. - $this->drupalGet('admin/config/search/verifications'); - $this->clickLink('Delete'); - $this->drupalPost(NULL, array(), t('Delete')); - $this->assertText('Verification for Google has been deleted.'); - $this->assertText('No verifications available.'); - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/LICENSE.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/LICENSE.txt deleted file mode 100644 index d159169d10..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/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/source/webapp/sites/all/modules/contrib/xmlsitemap/README.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/README.txt deleted file mode 100644 index 795c1bf1a2..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/README.txt +++ /dev/null @@ -1,111 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Requirements - * Installation - * Configuration - * Uninstalling - * Frequently Asked Questions (FAQ) - * Known Issues - * More Information - * How Can You Contribute? - * Maintainers - - -INTRODUCTION ------------- - -XML Sitemap automatically creates a sitemap that conforms to the sitemaps.org -specification. This helps search engines keep their search results up to date. - - -REQUIREMENTS ------------- - -No special requirements - - -INSTALLATION ------------- - -Install as you would normally install a contributed Drupal module. See: -https://drupal.org/documentation/install/modules-themes/modules-7 for further -information. - -Once XML Sitemap is installed and enabled, you can adjust the settings for your -site's sitemap at admin/config/search/xmlsitemap. Your can view your site's -sitemap at http://yoursite.com/sitemap.xml. - -It is highly recommended that you have clean URLs enabled for this project. - - -CONFIGURATION -------------- - - * Configure your XML sitemap in: - Configuration » Search and metadata »XML sitemap - - - Check your XML site - - Click in Update for update the XML values. - - -UNINSTALLING ------------- - -Because Drupal does not uninstall modules in reverse order of their -dependencies, if you want to uninstall all the XML sitemap modules, be sure to -disable and uninstall all the sub-modules before the base XML sitemap module. -To help fix this bug in Drupal core, visit https://www.drupal.org/node/151452. - - -FREQUENTLY ASKED QUESTIONS (FAQ) --------------------------------- - -- There are no frequently asked questions at this time. - - -KNOWN ISSUES ------------- - -- See https://www.drupal.org/node/482550 for a list of the current known issues. - - -MORE INFORMATION ----------------- - -- To issue any bug reports, feature or support requests, see the module issue - queue at https://www.drupal.org/project/issues/xmlsitemap. - -- For additional documentation, see the online module handbook at - https://www.drupal.org/handbook/modules/xmlsitemap. - -- You can view the sitemap.org specification at http://sitemaps.org. - - -HOW CAN YOU CONTRIBUTE? ------------------------ - -- Report any bugs, feature requests, etc. in the issue tracker. - https://www.drupal.org/project/issues/xmlsitemap - -- Help translate this module. - http://localize.drupal.org/translate/projects/xmlsitemap - -- Write a review for this module at drupalmodules.com. - http://drupalmodules.com/module/xml-sitemap - -- Help keep development active by dontating to the developer. - http://davereid.chipin.com/ - - -MAINTAINERS ------------ - -Current maintainers: - * Current Maintainer: Dave Reid - * Co-maintainer: Renato Gonçalves RenatoG - * Co-maintainer: Kiam - * Co-maintainer: Earnie - * Co-maintainer: Darren Oh - * Original Author: Matthew Loar diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.admin.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.admin.inc deleted file mode 100644 index e55549bdff..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.admin.inc +++ /dev/null @@ -1,913 +0,0 @@ - $operation_info) { - $operations[$operation] = $operation_info['label']; - } - asort($operations); - - $form['operations'] = array( - '#type' => 'fieldset', - '#title' => t('Update options'), - '#prefix' => '
', - '#suffix' => '
', - ); - $form['operations']['operation'] = array( - '#type' => 'select', - '#options' => $operations, - '#default_value' => 'update', - ); - $form['operations']['submit'] = array( - '#type' => 'submit', - '#value' => t('Update'), - ); - - $contexts = xmlsitemap_get_context_info(); - - $header = array(); - $header['url'] = array('data' => t('URL')); - foreach ($contexts as $context_key => $context_info) { - if (!empty($context_info['summary callback'])) { - $header['context_' . $context_key] = $context_info['label']; - } - } - $header['updated'] = array( - 'data' => t('Last updated'), - 'field' => 'updated', - 'sort' => 'asc', - ); - $header['links'] = array('data' => t('Links'), 'field' => 'links'); - $header['chunks'] = array('data' => t('Pages'), 'field' => 'chunks'); - $header['operations'] = array('data' => t('Operations')); - - $query = db_select('xmlsitemap_sitemap'); - $query->fields('xmlsitemap_sitemap', array('smid')); - $query->extend('TableSort')->orderByHeader($header); - $smids = $query->execute()->fetchCol(); - $sitemaps = $smids ? xmlsitemap_sitemap_load_multiple($smids) : array(); - - $options = array(); - foreach ($sitemaps as $smid => $sitemap) { - $sitemap->url = url($sitemap->uri['path'], $sitemap->uri['options']); - - $options[$smid]['url'] = array( - 'data' => array( - '#type' => 'link', - '#title' => $sitemap->url, - '#href' => $sitemap->url, - ), - ); - - foreach ($contexts as $context_key => $context_info) { - if (!empty($context_info['summary callback'])) { - $options[$smid]['context_' . $context_key] = _xmlsitemap_sitemap_context_summary($sitemap, $context_key, $context_info); - } - } - - $options[$smid]['updated'] = $sitemap->updated ? format_date($sitemap->updated, 'short') : t('Never'); - $options[$smid]['links'] = $sitemap->updated ? $sitemap->links : '-'; - $options[$smid]['chunks'] = $sitemap->updated ? $sitemap->chunks : '-'; - - // @todo Highlight sitemaps that need updating. - // $options[$smid]['#attributes']['class'][] = 'warning'; - $operations = array(); - $operations['edit'] = xmlsitemap_get_operation_link('admin/config/search/xmlsitemap/edit/' . $smid, array('title' => t('Edit'), 'modal' => TRUE)); - $operations['delete'] = xmlsitemap_get_operation_link('admin/config/search/xmlsitemap/delete/' . $smid, array('title' => t('Delete'), 'modal' => TRUE)); - if ($operations) { - $options[$smid]['operations'] = array( - 'data' => array( - '#theme' => 'links', - '#links' => $operations, - '#attributes' => array('class' => array('links', 'inline')), - ), - ); - } - else { - $options[$smid]['operations'] = t('None (sitemap locked)'); - } - } - - $form['sitemaps'] = array( - '#type' => 'tableselect', - '#header' => $header, - '#options' => $options, - '#empty' => t('No XML sitemaps available.') . ' ' . l(t('Add a new XML sitemap'), 'admin/config/search/xmlsitemap/add'), - ); - return $form; -} - -/** - * Validate xmlsitemap_sitemap_list_form submissions. - */ -function xmlsitemap_sitemap_list_form_validate($form, &$form_state) { - $form_state['values']['sitemaps'] = array_filter($form_state['values']['sitemaps']); - - // Error if there are no items to select. - if (!count($form_state['values']['sitemaps'])) { - form_set_error('', t('No sitemaps selected.')); - } -} - -/** - * Process xmlsitemap_sitemap_list_form submissions. - * - * Execute the chosen 'Update option' on the selected sitemaps. - */ -function xmlsitemap_sitemap_list_form_submit($form, &$form_state) { - $operation = $form['#operations'][$form_state['values']['operation']]; - - // Filter out unchecked sitemaps. - $sitemaps = array_filter($form_state['values']['sitemaps']); - - if (!empty($operation['confirm']) && empty($form_state['values']['confirm'])) { - // We need to rebuild the form to go to a second step. For example, to - // show the confirmation form for the deletion of redirects. - $form_state['rebuild'] = TRUE; - } - else { - $function = $operation['callback']; - - // Add in callback arguments if present. - if (isset($operation['callback arguments'])) { - $args = array_merge(array($sitemaps), $operation['callback arguments']); - } - else { - $args = array($sitemaps); - } - call_user_func_array($function, $args); - - $count = count($form_state['values']['sitemaps']); - drupal_set_message( - format_plural( - count($sitemaps), '@action @count XML sitemap.', '@action @count XML sitemaps.', - array('@action' => $operation['action past'], '@count' => $count) - ) - ); - } -} - -/** - * Edit Form. - */ -function xmlsitemap_sitemap_edit_form(array $form, array &$form_state, stdClass $sitemap = NULL) { - _xmlsitemap_set_breadcrumb(); - - if (!isset($sitemap)) { - $sitemap = new stdClass(); - $sitemap->smid = NULL; - $sitemap->context = array(); - } - - $form['#sitemap'] = $sitemap; - - $form['smid'] = array( - '#type' => 'value', - '#value' => $sitemap->smid, - ); - // The context settings should be form_alter'ed by the context modules. - $form['context'] = array( - '#tree' => TRUE, - ); - - $form['actions'] = array( - '#type' => 'actions', - ); - $form['actions']['save'] = array( - '#type' => 'submit', - '#value' => t('Save'), - ); - $form['actions']['cancel'] = array( - '#type' => 'link', - '#href' => isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/xmlsitemap', - '#title' => t('Cancel'), - ); - - // Let other modules alter this form with their context settings. - $form['#pre_render'][] = 'xmlsitemap_sitemap_edit_form_pre_render'; - - return $form; -} - -/** - * Edit Form Pre Render. - */ -function xmlsitemap_sitemap_edit_form_pre_render($form) { - $visible_children = element_get_visible_children($form['context']); - if (empty($visible_children)) { - $form['context']['empty'] = array( - '#type' => 'markup', - '#markup' => '

' . t('There are currently no XML sitemap contexts available.') . '

', - ); - } - return $form; -} - -/** - * Edit form validate. - */ -function xmlsitemap_sitemap_edit_form_validate($form, &$form_state) { - // If there are no context options, the $form_state['values']['context'] - // disappears. - $form_state['values'] += array('context' => array()); - $existing = xmlsitemap_sitemap_load_by_context($form_state['values']['context']); - if ($existing && $existing->smid != $form_state['values']['smid']) { - form_set_error('context', t('A sitemap with the same context already exists.')); - } -} - -/** - * Edit Form Submit. - */ -function xmlsitemap_sitemap_edit_form_submit($form, &$form_state) { - form_state_values_clean($form_state); - $sitemap = (object) $form_state['values']; - xmlsitemap_sitemap_save($sitemap); - drupal_set_message(t('The sitemap has been saved.')); - $form_state['redirect'] = 'admin/config/search/xmlsitemap'; -} - -/** - * Delete form. - */ -function xmlsitemap_sitemap_delete_form(array $form, array &$form_state, stdClass $sitemap) { - _xmlsitemap_set_breadcrumb(); - - $count = (int) db_query("SELECT COUNT(smid) FROM {xmlsitemap_sitemap}")->fetchField(); - if ($count === 1 && empty($_POST)) { - drupal_set_message(t('It is not recommended to delete the only XML sitemap.'), 'error'); - } - - $form['#sitemap'] = $sitemap; - $form['smid'] = array( - '#type' => 'value', - '#value' => $sitemap->smid, - ); - return confirm_form( - $form, - t('Are you sure you want to delete the XML sitemap?'), - 'admin/config/search/xmlsitemap', - '', - t('Delete'), - t('Cancel') - ); -} - -/** - * Delete form submit. - */ -function xmlsitemap_sitemap_delete_form_submit($form, $form_state) { - xmlsitemap_sitemap_delete($form_state['values']['smid']); - drupal_set_message(t('The sitemap has been deleted.')); - $form_state['redirect'] = 'admin/config/search/xmlsitemap'; -} - -/** - * Form builder; Administration settings form. - * - * @see system_settings_form() - * @see xmlsitemap_settings_form_validate() - */ -function xmlsitemap_settings_form($form, &$form_state) { - global $base_url; - $form['xmlsitemap_minimum_lifetime'] = array( - '#type' => 'select', - '#title' => t('Minimum sitemap lifetime'), - '#options' => array(0 => t('No minimum')) + drupal_map_assoc(array(300, - 900, - 1800, - 3600, - 10800, - 21600, - 43200, - 86400, - 172800, - 259200, - 604800, - ), 'format_interval'), - '#description' => t('The minimum amount of time that will elapse before the sitemaps are regenerated. The sitemaps will also only be regenerated on cron if any links have been added, updated, or deleted.') . '
' . t('Recommended value: %value.', array('%value' => t('1 day'))), - '#default_value' => variable_get('xmlsitemap_minimum_lifetime', 0), - ); - $form['xmlsitemap_xsl'] = array( - '#type' => 'checkbox', - '#title' => t('Include a stylesheet in the sitemaps for humans.'), - '#description' => t('When enabled, this will add formatting and tables with sorting to make it easier to view the XML sitemap data instead of viewing raw XML output. Search engines will ignore this.'), - '#default_value' => variable_get('xmlsitemap_xsl', 1), - ); - $form['xmlsitemap_prefetch_aliases'] = array( - '#type' => 'checkbox', - '#title' => t('Prefetch URL aliases during sitemap generation.'), - '#description' => t('When enabled, this will fetch all URL aliases at once instead of one at a time during sitemap generation. For medium or large sites, it is recommended to disable this feature as it uses a lot of memory.'), - '#default_value' => variable_get('xmlsitemap_prefetch_aliases', 1), - ); - - $form['advanced'] = array( - '#type' => 'fieldset', - '#title' => t('Advanced settings'), - '#collapsible' => TRUE, - '#collapsed' => !variable_get('xmlsitemap_developer_mode', 0), - '#weight' => 10, - ); - $form['advanced']['xmlsitemap_chunk_size'] = array( - '#type' => 'select', - '#title' => t('Number of links in each sitemap page'), - '#options' => array('auto' => t('Automatic (recommended)')) + drupal_map_assoc(array( - 100, - 500, - 1000, - 2500, - 5000, - 10000, - 25000, - XMLSITEMAP_MAX_SITEMAP_LINKS, - )), - '#default_value' => xmlsitemap_var('chunk_size'), - // @todo This description is not clear. - '#description' => t('If there are problems with rebuilding the sitemap, you may want to manually set this value. If you have more than @max links, an index with multiple sitemap pages will be generated. There is a maximum of @max sitemap pages.', array('@max' => XMLSITEMAP_MAX_SITEMAP_LINKS)), - ); - $form['advanced']['xmlsitemap_batch_limit'] = array( - '#type' => 'select', - '#title' => t('Maximum number of sitemap links to process at once'), - '#options' => drupal_map_assoc(array( - 5, - 10, - 25, - 50, - 100, - 250, - 500, - 1000, - 2500, - 5000, - )), - '#default_value' => xmlsitemap_var('batch_limit'), - '#description' => t('If you have problems running cron or rebuilding the sitemap, you may want to lower this value.'), - ); - if (!xmlsitemap_check_directory()) { - form_set_error('xmlsitemap_path', t('The directory %directory does not exist or is not writable.', array('%directory' => xmlsitemap_get_directory()))); - } - $form['advanced']['xmlsitemap_path'] = array( - '#type' => 'textfield', - '#title' => t('Sitemap cache directory'), - '#default_value' => variable_get('xmlsitemap_path', 'xmlsitemap'), - '#size' => 30, - '#maxlength' => 255, - '#description' => t('Subdirectory where the sitemap data will be stored. This folder must not be shared with any other Drupal site or install using XML sitemap.'), - '#field_prefix' => file_build_uri(''), - '#required' => TRUE, - ); - $form['advanced']['xmlsitemap_base_url'] = array( - '#type' => 'textfield', - '#title' => t('Default base URL'), - '#default_value' => variable_get('xmlsitemap_base_url', $base_url), - '#size' => 30, - '#description' => t('This is the default base URL used for sitemaps and sitemap links.'), - '#required' => TRUE, - ); - $form['advanced']['xmlsitemap_lastmod_format'] = array( - '#type' => 'select', - '#title' => t('Last modification date format'), - '#options' => array( - XMLSITEMAP_LASTMOD_SHORT => t('Short'), - XMLSITEMAP_LASTMOD_MEDIUM => t('Medium'), - XMLSITEMAP_LASTMOD_LONG => t('Long'), - ), - '#default_value' => variable_get('xmlsitemap_lastmod_format', XMLSITEMAP_LASTMOD_MEDIUM), - ); - foreach ($form['advanced']['xmlsitemap_lastmod_format']['#options'] as $key => &$label) { - $label .= ' (' . gmdate($key, REQUEST_TIME) . ')'; - } - $form['advanced']['xmlsitemap_developer_mode'] = array( - '#type' => 'checkbox', - '#title' => t('Enable developer mode to expose additional settings.'), - '#default_value' => variable_get('xmlsitemap_developer_mode', 0), - ); - $form['advanced']['xmlsitemap_disable_cron_regeneration'] = array( - '#type' => 'checkbox', - '#title' => t('Disable cron generation of sitemap files.'), - '#default_value' => variable_get('xmlsitemap_disable_cron_regeneration', 0), - '#description' => t('This can be disabled if other methods are being used to generate the sitemap files, like drush xmlsitemap-regenerate.'), - ); - $form['advanced']['xmlsitemap_output_elements'] = array( - '#type' => 'checkboxes', - '#title' => t('Enable or disable the individual @loc elements from output', array('@loc' => '')), - '#options' => array( - 'lastmod' => t('Last modification date: @lastmod', array('@lastmod' => '')), - 'changefreq' => t('Change frequency: @changfreq', array('@changfreq' => '')), - 'priority' => t('Priority: @priority', array('@priority' => '')), - ), - '#default_value' => drupal_map_assoc(variable_get('xmlsitemap_output_elements', array( - 'lastmod', - 'changefreq', - 'priority', - ))), - ); - - $form['xmlsitemap_settings'] = array( - '#type' => 'vertical_tabs', - '#weight' => 20, - ); - - $entities = xmlsitemap_get_link_info(NULL, TRUE); - module_load_all_includes('xmlsitemap.inc'); - foreach ($entities as $entity => $entity_info) { - $form[$entity] = array( - '#type' => 'fieldset', - '#title' => $entity_info['label'], - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#group' => 'xmlsitemap_settings', - ); - - if (!empty($entity_info['bundles'])) { - // If this entity has bundles, show a bundle setting summary. - xmlsitemap_add_form_entity_summary($form[$entity], $entity, $entity_info); - } - - if (!empty($entity_info['xmlsitemap']['settings callback'])) { - // Add any entity-specific settings. - $entity_info['xmlsitemap']['settings callback']($form[$entity]); - } - - // Ensure that the entity fieldset is not shown if there are no accessible - // sub-elements. - $form[$entity]['#access'] = (bool) element_get_visible_children($form[$entity]); - } - - $form['#validate'][] = 'xmlsitemap_settings_form_validate'; - $form['#submit'][] = 'xmlsitemap_settings_form_submit'; - array_unshift($form['#submit'], 'xmlsitemap_form_submit_flag_regenerate'); - $form['array_filter'] = array('#type' => 'value', '#value' => TRUE); - - $form = system_settings_form($form); - return $form; -} - -/** - * Form validator; Check the sitemap files directory. - * - * @see xmlsitemap_settings_form() - */ -function xmlsitemap_settings_form_validate($form, &$form_state) { - // Check that the chunk size will not create more than 1000 chunks. - $chunk_size = $form_state['values']['xmlsitemap_chunk_size']; - if ($chunk_size != 'auto' && $chunk_size != 50000 && (xmlsitemap_get_link_count() / $chunk_size) > 1000) { - form_set_error('xmlsitemap_chunk_size', t('The sitemap page link count of @size will create more than 1,000 sitemap pages. Please increase the link count.', array('@size' => $chunk_size))); - } - - $base_url = &$form_state['values']['xmlsitemap_base_url']; - $base_url = rtrim($base_url, '/'); - if ($base_url != '' && !valid_url($base_url, TRUE)) { - form_set_error('xmlsitemap_base_url', t('Invalid base URL.')); - } -} - -/** - * Submit handler;. - * - * @see xmlsitemap_settings_form() - */ -function xmlsitemap_settings_form_submit($form, $form_state) { - // Save any changes to the frontpage link. - xmlsitemap_link_save(array('type' => 'frontpage', 'id' => 0, 'loc' => '')); -} - -/** - * Menu callback; Confirm rebuilding of the sitemap. - * - * @see xmlsitemap_rebuild_form_submit() - */ -function xmlsitemap_rebuild_form() { - if (!$_POST && !variable_get('xmlsitemap_rebuild_needed', FALSE)) { - if (!variable_get('xmlsitemap_regenerate_needed', FALSE)) { - drupal_set_message(t('Your sitemap is up to date and does not need to be rebuilt.'), 'error'); - } - else { - $_REQUEST += array('destination' => 'admin/config/search/xmlsitemap'); - drupal_set_message(t('A rebuild is not necessary. If you are just wanting to regenerate the XML sitemap files, you can run cron manually.', array('@link-cron' => url('admin/reports/status/run-cron', array('query' => drupal_get_destination())))), 'warning'); - } - } - - // Build a list of rebuildable link types. - module_load_include('generate.inc', 'xmlsitemap'); - $rebuild_types = xmlsitemap_get_rebuildable_link_types(); - - $form['entities'] = array( - '#type' => 'select', - '#title' => t("Select which link types you would like to rebuild"), - '#description' => t('If no link types are selected, the sitemap files will just be regenerated.'), - '#multiple' => TRUE, - '#options' => drupal_map_assoc($rebuild_types), - '#default_value' => variable_get('xmlsitemap_rebuild_needed', FALSE) || !variable_get('xmlsitemap_developer_mode', 0) ? $rebuild_types : array(), - '#access' => variable_get('xmlsitemap_developer_mode', 0), - ); - $form['save_custom'] = array( - '#type' => 'checkbox', - '#title' => t('Save and restore any custom inclusion and priority links.'), - '#default_value' => TRUE, - ); - - return confirm_form( - $form, - t('Are you sure you want to rebuild the XML sitemap?'), - 'admin/config/search/xmlsitemap', - '', - t('Rebuild sitemap'), - t('Cancel') - ); -} - -/** - * Submit handler; Starts the sitemap rebuild batch. - * - * @see xmlsitemap_rebuild_form() - * @see xmlsitemap_rebuild_batch() - */ -function xmlsitemap_rebuild_form_submit($form, &$form_state) { - module_load_include('generate.inc', 'xmlsitemap'); - $batch = xmlsitemap_rebuild_batch($form_state['values']['entities'], $form_state['values']['save_custom']); - batch_set($batch); - $form_state['redirect'] = 'admin/config/search/xmlsitemap'; -} - -/** - * Add a table summary for an entity and its bundles. - */ -function xmlsitemap_add_form_entity_summary(&$form, $entity, array $entity_info) { - $priorities = xmlsitemap_get_priority_options(NULL, FALSE); - $statuses = xmlsitemap_get_status_options(NULL); - $destination = drupal_get_destination(); - - $rows = array(); - $totals = array('total' => 0, 'indexed' => 0, 'visible' => 0); - foreach ($entity_info['bundles'] as $bundle => $bundle_info) { - // Fetch current per-bundle link total and indexed counts. - $status = xmlsitemap_get_link_type_indexed_status($entity, $bundle); - $totals['total'] += $status['total']; - $totals['indexed'] += $status['indexed']; - $totals['visible'] += $status['visible']; - - $row = array(); - if (drupal_valid_path("admin/config/search/xmlsitemap/settings/$entity/$bundle")) { - $edit_link = xmlsitemap_get_operation_link("admin/config/search/xmlsitemap/settings/$entity/$bundle", array('title' => $bundle_info['label'], 'modal' => TRUE)); - $row[] = l($edit_link['title'], $edit_link['href'], $edit_link); - } - else { - // Bundle labels are assumed to be un-escaped input. - $row[] = check_plain($bundle_info['label']); - } - $row[] = $statuses[$bundle_info['xmlsitemap']['status'] ? 1 : 0]; - $row[] = $priorities[number_format($bundle_info['xmlsitemap']['priority'], 1)]; - $row[] = $status['total']; - $row[] = $status['indexed']; - $row[] = $status['visible']; - $rows[] = $row; - } - - if ($rows) { - $header = array( - isset($entity_info['bundle label']) ? $entity_info['bundle label'] : '', - t('Inclusion'), - t('Priority'), - t('Available'), - t('Indexed'), - t('Visible'), - ); - $rows[] = array( - array( - 'data' => t('Totals'), - 'colspan' => 3, - 'header' => TRUE, - ), - array( - 'data' => $totals['total'], - 'header' => TRUE, - ), - array( - 'data' => $totals['indexed'], - 'header' => TRUE, - ), - array( - 'data' => $totals['visible'], - 'header' => TRUE, - ), - ); - $form['summary'] = array( - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - ); - } -} - -/** - * Add the link type XML sitemap options to the link type's form. - * - * Caller is responsible for ensuring xmlsitemap_link_bundle_settings_save() - * is called during submission. - */ -function xmlsitemap_add_link_bundle_settings(array &$form, array &$form_state, $entity, $bundle) { - $entity_info = xmlsitemap_get_link_info($entity); - $bundle_info = xmlsitemap_link_bundle_load($entity, $bundle); - - $form['xmlsitemap'] = array( - '#type' => 'fieldset', - '#title' => t('XML sitemap'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#access' => user_access('administer xmlsitemap'), - '#group' => 'additional_settings', - '#attached' => array( - 'js' => array( - 'vertical-tabs' => drupal_get_path('module', 'xmlsitemap') . '/xmlsitemap.js', - ), - ), - '#tree' => TRUE, - '#entity' => $entity, - '#bundle' => $bundle, - '#entity_info' => $entity_info, - '#bundle_info' => $bundle_info, - ); - - // Hack to remove fieldset summary if Vertical tabs is not enabled. - if (!isset($form['additional_settings'])) { - unset($form['xmlsitemap']['#attached']['js']['vertical-tabs']); - } - - $form['xmlsitemap']['description'] = array( - '#prefix' => '
', - '#suffix' => '
', - '#markup' => t('Changing these type settings will affect any items of this type that have either inclusion or priority set to default.'), - ); - $form['xmlsitemap']['status'] = array( - '#type' => 'select', - '#title' => t('Inclusion'), - '#options' => xmlsitemap_get_status_options(), - '#default_value' => $bundle_info['status'], - ); - $form['xmlsitemap']['priority'] = array( - '#type' => 'select', - '#title' => t('Default priority'), - '#options' => xmlsitemap_get_priority_options(), - '#default_value' => $bundle_info['priority'], - '#states' => array( - 'invisible' => array( - 'select[name="xmlsitemap[status]"]' => array('value' => '0'), - ), - ), - ); - - $form += array('#submit' => array()); - array_unshift($form['#submit'], 'xmlsitemap_link_bundle_settings_form_submit'); - - if (isset($form['submit'])) { - $form['submit'] += array('#weight' => 40); - } - if (isset($form['delete'])) { - $form['delete'] += array('#weight' => 50); - } -} - -/** - * Link bundle settings form. - */ -function xmlsitemap_link_bundle_settings_form(array $form, array &$form_state, array $bundle) { - if (empty($form_state['ajax']) && $admin_path = xmlsitemap_get_bundle_path($bundle['entity'], $bundle['bundle'])) { - // If this is a non-ajax form, redirect to the bundle administration page. - $destination = drupal_get_destination(); - unset($_GET['destination']); - drupal_goto($admin_path, array('query' => $destination)); - } - else { - drupal_set_title(t('@bundle XML sitemap settings', array('@bundle' => $bundle['info']['label']))); - } - - $form = array(); - xmlsitemap_add_link_bundle_settings($form, $form_state, $bundle['entity'], $bundle['bundle']); - $form['xmlsitemap']['#type'] = 'markup'; - $form['xmlsitemap']['#value'] = ''; - $form['xmlsitemap']['#access'] = TRUE; - $form['xmlsitemap']['#show_message'] = TRUE; - - $form['actions'] = array( - '#type' => 'actions', - ); - $form['actions']['save'] = array( - '#type' => 'submit', - '#value' => t('Save'), - ); - $form['actions']['cancel'] = array( - '#value' => l(t('Cancel'), isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/xmlsitemap/settings'), - '#weight' => 10, - ); - - return $form; -} - -/** - * Add a link's XML sitemap options to the link's form. - * - * @todo Add changefreq overridability. - */ -function xmlsitemap_add_form_link_options(array &$form, $entity, $bundle, $id) { - $info = xmlsitemap_get_link_info($entity); - - if (!$info || empty($info['bundles'][$bundle])) { - return; - } - - if (!$link = xmlsitemap_link_load($entity, $id)) { - $link = array(); - } - - $bundle_info = xmlsitemap_link_bundle_load($entity, $bundle); - $link += array( - 'access' => 1, - 'status' => $bundle_info['status'], - 'status_default' => $bundle_info['status'], - 'status_override' => 0, - 'priority' => $bundle_info['priority'], - 'priority_default' => $bundle_info['priority'], - 'priority_override' => 0, - ); - - $form['xmlsitemap'] = array( - '#type' => 'fieldset', - '#tree' => TRUE, - '#title' => t('XML sitemap'), - '#collapsible' => TRUE, - '#collapsed' => !$link['status_override'] && !$link['priority_override'], - '#access' => user_access('administer xmlsitemap') || user_access('use xmlsitemap') || xmlsitemap_link_bundle_access($bundle_info), - '#group' => 'additional_settings', - '#attached' => array( - 'js' => array( - 'vertical-tabs' => drupal_get_path('module', 'xmlsitemap') . '/xmlsitemap.js', - ), - ), - ); - - // Hack to remove fieldset summary if Vertical tabs is not enabled. - if (!isset($form['additional_settings'])) { - unset($form['xmlsitemap']['#attached']['js']['vertical-tabs']); - } - - if (xmlsitemap_link_bundle_access($bundle_info) && $path = xmlsitemap_get_bundle_path($entity, $bundle)) { - $form['xmlsitemap']['description'] = array( - '#prefix' => '
', - '#suffix' => '
', - '#markup' => t('The default XML sitemap settings for this @bundle can be changed here.', array( - '@bundle' => drupal_strtolower($info['bundle label']), - '@link-type' => url($path, array( - 'query' => drupal_get_destination(), - )), - )), - ); - } - - // Show a warning if the link is not accessible and will not be included in - // the sitemap. - if ($id && !$link['access']) { - $form['xmlsitemap']['warning'] = array( - '#type' => 'markup', - '#prefix' => '

', - '#suffix' => '

', - '#value' => ('This item is not currently visible to anonymous users, so it will not be included in the sitemap.'), - ); - } - - // Status field (inclusion/exclusion) - $form['xmlsitemap']['status'] = array( - '#type' => 'select', - '#title' => t('Inclusion'), - '#options' => xmlsitemap_get_status_options($link['status_default']), - '#default_value' => $link['status_override'] ? $link['status'] : 'default', - ); - $form['xmlsitemap']['status_default'] = array( - '#type' => 'value', - '#value' => $link['status_default'], - ); - $form['xmlsitemap']['status_override'] = array( - '#type' => 'value', - '#value' => $link['status_override'], - ); - - // Priority field. - $form['xmlsitemap']['priority'] = array( - '#type' => 'select', - '#title' => t('Priority'), - '#options' => xmlsitemap_get_priority_options($link['priority_default']), - '#default_value' => $link['priority_override'] ? number_format($link['priority'], 1) : 'default', - '#description' => t('The priority of this URL relative to other URLs on your site.'), - '#states' => array( - 'invisible' => array( - 'select[name="xmlsitemap[status]"]' => array('value' => '0'), - ), - ), - ); - if (!$link['status_default']) { - // If the default status is excluded, add a visible state on the include - // override option. - $form['xmlsitemap']['priority']['#states']['visible'] = array( - 'select[name="xmlsitemap[status]"]' => array('value' => '1'), - ); - } - $form['xmlsitemap']['priority_default'] = array( - '#type' => 'value', - '#value' => $link['priority_default'], - ); - $form['xmlsitemap']['priority_override'] = array( - '#type' => 'value', - '#value' => $link['priority_override'], - ); - // Add the submit handler to adjust the default values if selected. - $form += array('#submit' => array()); - if (!in_array('xmlsitemap_process_form_link_options', $form['#submit'])) { - array_unshift($form['#submit'], 'xmlsitemap_process_form_link_options'); - } -} - -/** - * Get a list of priority options. - * - * @param string $default - * Include a 'default' option. - * @param string $guides - * Add helpful indicators for the highest, middle and lowest values. - * - * @return array - * An array of options. - */ -function xmlsitemap_get_priority_options($default = NULL, $guides = TRUE) { - $options = array(); - $priorities = array( - '1.0' => t('1.0'), - '0.9' => t('0.9'), - '0.8' => t('0.8'), - '0.7' => t('0.7'), - '0.6' => t('0.6'), - '0.5' => t('0.5'), - '0.4' => t('0.4'), - '0.3' => t('0.3'), - '0.2' => t('0.2'), - '0.1' => t('0.1'), - '0.0' => t('0.0'), - ); - - if (isset($default)) { - $default = number_format($default, 1); - $options['default'] = t('Default (@value)', array('@value' => $priorities[$default])); - } - - // Add the rest of the options. - $options += $priorities; - - if ($guides) { - $options['1.0'] .= ' ' . t('(highest)'); - $options['0.5'] .= ' ' . t('(normal)'); - $options['0.0'] .= ' ' . t('(lowest)'); - } - - return $options; -} - -/** - * Get a list of priority options. - * - * @param string $default - * Include a 'default' option. - * - * @return array - * An array of options. - * - * @see _xmlsitemap_translation_strings() - */ -function xmlsitemap_get_status_options($default = NULL) { - $options = array(); - $statuses = array( - 1 => t('Included'), - 0 => t('Excluded'), - ); - - if (isset($default)) { - $default = $default ? 1 : 0; - $options['default'] = t('Default (@value)', array('@value' => drupal_strtolower($statuses[$default]))); - } - - $options += $statuses; - - return $options; -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.api.php b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.api.php deleted file mode 100644 index 80062bf4ef..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.api.php +++ /dev/null @@ -1,319 +0,0 @@ - array( - 'label' => 'My module', - 'base table' => 'mymodule', - 'entity keys' => array( - // Primary ID key on {base table}. - 'id' => 'myid', - // Subtype key on {base table}. - 'bundle' => 'mysubtype', - ), - 'path callback' => 'mymodule_path', - 'bundle label' => t('Subtype name'), - 'bundles' => array( - 'mysubtype1' => array( - 'label' => t('My subtype 1'), - 'admin' => array( - 'real path' => 'admin/settings/mymodule/mysubtype1/edit', - 'access arguments' => array('administer mymodule'), - ), - 'xmlsitemap' => array( - 'status' => XMLSITEMAP_STATUS_DEFAULT, - 'priority' => XMLSITEMAP_PRIORITY_DEFAULT, - ), - ), - ), - 'xmlsitemap' => array( - // Callback function to take an array of IDs and save them as sitemap - // links. - 'process callback' => '', - // Callback function used in batch API for rebuilding all links. - 'rebuild callback' => '', - // Callback function called from the XML sitemap settings page. - 'settings callback' => '', - ), - ), - ); -} - -/** - * Act on a sitemap link being inserted or updated. - * - * This hook is currently invoked from xmlsitemap_node_node_update() before - * the node sitemap link is saved to the database with revoked access until - * the node permissions are checked in the cron. - * - * @param array $link - * An array with the data of the sitemap link. - * @param array $context - * An optional context array containing data related to the link. - */ -function hook_xmlsitemap_link_presave_alter(array &$link, array $context) { - if ($link['type'] == 'mymodule') { - $link['priority'] += 0.5; - } -} - -/** - * Alter the data of a sitemap link before the link is saved. - * - * @param array $link - * An array with the data of the sitemap link. - * @param array $context - * An optional context array containing data related to the link. - */ -function hook_xmlsitemap_link_alter(array &$link, array $context) { - if ($link['type'] == 'mymodule') { - $link['priority'] += 0.5; - } -} - -/** - * Inform modules that an XML sitemap link has been created. - * - * @param array $link - * Associative array defining an XML sitemap link as passed into - * xmlsitemap_link_save(). - * @param array $context - * An optional context array containing data related to the link. - * - * @see hook_xmlsitemap_link_update() - */ -function hook_xmlsitemap_link_insert(array $link, array $context) { - db_insert('mytable') - ->fields(array( - 'link_type' => $link['type'], - 'link_id' => $link['id'], - 'link_status' => $link['status'], - )) - ->execute(); -} - -/** - * Inform modules that an XML sitemap link has been updated. - * - * @param array $link - * Associative array defining an XML sitemap link as passed into - * xmlsitemap_link_save(). - * @param array $context - * An optional context array containing data related to the link. - * - * @see hook_xmlsitemap_link_insert() - */ -function hook_xmlsitemap_link_update(array $link, array $context) { - db_update('mytable') - ->fields(array( - 'link_type' => $link['type'], - 'link_id' => $link['id'], - 'link_status' => $link['status'], - )) - ->execute(); -} - -/** - * Respond to XML sitemap link clearing and rebuilding. - * - * @param array $types - * An array of link types that are being rebuilt. - * @param bool $save_custom - * If links with overridden status and/or priority are being removed or not. - */ -function hook_xmlsitemap_rebuild_clear(array $types, $save_custom) { - db_delete('mytable') - ->condition('link_type', $types, 'IN') - ->execute(); -} - -/** - * Respond to XML sitemap regeneration. - */ -function hook_xmlsitemap_regenerate_finished() { -} - -/** - * Index links for the XML sitemaps. - */ -function hook_xmlsitemap_index_links($limit) { -} - -/** - * Provide information about contexts available to XML sitemap. - * - * @see hook_xmlsitemap_context_info_alter() - */ -function hook_xmlsitemap_context_info() { - $info['vocabulary'] = array( - 'label' => t('Vocabulary'), - 'summary callback' => 'mymodule_xmlsitemap_vocabulary_context_summary', - 'default' => 0, - ); - return $info; -} - -/** - * Alter XML sitemap context info. - * - * @see hook_xmlsitemap_context_info() - */ -function hook_xmlsitemap_context_info_alter(&$info) { - $info['vocabulary']['label'] = t('Site vocabularies'); -} - -/** - * Provide information about the current context on the site. - * - * @see hook_xmlsitemap_context_alter() - */ -function hook_xmlsitemap_context() { - $context = array(); - if ($vid = mymodule_get_current_vocabulary()) { - $context['vocabulary'] = $vid; - } - return $context; -} - -/** - * Alter the current context information. - * - * @see hook_xmlsitemap_context() - */ -function hook_xmlsitemap_context_alter(&$context) { - if (user_access('administer taxonomy')) { - unset($context['vocabulary']); - } -} - -/** - * Provide options for the url() function based on an XML sitemap context. - */ -function hook_xmlsitemap_context_url_options(array $context) { -} - -/** - * Alter the url() options based on an XML sitemap context. - */ -function hook_xmlsitemap_context_url_options_alter(array &$options, array $context) { -} - -/** - * Alter the content added to an XML sitemap for an individual element. - * - * This hooks is called when the module is generating the XML content for the - * sitemap and allows other modules to alter existing or add additional XML data - * for any element by adding additional key value paris to the $element array. - * - * The key in the element array is then used as the name of the XML child - * element to add and the value is the value of that element. For example: - * - * @code $element['video:title'] = 'Big Ponycorn'; @endcode - * - * Would result in a child element like Big Ponycorn - * being added to the sitemap for this particular link. - * - * @param array $element - * The element that will be converted to XML for the link. - * @param array $link - * An array of properties providing context about the link that we are - * generating an XML element for. - * @param object $sitemap - * The sitemap that is currently being generated. - */ -function hook_xmlsitemap_element_alter(array &$element, array $link, $sitemap) { - if ($link['subtype'] === 'video') { - $node = node_load($link['id']); - $element['video:video'] = array( - 'video:title' => check_plain($node->title), - 'video:description' => isset($node->body[LANGUAGE_NONE][0]['summary']) ? check_plain($node->body[LANGUAGE_NONE][0]['summary']) : check_plain($node->body[LANGUAGE_NONE][0]['value']), - 'video:live' => 'no', - ); - } -} - -/** - * Alter the attributes used for the root element of the XML sitemap. - * - * For example add an xmlns:video attribute: - * - * @code - * - * @endcode - * - * @param array $attributes - * An associative array of attributes to use in the root element of an XML - * sitemap. - * @param object $sitemap - * The sitemap that is currently being generated. - */ -function hook_xmlsitemap_root_attributes_alter(array &$attributes, $sitemap) { - $attributes['xmlns:video'] = 'https://www.google.com/schemas/sitemap-video/1.1'; -} - -/** - * Alter the query selecting data from {xmlsitemap} during sitemap generation. - * - * @param QueryAlterableInterface $query - * A Query object describing the composite parts of a SQL query. - * - * @see hook_query_TAG_alter() - */ -function hook_query_xmlsitemap_generate_alter(QueryAlterableInterface $query) { - $sitemap = $query->getMetaData('sitemap'); - if (!empty($sitemap->context['vocabulary'])) { - $node_condition = db_and(); - $node_condition->condition('type', 'taxonomy_term'); - $node_condition->condition('subtype', $sitemap->context['vocabulary']); - $normal_condition = db_and(); - $normal_condition->condition('type', 'taxonomy_term', '<>'); - $condition = db_or(); - $condition->condition($node_condition); - $condition->condition($normal_condition); - $query->condition($condition); - } -} - -/** - * Provide information about XML sitemap bulk operations. - */ -function hook_xmlsitemap_sitemap_operations() { -} - -/** - * Respond to XML sitemap deletion. - * - * This hook is invoked from xmlsitemap_sitemap_delete_multiple() after the XML - * sitemap has been removed from the table in the database. - * - * @param object $sitemap - * The XML sitemap object that was deleted. - */ -function hook_xmlsitemap_sitemap_delete(stdClass $sitemap) { - db_delete('mytable') - ->condition('smid', $sitemap->smid, '=') - ->execute(); -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.drush.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.drush.inc deleted file mode 100644 index f174029108..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.drush.inc +++ /dev/null @@ -1,181 +0,0 @@ - 'Regenerate the XML sitemap files.', - 'callback' => 'drush_xmlsitemap_regenerate', - 'drupal dependencies' => array('xmlsitemap'), - ); - $items['xmlsitemap-rebuild'] = array( - 'description' => 'Dump and re-process all possible XML sitemap data, and then regenerate the files.', - 'callback' => 'drush_xmlsitemap_rebuild', - 'drupal dependencies' => array('xmlsitemap'), - 'options' => array( - 'types' => 'The types of links to rebuild, comma separated. If not provided, all link types will be used.', - ), - ); - $items['xmlsitemap-index'] = array( - 'description' => 'Process un-indexed XML sitemap links.', - 'callback' => 'drush_xmlsitemap_index', - 'drupal dependencies' => array('xmlsitemap'), - 'options' => array( - 'limit' => 'The limit of links of each type to process. Default value: ' . variable_get('xmlsitemap_batch_limit', XMLSITEMAP_BATCH_LIMIT), - ), - ); - $items['xmlsitemap-queue-rebuild'] = array( - 'description' => 'Dump and queues all possible XML sitemap data to be re-processed via the xmlsitemap_link_process queue. This command does not regenerate the sitemap files.', - 'options' => array( - 'types' => 'The types of links to queue for rebuild, comma separated. If not provided, all link types will be used.', - 'limit' => 'The number of links to be processed in each queue task.', - ), - ); - return $items; -} - -/** - * Regenerate the sitemap files from existing data. - */ -function drush_xmlsitemap_regenerate() { - module_load_include('generate.inc', 'xmlsitemap'); - - // Run the batch process. - timer_start('xmlsitemap_regenerate'); - xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch'); - - $vars = array( - '@timer' => timer_read('xmlsitemap_regenerate'), - '@memory-peak' => format_size(memory_get_peak_usage(TRUE)), - ); - drush_print(dt('XML sitemap files regenerated in @timer ms. Peak memory usage: @memory-peak.', $vars)); -} - -/** - * Dump and rebuild all the sitemap data, then regenerate the files. - */ -function drush_xmlsitemap_rebuild() { - module_load_include('generate.inc', 'xmlsitemap'); - - // Build a list of rebuildable link types. - $types = xmlsitemap_get_rebuildable_link_types(); - if ($option_types = drush_get_option('types', '')) { - $option_types = explode(',', $option_types); - if ($invalid_types = array_diff($option_types, $types)) { - drush_set_error(dt('The following link types are invalid: @types', array('@types' => implode(', ', $invalid_types)))); - } - $types = array_intersect($types, $option_types); - } - if (empty($types)) { - return drush_set_error(dt('No link types are rebuildable.')); - } - - // Run the batch process. - timer_start('xmlsitemap_rebuild'); - xmlsitemap_run_unprogressive_batch('xmlsitemap_rebuild_batch', $types, TRUE); - - $vars = array( - '@timer' => timer_read('xmlsitemap_rebuild'), - '@memory-peak' => format_size(memory_get_peak_usage(TRUE)), - ); - drush_print(dt('XML sitemap files rebuilt in @timer ms. Peak memory usage: @memory-peak.', $vars)); -} - -/** - * Process un-indexed XML sitemap links. - */ -function drush_xmlsitemap_index() { - $limit = (int) drush_get_option('limit', variable_get('xmlsitemap_batch_limit', XMLSITEMAP_BATCH_LIMIT)); - $count_before = db_query("SELECT COUNT(id) FROM {xmlsitemap}")->fetchField(); - - module_invoke_all('xmlsitemap_index_links', $limit); - $count_after = db_query("SELECT COUNT(id) FROM {xmlsitemap}")->fetchField(); - - if ($count_after == $count_before) { - drush_print(dt('No new XML sitemap links to index.')); - } - else { - drush_print(dt('Indexed @count new XML sitemap links.', array('@count' => $count_after - $count_before))); - } -} - -/** - * Dump and queue all the sitemap links to be rebuilt in a queue process. - */ -function drush_xmlsitemap_queue_rebuild() { - module_load_include('generate.inc', 'xmlsitemap'); - - $types = xmlsitemap_get_rebuildable_link_types(); - if ($option_types = drush_get_option('types', '')) { - $option_types = explode(',', $option_types); - if ($invalid_types = array_diff($option_types, $types)) { - drush_set_error(dt('The following link types are invalid: @types', array('@types' => implode(', ', $invalid_types)))); - } - $types = array_intersect($types, $option_types); - } - if (empty($types)) { - return drush_set_error(dt('No link types are rebuildable.')); - } - - xmlsitemap_rebuild_clear($types, TRUE); - - $link_count = 0; - $chunk_count = 0; - $chunk_size = (int) drush_get_option('limit', variable_get('xmlsitemap_batch_limit', XMLSITEMAP_BATCH_LIMIT)); - - // @todo Figure out how to re-use this code with xmlsitemap_rebuild_batch_fetch() - foreach ($types as $type) { - $info = xmlsitemap_get_link_info($type); - $query = new EntityFieldQuery(); - $query->entityCondition('entity_type', $type); - $query->entityCondition('entity_id', 0, '>'); - $query->addTag('xmlsitemap_link_bundle_access'); - $query->addTag('xmlsitemap_rebuild'); - $query->addMetaData('entity', $type); - $query->addMetaData('entity_info', $info); - if ($bundles = xmlsitemap_get_link_type_enabled_bundles($type)) { - $query->entityCondition('bundle', $bundles, 'IN'); - } - else { - // If no enabled bundle types, skip everything else. - continue; - } - - $results = $query->execute(); - if (!empty($results[$type])) { - $ids = array_keys($results[$type]); - $link_count += count($ids); - $chunks = array_chunk($ids, $chunk_size); - $chunk_count += count($chunks); - foreach ($chunks as $chunk) { - xmlsitemap_link_enqueue($type, $chunk); - } - } - } - - if ($link_count) { - drush_log(dt('Queued @link_count links for rebuild processing in the xmlsitemap_link_process (in @chunk_count chunks of up to @chunk_size links each).', array( - '@link_count' => $link_count, - '@chunk_count' => $chunk_count, - '@chunk_size' => $chunk_size, - )), 'success'); - } - else { - drush_log(dt('No links to queue for rebuild processing.'), 'ok'); - } - variable_set('xmlsitemap_rebuild_needed', FALSE); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.generate.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.generate.inc deleted file mode 100644 index 848e94235a..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.generate.inc +++ /dev/null @@ -1,584 +0,0 @@ - LANGUAGE_NONE))->fetchAllKeyed(); - } - if ($language != LANGUAGE_NONE && $last_language != $language) { - unset($aliases[$last_language]); - $aliases[$language] = db_query("SELECT source, alias FROM {url_alias} WHERE language = :language ORDER BY pid", array(':language' => $language))->fetchAllKeyed(); - $last_language = $language; - } - - // We need to pass our path through hook_url_outbound_alter(). This fixes - // clean URLs not working when they don't exist in the {url_alias} table and - // are created with something like subpathauto. - $normalized_path = $path; - - // hook_url_outbound_alter() expects defaults in url() options. - $options = array( - 'fragment' => '', - 'query' => array(), - 'absolute' => FALSE, - 'alias' => FALSE, - 'prefix' => '', - 'external' => FALSE, - ); - - if ($language != LANGUAGE_NONE && isset($aliases[$language][$path])) { - $normalized_path = $aliases[$language][$path]; - $options['alias'] = TRUE; - } - elseif (isset($aliases[LANGUAGE_NONE][$path])) { - $normalized_path = $aliases[LANGUAGE_NONE][$path]; - $options['alias'] = TRUE; - } - - $original_path = $normalized_path; - drupal_alter('url_outbound', $normalized_path, $options, $original_path); - return $normalized_path; -} - -/** - * Perform operations before rebuilding the sitemap. - */ -function _xmlsitemap_regenerate_before() { - // Attempt to increase the memory limit. - _xmlsitemap_set_memory_limit(); - - if (variable_get('xmlsitemap_developer_mode', 0)) { - watchdog('xmlsitemap', 'Starting XML sitemap generation. Memory usage: @memory-peak.', array( - '@memory-peak' => format_size(memory_get_peak_usage(TRUE)), - ), - WATCHDOG_DEBUG - ); - } -} - -/** - * Get Memory Usage. - */ -function _xmlsitemap_get_memory_usage($start = FALSE) { - static $memory_start; - $current = memory_get_peak_usage(TRUE); - if (!isset($memory_start) || $start) { - $memory_start = $current; - } - return $current - $memory_start; -} - -/** - * Calculate the optimal PHP memory limit for sitemap generation. - * - * This function just makes a guess. It does not take into account - * the currently loaded modules. - */ -function _xmlsitemap_get_optimal_memory_limit() { - $optimal_limit = &drupal_static(__FUNCTION__); - if (!isset($optimal_limit)) { - // Set the base memory amount from the provided core constant. - $optimal_limit = parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT); - - // Add memory based on the chunk size. - $optimal_limit += xmlsitemap_get_chunk_size() * 500; - - // Add memory for storing the url aliases. - if (variable_get('xmlsitemap_prefetch_aliases', 1)) { - $aliases = db_query("SELECT COUNT(pid) FROM {url_alias}")->fetchField(); - $optimal_limit += $aliases * 250; - } - } - return $optimal_limit; -} - -/** - * Calculate the optimal memory level for sitemap generation. - * - * @param string $new_limit - * An optional PHP memory limit in bytes. If not provided, the value of - * _xmlsitemap_get_optimal_memory_limit() will be used. - */ -function _xmlsitemap_set_memory_limit($new_limit = NULL) { - $current_limit = @ini_get('memory_limit'); - if ($current_limit && $current_limit != -1) { - if (!is_null($new_limit)) { - $new_limit = _xmlsitemap_get_optimal_memory_limit(); - } - if (parse_size($current_limit) < $new_limit) { - return @ini_set('memory_limit', $new_limit); - } - } -} - -/** - * Generate one page (chunk) of the sitemap. - * - * @param object $sitemap - * An unserialized data array for an XML sitemap. - * @param string $page - * An integer of the specific page of the sitemap to generate. - */ -function xmlsitemap_generate_page(stdClass $sitemap, $page) { - try { - $writer = new XMLSitemapWriter($sitemap, $page); - $writer->startDocument(); - $writer->generateXML(); - $writer->endDocument(); - } - catch (Exception $e) { - watchdog_exception('xmlsitemap', $e); - throw $e; - } - - return $writer->getSitemapElementCount(); -} - -/** - * Generate chunk. - */ -function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer, $chunk) { - global $base_url; - $output_elements = drupal_map_assoc(variable_get('xmlsitemap_output_elements', array( - 'lastmod', - 'changefreq', - 'priority', - ))); - $lastmod_format = variable_get('xmlsitemap_lastmod_format', XMLSITEMAP_LASTMOD_MEDIUM); - - $url_options = $sitemap->uri['options']; - $url_options += array( - 'absolute' => TRUE, - 'base_url' => variable_get('xmlsitemap_base_url', $base_url), - 'language' => language_default(), - 'alias' => variable_get('xmlsitemap_prefetch_aliases', TRUE), - ); - - $last_url = ''; - $link_count = 0; - - $query = db_select('xmlsitemap', 'x'); - $query->fields('x', array( - 'id', - 'type', - 'subtype', - 'loc', - 'lastmod', - 'changefreq', - 'changecount', - 'priority', - 'language', - 'access', - 'status', - )); - $query->condition('x.access', 1); - $query->condition('x.status', 1); - $query->orderBy('x.language', 'DESC'); - $query->orderBy('x.loc'); - $query->addTag('xmlsitemap_generate'); - $query->addMetaData('sitemap', $sitemap); - - $offset = max($chunk - 1, 0) * xmlsitemap_get_chunk_size(); - $limit = xmlsitemap_get_chunk_size(); - $query->range($offset, $limit); - $links = $query->execute(); - - while ($link = $links->fetchAssoc()) { - $link['language'] = $link['language'] != LANGUAGE_NONE ? xmlsitemap_language_load($link['language']) : $url_options['language']; - $parsed_url = drupal_parse_url($link['loc']); - // Remove query or fragment. - $link['loc'] = $parsed_url['path']; - if ($url_options['alias']) { - $link['loc'] = xmlsitemap_get_path_alias($link['loc'], $link['language']->language); - } - $link_options = array( - 'language' => $link['language'], - 'xmlsitemap_link' => $link, - 'xmlsitemap_sitemap' => $sitemap, - 'query' => $parsed_url['query'], - 'fragment' => $parsed_url['fragment'], - ); - // @todo Add a separate hook_xmlsitemap_link_url_alter() here? - $link_url = url($link['loc'], $link_options + $url_options); - - // Skip this link if it was a duplicate of the last one. - // @todo Figure out a way to do this before generation so we can report - // back to the user about this. - if ($link_url == $last_url) { - continue; - } - else { - $last_url = $link_url; - // Keep track of the total number of links written. - $link_count++; - } - - $element = array(); - $element['loc'] = $link_url; - if ($link['lastmod']) { - if (!empty($output_elements['lastmod'])) { - $element['lastmod'] = gmdate($lastmod_format, $link['lastmod']); - } - // If the link has a lastmod value, update the changefreq so that links - // with a short changefreq but updated two years ago show decay. - // We use abs() here just incase items were created on this same cron run - // because lastmod would be greater than REQUEST_TIME. - $link['changefreq'] = (abs(REQUEST_TIME - $link['lastmod']) + $link['changefreq']) / 2; - } - if (!empty($output_elements['changefreq']) && $link['changefreq']) { - $element['changefreq'] = xmlsitemap_get_changefreq($link['changefreq']); - } - if (!empty($output_elements['priority']) && isset($link['priority']) && $link['priority'] != 0.5) { - // Don't output the priority value for links that have 0.5 priority. This - // is the default 'assumed' value if priority is not included as per the - // sitemaps.org specification. - $element['priority'] = number_format($link['priority'], 1); - } - - // @todo Should this be moved to XMLSitemapWritier::writeSitemapElement()? - drupal_alter('xmlsitemap_element', $element, $link, $sitemap); - - $writer->writeSitemapElement('url', $element); - } - - return $link_count; -} - -/** - * Generate the index sitemap. - * - * @param object $sitemap - * An unserialized data array for an XML sitemap. - */ -function xmlsitemap_generate_index(stdClass $sitemap) { - try { - $writer = new XMLSitemapIndexWriter($sitemap); - $writer->startDocument(); - $writer->generateXML(); - $writer->endDocument(); - } - catch (Exception $e) { - watchdog_exception('xmlsitemap', $e); - throw $e; - } - - return $writer->getSitemapElementCount(); -} - -/** - * BATCH OPERATIONS -----------------------------------------------------------. - * - * Batch information callback for regenerating the sitemap files. - * - * @param array $smids - * An optional array of XML sitemap IDs. If not provided, it will load all - * existing XML sitemaps. - */ -function xmlsitemap_regenerate_batch(array $smids = array()) { - if (empty($smids)) { - $smids = db_query("SELECT smid FROM {xmlsitemap_sitemap}")->fetchCol(); - } - $batch = array( - 'operations' => array(), - 'finished' => 'xmlsitemap_regenerate_batch_finished', - 'title' => t('Regenerating Sitemap'), - 'file' => drupal_get_path('module', 'xmlsitemap') . '/xmlsitemap.generate.inc', - ); - - // Set the regenerate flag in case something fails during file generation. - $batch['operations'][] = array('xmlsitemap_batch_variable_set', array(array('xmlsitemap_regenerate_needed' => TRUE))); - - // @todo Get rid of this batch operation. - $batch['operations'][] = array('_xmlsitemap_regenerate_before', array()); - - // Generate all the sitemap pages for each context. - foreach ($smids as $smid) { - $batch['operations'][] = array('xmlsitemap_regenerate_batch_generate', array($smid)); - $batch['operations'][] = array('xmlsitemap_regenerate_batch_generate_index', array($smid)); - } - - // Clear the regeneration flag. - $batch['operations'][] = array('xmlsitemap_batch_variable_set', array(array('xmlsitemap_regenerate_needed' => FALSE))); - - return $batch; -} - -/** - * Batch callback; generate all pages of a sitemap. - */ -function xmlsitemap_regenerate_batch_generate($smid, array &$context) { - if (!isset($context['sandbox']['sitemap'])) { - $context['sandbox']['sitemap'] = xmlsitemap_sitemap_load($smid); - $context['sandbox']['sitemap']->chunks = 1; - $context['sandbox']['sitemap']->links = 0; - $context['sandbox']['max'] = XMLSITEMAP_MAX_SITEMAP_LINKS; - - // Clear the cache directory for this sitemap before generating any files. - xmlsitemap_check_directory($context['sandbox']['sitemap']); - xmlsitemap_clear_directory($context['sandbox']['sitemap']); - } - - $sitemap = &$context['sandbox']['sitemap']; - $links = xmlsitemap_generate_page($sitemap, $sitemap->chunks); - $context['message'] = t('Now generating %sitemap-url.', array('%sitemap-url' => url('sitemap.xml', $sitemap->uri['options'] + array('query' => array('page' => $sitemap->chunks))))); - - if ($links) { - $sitemap->links += $links; - $sitemap->chunks++; - } - else { - // Cleanup the 'extra' empty file. - $file = xmlsitemap_sitemap_get_file($sitemap, $sitemap->chunks); - if (file_exists($file) && $sitemap->chunks > 1) { - file_unmanaged_delete($file); - } - $sitemap->chunks--; - - // Save the updated chunks and links values. - $context['sandbox']['max'] = $sitemap->chunks; - $sitemap->updated = REQUEST_TIME; - xmlsitemap_sitemap_get_max_filesize($sitemap); - xmlsitemap_sitemap_save($sitemap); - } - - if ($sitemap->chunks != $context['sandbox']['max']) { - $context['finished'] = $sitemap->chunks / $context['sandbox']['max']; - } -} - -/** - * Batch callback; generate the index page of a sitemap. - */ -function xmlsitemap_regenerate_batch_generate_index($smid, array &$context) { - $sitemap = xmlsitemap_sitemap_load($smid); - if ($sitemap->chunks > 1) { - xmlsitemap_generate_index($sitemap); - $context['message'] = t('Now generating sitemap index %sitemap-url.', array('%sitemap-url' => url('sitemap.xml', $sitemap->uri['options']))); - } -} - -/** - * Batch callback; sitemap regeneration finished. - */ -function xmlsitemap_regenerate_batch_finished($success, $results, $operations, $elapsed) { - if ($success && !variable_get('xmlsitemap_regenerate_needed', FALSE)) { - variable_set('xmlsitemap_generated_last', REQUEST_TIME); - // drupal_set_message(t('The sitemaps were regenerated.')); - // Show a watchdog message that the sitemap was regenerated. - watchdog('xmlsitemap', - 'Finished XML sitemap generation in @elapsed. Memory usage: @memory-peak.', - array( - '@elapsed' => $elapsed, - '@memory-peak' => format_size(memory_get_peak_usage(TRUE)), - ), - WATCHDOG_NOTICE - ); - module_invoke_all('xmlsitemap_regenerate_finished'); - } - else { - drupal_set_message(t('The sitemaps were not successfully regenerated.'), 'error'); - } -} - -/** - * Batch information callback for rebuilding the sitemap data. - */ -function xmlsitemap_rebuild_batch(array $entities, $save_custom = FALSE) { - $batch = array( - 'operations' => array(), - 'finished' => 'xmlsitemap_rebuild_batch_finished', - 'title' => t('Rebuilding Sitemap'), - 'file' => drupal_get_path('module', 'xmlsitemap') . '/xmlsitemap.generate.inc', - ); - - // Set the rebuild flag in case something fails during the rebuild. - $batch['operations'][] = array('xmlsitemap_batch_variable_set', array(array('xmlsitemap_rebuild_needed' => TRUE))); - - // Purge any links first. - $batch['operations'][] = array('xmlsitemap_rebuild_batch_clear', - array($entities, (bool) $save_custom), - ); - - // Fetch all the sitemap links and save them to the {xmlsitemap} table. - foreach ($entities as $entity) { - $info = xmlsitemap_get_link_info($entity); - $batch['operations'][] = array($info['xmlsitemap']['rebuild callback'], array($entity)); - } - - // Clear the rebuild flag. - $batch['operations'][] = array('xmlsitemap_batch_variable_set', array(array('xmlsitemap_rebuild_needed' => FALSE))); - - // Add the regeneration batch. - $regenerate_batch = xmlsitemap_regenerate_batch(); - $batch['operations'] = array_merge($batch['operations'], $regenerate_batch['operations']); - - return $batch; -} - -/** - * Batch callback; set an array of variables and their values. - */ -function xmlsitemap_batch_variable_set(array $variables) { - foreach ($variables as $variable => $value) { - variable_set($variable, $value); - } -} - -/** - * Batch callback; clear sitemap links for entites. - */ -function xmlsitemap_rebuild_batch_clear(array $entities, $save_custom, &$context) { - if (!empty($entities)) { - xmlsitemap_rebuild_clear($entities, $save_custom); - } - $context['message'] = t('Purging links.'); -} - -/** - * Batch callback; fetch and add the sitemap links for a specific entity. - */ -function xmlsitemap_rebuild_batch_fetch($entity, &$context) { - if (!isset($context['sandbox']['info'])) { - $context['sandbox']['info'] = xmlsitemap_get_link_info($entity); - $context['sandbox']['progress'] = 0; - $context['sandbox']['last_id'] = 0; - } - $info = $context['sandbox']['info']; - - $query = new EntityFieldQuery(); - $query->entityCondition('entity_type', $entity); - $query->entityCondition('entity_id', $context['sandbox']['last_id'], '>'); - $query->addTag('xmlsitemap_link_bundle_access'); - $query->addTag('xmlsitemap_rebuild'); - $query->addMetaData('entity', $entity); - $query->addMetaData('entity_info', $info); - if ($types = xmlsitemap_get_link_type_enabled_bundles($entity)) { - $query->entityCondition('bundle', $types, 'IN'); - } - else { - // If no enabled bundle types, skip everything else. - return; - } - - if (!isset($context['sandbox']['max'])) { - $count_query = clone $query; - $count_query->count(); - $context['sandbox']['max'] = $count_query->execute(); - if (!$context['sandbox']['max']) { - // If there are no items to process, skip everything else. - return; - } - } - - // PostgreSQL cannot have the ORDERED BY in the count query. - $query->entityOrderBy('entity_id'); - $limit = 20; - $query->range(0, $limit); - - $result = $query->execute(); - $ids = array_keys($result[$entity]); - - $info['xmlsitemap']['process callback']($ids); - $context['sandbox']['last_id'] = end($ids); - $context['sandbox']['progress'] += count($ids); - $context['message'] = t('Now processing %entity @last_id (@progress of @count).', array( - '%entity' => $entity, - '@last_id' => $context['sandbox']['last_id'], - '@progress' => $context['sandbox']['progress'], - '@count' => $context['sandbox']['max'], - )); - - if ($context['sandbox']['progress'] >= $context['sandbox']['max']) { - $context['finished'] = 1; - } - else { - $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; - } -} - -/** - * Batch callback; sitemap rebuild finished. - */ -function xmlsitemap_rebuild_batch_finished($success, $results, $operations, $elapsed) { - if ($success && !variable_get('xmlsitemap_rebuild_needed', FALSE)) { - drupal_set_message(t('The sitemap links were rebuilt.')); - } - else { - drupal_set_message(t('The sitemap links were not successfully rebuilt.'), 'error'); - } -} - -/** - * Get Rebuildable link types. - */ -function xmlsitemap_get_rebuildable_link_types() { - $rebuild_types = array(); - $entities = xmlsitemap_get_link_info(); - - foreach ($entities as $entity => $info) { - if (empty($info['xmlsitemap']['rebuild callback'])) { - // If the entity is missing a rebuild callback, skip. - continue; - } - if (!empty($info['entity keys']['bundle']) && !xmlsitemap_get_link_type_enabled_bundles($entity)) { - // If the entity has bundles, but no enabled bundles, skip since - // rebuilding wouldn't get any links. - continue; - } - else { - $rebuild_types[] = $entity; - } - } - - return $rebuild_types; -} - -/** - * Clear all sitemap links for given entity types. - * - * @param array $types - * An array of link types. - * @param bool $save_custom - * A boolean if links with status or priority overridden should not be - * removed (and hence overridden values not lost). - * - * @return int - * The number of deleted links. - */ -function xmlsitemap_rebuild_clear(array $types, $save_custom) { - // Let other modules respond to the rebuild clearing. - module_invoke_all('xmlsitemap_rebuild_clear', $types, $save_custom); - - $query = db_delete('xmlsitemap'); - $query->condition('type', $types); - - // If we want to save the custom data, make sure to exclude any links - // that are not using default inclusion or priority. - if ($save_custom) { - $query->condition('status_override', 0); - $query->condition('priority_override', 0); - } - - return $query->execute(); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.inc deleted file mode 100644 index e5e53dbc06..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.inc +++ /dev/null @@ -1,92 +0,0 @@ -

Thank you for helping test the XML sitemap module rewrite. Please consider helping offset developer free time by donating or if your company is interested in sponsoring the rewrite or a specific feature, please contact the developer. Thank you to the following current sponsors: ' . implode(', ', $sponsors) . ', and all the individuals that have donated. This message will not be seen in the stable versions.

'; - // http://drupalmodules.com/module/xml-sitemap - } - } - - return $blurb; -} - -/** - * Get version. - */ -function _xmlsitemap_get_version() { - static $version; - if (!isset($version)) { - $modules = _system_rebuild_module_data(); - $version = $modules['xmlsitemap']->info['version']; - } - return $version; -} - -/** - * Check the status of all hook_requirements() from any xmlsitemap modules. - */ -function xmlsitemap_check_status() { - $messages = &drupal_static(__FUNCTION__); - - if (!isset($messages)) { - // Cache the list of modules that are checked. - if ($cache = cache_get('xmlsitemap:registry:requirements')) { - $modules = $cache->data; - } - else { - $modules = array(); - module_load_all_includes('install'); - foreach (module_implements('requirements') as $module) { - if (strpos($module, 'xmlsitemap') !== FALSE) { - $modules[] = $module; - } - } - cache_set('xmlsitemap:registry:requirements', $modules); - } - - $messages = array(); - foreach ($modules as $module) { - module_load_install($module); - $requirements = module_invoke($module, 'requirements', 'runtime'); - foreach ($requirements as $requirement) { - if (isset($requirement['severity']) && max(REQUIREMENT_OK, $requirement['severity'])) { - $messages[] = $requirement['description']; - } - } - } - - if ($messages) { - $message = t('One or more problems were detected with your XML sitemap configuration: !messages', array('!messages' => theme('item_list', array('items' => $messages)))); - if (user_access('access site reports')) { - $message .= t('Check the status report for more information.', array('@status-report' => url('admin/reports/status'))); - } - drupal_set_message($message, 'warning', FALSE); - } - } - - return !empty($messages); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.info deleted file mode 100644 index 1e08dccdf6..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.info +++ /dev/null @@ -1,15 +0,0 @@ -name = XML sitemap -description = Creates an XML sitemap conforming to the sitemaps.org protocol. -package = XML sitemap -core = 7.x -files[] = xmlsitemap.xmlsitemap.inc -files[] = xmlsitemap.test -recommends[] = robotstxt -configure = admin/config/search/xmlsitemap -test_dependencies[] = robotstxt:robotstxt - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.install b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.install deleted file mode 100644 index 2ceda78615..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.install +++ /dev/null @@ -1,586 +0,0 @@ - $t('XML sitemap PHP extensions'), - 'value' => $t('Disabled'), - 'severity' => REQUIREMENT_ERROR, - 'description' => $t("The XML sitemap module requires you to enable the PHP extensions in the following list (see the module's system requirements page for more information):", array( - '@xmlsitemap_requirements' => 'https://www.drupal.org/documentation/modules/xmlsitemap/requirements', - )) . theme('item_list', array('items' => $missing_extensions)), - ); - } - - if ($phase == 'runtime') { - // If clean URLs are disabled there must not be an actual sitemap.xml in - // the root directory. - if (variable_get('clean_url', 0) && file_exists(DRUPAL_ROOT . '/sitemap.xml')) { - $requirements['xmlsitemap_file'] = array( - 'title' => $t('XML sitemap'), - 'value' => $t('Existing sitemap.xml file found.'), - 'severity' => REQUIREMENT_ERROR, - 'description' => $t('The XML sitemap module cannot display its XML output if there is an existing sitemap.xml file in your website root.'), - ); - } - - // Check that the base directory and all its subdirectories are writable. - $requirements['xmlsitemap_directory'] = array( - 'title' => $t('XML sitemap cache directory'), - 'value' => $t('Writable'), - ); - if (!xmlsitemap_check_directory()) { - $requirements['xmlsitemap_directory']['value'] = $t('Not found or not writable'); - $requirements['xmlsitemap_directory']['severity'] = REQUIREMENT_ERROR; - $requirements['xmlsitemap_directory']['description'] = $t('The directory %directory was not found or is not writable by the server. See @docpage for more information.', array('%directory' => xmlsitemap_get_directory(), '@docpage' => 'https://www.drupal.org/node/244924')); - } - else { - $directories = xmlsitemap_check_all_directories(); - foreach ($directories as $directory => $writable) { - if ($writable) { - unset($directories[$directory]); - } - } - if (!empty($directories)) { - $requirements['xmlsitemap_directory']['value'] = $t('Not found or not writable'); - $requirements['xmlsitemap_directory']['severity'] = REQUIREMENT_ERROR; - $requirements['xmlsitemap_directory']['description'] = $t('The following directories were not found or are not writable by the server. See @docpage for more information. !directories', array( - '!directories' => theme('item_list', array( - 'items' => array_keys($directories), - )), '@docpage' => 'https://www.drupal.org/node/244924', - )); - } - } - - // The maximum number of links in a sitemap. - $max_links = db_query("SELECT MAX(links) FROM {xmlsitemap_sitemap}")->fetchField(); - $max_links_limit = XMLSITEMAP_MAX_SITEMAP_LINKS * XMLSITEMAP_MAX_SITEMAP_LINKS; - if ($max_links > $max_links_limit) { - $requirements['xmlsitemap_link_count'] = array( - 'title' => $t('XML sitemap link count'), - 'value' => $max_links, - 'description' => $t('You have exceeded the number of links that your sitemap can contain (@num).', array('@num' => number_format($max_links))), - 'severity' => REQUIREMENT_ERROR, - ); - } - - // The maximum number of chunks in a sitemap. - $max_chunks = db_query("SELECT MAX(chunks) FROM {xmlsitemap_sitemap}")->fetchField(); - if ($max_chunks > XMLSITEMAP_MAX_SITEMAP_LINKS) { - $requirements['xmlsitemap_chunk_count'] = array( - 'title' => $t('XML sitemap page count'), - 'value' => $max_chunks, - 'description' => $t('You have exceeded the number of sitemap pages (@number).', array('@number' => number_format(XMLSITEMAP_MAX_SITEMAP_LINKS))), - 'severity' => REQUIREMENT_ERROR, - ); - if (!in_array(xmlsitemap_get_chunk_size(), array(50000, 'auto'))) { - $requirements['xmlsitemap_chunk_count']['description'] .= ' ' . t('Please increase the number of links per page.'); - } - } - - // Check maximum file size. - $max_filesize = db_query("SELECT MAX(max_filesize) FROM {xmlsitemap_sitemap}")->fetchField(); - $requirements['xmlsitemap_file_size'] = array( - 'title' => $t('XML sitemap maximum file size'), - 'value' => format_size($max_filesize), - ); - if ($max_filesize > XMLSITEMAP_MAX_SITEMAP_FILESIZE) { - $requirements['xmlsitemap_file_size']['description'] = $t('You have exceeded the maximum sitemap file size of @size. If possible, decrease the number of links per sitemap page.', array('@size' => format_size(XMLSITEMAP_MAX_SITEMAP_FILESIZE))); - $requirements['xmlsitemap_file_size']['severity'] = REQUIREMENT_ERROR; - } - elseif (!variable_get('xmlsitemap_developer_mode', 0)) { - unset($requirements['xmlsitemap_file_size']); - } - - // Check when the cached files were last generated. - $generated_last = variable_get('xmlsitemap_generated_last', 0); - $generated_ago = REQUEST_TIME - $generated_last; - $requirements['xmlsitemap_generated'] = array( - 'title' => $t('XML sitemap'), - 'value' => $generated_last ? $t('Last attempted generation on !date (!interval ago).', array( - '!date' => format_date($generated_last, 'small'), - '!interval' => format_interval($generated_ago), - )) : $t('Cached files have not been generated yet.'), - 'severity' => REQUIREMENT_OK, - ); - if (variable_get('xmlsitemap_rebuild_needed', FALSE) && _xmlsitemap_rebuild_form_access()) { - $requirements['xmlsitemap_generated']['severity'] = REQUIREMENT_ERROR; - $requirements['xmlsitemap_generated']['description'] = $t('The XML sitemap data is out of sync and needs to be completely rebuilt.', array('@link-rebuild' => url('admin/config/search/xmlsitemap/rebuild'))); - } - elseif (variable_get('xmlsitemap_regenerate_needed', FALSE)) { - if ($max_filesize == 0) { - // A maximum sitemap file size of 0 indicates an error in generation. - $requirements['xmlsitemap_generated']['severity'] = REQUIREMENT_ERROR; - } - elseif ($generated_ago >= variable_get('cron_threshold_error', 1209600)) { - $requirements['xmlsitemap_generated']['severity'] = REQUIREMENT_ERROR; - } - elseif ($generated_ago >= variable_get('cron_threshold_warning', 172800)) { - $requirements['xmlsitemap_generated']['severity'] = REQUIREMENT_WARNING; - } - if ($requirements['xmlsitemap_generated']['severity']) { - $requirements['xmlsitemap_generated']['description'] = $t('The XML cached files are out of date and need to be regenerated. You can run cron manually to regenerate the sitemap files.', array('@link-cron' => url('admin/reports/status/run-cron', array('query' => drupal_get_destination())))); - } - } - } - - return $requirements; -} - -/** - * Implements hook_schema(). - */ -function xmlsitemap_schema() { - // @todo Rename to xmlsitemap_link - $schema['xmlsitemap'] = array( - 'description' => 'The base table for xmlsitemap links.', - 'fields' => array( - 'id' => array( - 'description' => 'Primary key with type; a unique id for the item.', - 'type' => 'int', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'default' => 0, - ), - 'type' => array( - 'description' => 'Primary key with id; the type of item (e.g. node, user, etc.).', - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - 'default' => '', - ), - 'subtype' => array( - 'description' => 'A sub-type identifier for the link (node type, menu name, term VID, etc.).', - 'type' => 'varchar', - 'length' => 128, - 'not null' => TRUE, - 'default' => '', - ), - 'loc' => array( - 'description' => 'The URL to the item relative to the Drupal path.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - ), - 'language' => array( - 'description' => 'The {languages}.language of this link or an empty string if it is language-neutral.', - 'type' => 'varchar', - 'length' => 12, - 'not null' => TRUE, - 'default' => '', - ), - 'access' => array( - 'description' => 'A boolean that represents if the item is viewable by the anonymous user. This field is useful to store the result of node_access() so we can retain changefreq and priority_override information.', - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'default' => 1, - ), - 'status' => array( - 'description' => 'An integer that represents if the item is included in the sitemap.', - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'default' => 1, - ), - 'status_override' => array( - 'description' => 'A boolean that if TRUE means that the status field has been overridden from its default value.', - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'default' => 0, - ), - 'lastmod' => array( - 'description' => 'The UNIX timestamp of last modification of the item.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - 'priority' => array( - 'description' => 'The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0.', - 'type' => 'float', - 'default' => NULL, - // @todo Convert this field to non-nullable. - // 'default' => 0.5, - // 'not null' => NULL, - ), - 'priority_override' => array( - 'description' => 'A boolean that if TRUE means that the priority field has been overridden from its default value.', - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'default' => 0, - ), - 'changefreq' => array( - 'description' => 'The average time in seconds between changes of this item.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - 'changecount' => array( - 'description' => 'The number of times this item has been changed. Used to help calculate the next changefreq value.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - ), - 'primary key' => array('id', 'type'), - 'indexes' => array( - 'loc' => array('loc'), - 'access_status_loc' => array('access', 'status', 'loc'), - 'type_subtype' => array('type', 'subtype'), - 'language' => array('language'), - ), - ); - - $schema['xmlsitemap_sitemap'] = array( - 'fields' => array( - 'smid' => array( - 'description' => 'The sitemap ID (the hashed value of {xmlsitemap}.context.', - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ), - 'context' => array( - 'description' => 'Serialized array with the sitemaps context', - 'type' => 'text', - 'not null' => TRUE, - 'serialize' => TRUE, - ), - 'updated' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - 'links' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - 'chunks' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - 'max_filesize' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - // @codingStandardsIgnoreStart - // 'queued' => array( - // 'type' => 'int', - // 'unsigned' => TRUE, - // 'not null' => TRUE, - // 'default' => 0, - // 'description' => 'Time when this sitemap was queued for regeneration, 0 if not queued.', - // ),. - // @codingStandardsIgnoreEnd - ), - 'primary key' => array('smid'), - ); - - return $schema; -} - -/** - * Implements hook_install(). - */ -function xmlsitemap_install() { - // Set this module's weight to 1 so xmlsitemap_cron() runs after all other - // xmlsitemap_x_cron() runs. - db_update('system') - ->fields(array('weight' => 1)) - ->condition('type', 'module') - ->condition('name', 'xmlsitemap') - ->execute(); - - // Load the module. - drupal_load('module', 'xmlsitemap'); - - // Insert the homepage link into the {xmlsitemap} table so we do not show an - // empty sitemap after install. - db_insert('xmlsitemap') - ->fields(array( - 'type' => 'frontpage', - 'id' => 0, - 'loc' => '', - 'priority' => variable_get('xmlsitemap_frontpage_priority', 1.0), - 'changefreq' => variable_get('xmlsitemap_frontpage_changefreq', XMLSITEMAP_FREQUENCY_DAILY), - 'language' => LANGUAGE_NONE, - )) - ->execute(); - - // Insert the default context sitemap. - $context = array(); - db_insert('xmlsitemap_sitemap') - ->fields(array( - 'smid' => xmlsitemap_sitemap_get_context_hash($context), - 'context' => serialize($context), - )) - ->execute(); - - // @todo Does the sitemap show up on first install or is it a 404 page? - - // Create the link process the queue. - /** @var DrupalReliableQueueInterface $queue */ - $queue = DrupalQueue::get('xmlsitemap_link_process', TRUE); - $queue->createQueue(); -} - -/** - * Implements hook_enable(). - */ -function xmlsitemap_enable() { - // Ensure the file cache directory is available and ready. - xmlsitemap_check_directory(); - - variable_set('xmlsitemap_regenerate_needed', TRUE); -} - -/** - * Implements hook_uninstall(). - */ -function xmlsitemap_uninstall() { - // Remove variables. - drupal_load('module', 'xmlsitemap'); - $variables = array_keys(xmlsitemap_variables()); - foreach ($variables as $variable) { - variable_del($variable); - } - - // Remove the file cache directory. - xmlsitemap_clear_directory(NULL, TRUE); - - // Remove the queue. - /** @var DrupalReliableQueueInterface $queue */ - $queue = DrupalQueue::get('xmlsitemap_link_process', TRUE); - $queue->deleteQueue(); -} - -/** - * Implements hook_update_last_removed(). - */ -function xmlsitemap_update_last_removed() { - return 6201; -} - -/** - * Create the {xmlsitemap_sitemap} table and add the sitemap context data. - */ -function xmlsitemap_update_6202() { - if (!db_table_exists('xmlsitemap_sitemap')) { - $schema['xmlsitemap_sitemap'] = array( - 'fields' => array( - 'smid' => array( - 'description' => 'Sitemap ID', - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'context_hash' => array( - 'description' => 'The MD5 hash of the context field.', - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - 'default' => '', - ), - 'context' => array( - 'description' => 'Serialized array with the sitemaps context', - 'type' => 'text', - 'not null' => TRUE, - ), - 'updated' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - 'links' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - 'chunks' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - ), - 'primary key' => array('smid'), - 'unique keys' => array( - 'context_hash' => array('context_hash'), - ), - ); - db_create_table('xmlsitemap_sitemap', $schema['xmlsitemap_sitemap']); - } - - // Add the default sitemap(s) and use language contexts if possible. - if (!db_query_range("SELECT 1 FROM {xmlsitemap_sitemap}", 0, 1)->fetchField()) { - // Refresh the schema and load the module if it's disabled. - drupal_get_schema(NULL, TRUE); - drupal_load('module', 'xmlsitemap'); - - if (module_exists('xmlsitemap_i18n') && $languages = variable_get('xmlsitemap_languages', array())) { - foreach ($languages as $language) { - $sitemap = new stdClass(); - $sitemap->context = array('language' => $language); - xmlsitemap_sitemap_save($sitemap); - } - } - else { - $sitemap = new stdClass(); - $sitemap->context = array(); - xmlsitemap_sitemap_save($sitemap); - } - } - - // Language variable is no longer needed, so go ahead and delete it. - variable_del('xmlsitemap_languages'); - - // Ensure that the sitemaps will be refreshed on next cron. - variable_set('xmlsitemap_generated_last', 0); - variable_set('xmlsitemap_regenerate_needed', TRUE); -} - -/** - * Implements hook_update_N(). - * - * Convert the xmlsitemap_max_filesize variable to a max_filesize column - * per-sitemap. - */ -function xmlsitemap_update_6203() { - if (db_field_exists('xmlsitemap_sitemap', 'max_filesize')) { - return; - } - - // Add the max_filesize column. - $field = array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ); - db_add_field('xmlsitemap_sitemap', 'max_filesize', $field); - - // Scan each sitemap directory for the largest file. - drupal_load('module', 'xmlsitemap'); - $sitemaps = xmlsitemap_sitemap_load_multiple(FALSE); - foreach ($sitemaps as $sitemap) { - xmlsitemap_sitemap_get_max_filesize($sitemap); - db_update('xmlsitemap_sitemap') - ->fields(array('max_filesize' => $sitemap->max_filesize)) - ->condition('smid', $sitemap->smid) - ->execute(); - } - - variable_del('xmlsitemap_max_filesize'); - variable_del('xmlsitemap_max_chunks'); -} - -/** - * Convert {xmlsitemap}.context_hash to replace {xmlsitemap}.smid. - */ -function xmlsitemap_update_6204() { - if (db_field_exists('xmlsitemap_sitemap', 'context_hash')) { - db_drop_unique_key('xmlsitemap_sitemap', 'context_hash'); - db_drop_field('xmlsitemap_sitemap', 'smid'); - - // Rename context_hash to the new smid column. - $smid_field = array( - 'description' => 'The sitemap ID (the hashed value of {xmlsitemap}.context.', - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ); - db_change_field('xmlsitemap_sitemap', 'context_hash', 'smid', $smid_field); - - // Re-add the primary key now that the smid field is changed. - // We don't need to drop the primary key since we already dropped the field - // that was the primary key. - db_add_primary_key('xmlsitemap_sitemap', array('smid')); - } - - _xmlsitemap_sitemap_rehash_all(); -} - -/** - * Update empty string languages to LANGUAGE_NONE. - */ -function xmlsitemap_update_7200() { - db_update('xmlsitemap') - ->fields(array('language' => LANGUAGE_NONE)) - ->condition('language', '') - ->execute(); -} - -/** - * Re-run xmlsitemap_update_6202() to ensure sitemap data has been added. - */ -function xmlsitemap_update_7201() { - xmlsitemap_update_6202(); -} - -/** - * Implements hook_update_N(). - * - * Convert the xmlsitemap_max_filesize variable to a max_filesize column - * per-sitemap. - */ -function xmlsitemap_update_7202() { - xmlsitemap_update_6203(); -} - -/** - * Convert {xmlsitemap}.context_hash to replace {xmlsitemap}.smid. - */ -function xmlsitemap_update_7203() { - xmlsitemap_update_6204(); - _xmlsitemap_sitemap_rehash_all(); -} - -/** - * Rehash all. - */ -function _xmlsitemap_sitemap_rehash_all() { - // Reload the schema cache and reprocess all sitemap hashes into smids. - drupal_load('module', 'xmlsitemap'); - drupal_get_schema(NULL, TRUE); - - // Force a rehash of all sitemaps. - $sitemaps = xmlsitemap_sitemap_load_multiple(FALSE); - foreach ($sitemaps as $sitemap) { - $hash = xmlsitemap_sitemap_get_context_hash($sitemap->context); - if ($hash != $sitemap->smid) { - xmlsitemap_sitemap_save($sitemap); - } - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.js b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.js deleted file mode 100644 index 06b92bcdae..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.js +++ /dev/null @@ -1,22 +0,0 @@ - -(function ($) { - -Drupal.behaviors.xmlsitemapFieldsetSummaries = { - attach: function (context) { - $('fieldset#edit-xmlsitemap', context).drupalSetSummary(function (context) { - var vals = []; - - // Inclusion select field. - var status = $('#edit-xmlsitemap-status option:selected').text(); - vals.push(Drupal.t('Inclusion: @value', { '@value': status })); - - // Priority select field. - var priority = $('#edit-xmlsitemap-priority option:selected').text(); - vals.push(Drupal.t('Priority: @value', { '@value': priority })); - - return vals.join('
'); - }); - } -}; - -})(jQuery); diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module deleted file mode 100644 index d2fbd08884..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module +++ /dev/null @@ -1,1729 +0,0 @@ - $info) { - $hooks[$hook] = array('group' => 'xmlsitemap'); - } - - return $hooks; -} - -/** - * Implements hook_help(). - */ -function xmlsitemap_help($path, $arg) { - $output = ''; - - switch ($path) { - case 'admin/help/xmlsitemap': - case 'admin/config/search/xmlsitemap/settings/%/%/%': - case 'admin/config/search/xmlsitemap/edit/%': - case 'admin/config/search/xmlsitemap/delete/%': - return; - - case 'admin/help#xmlsitemap': - break; - - case 'admin/config/search/xmlsitemap': - break; - - case 'admin/config/search/xmlsitemap/rebuild': - $output .= '

' . t("This action rebuilds your site's XML sitemap and regenerates the cached files, and may be a lengthy process. If you just installed XML sitemap, this can be helpful to import all your site's content into the sitemap. Otherwise, this should only be used in emergencies.") . '

'; - } - - if (arg(0) == 'admin' && strpos($path, 'xmlsitemap') !== FALSE && user_access('administer xmlsitemap')) { - module_load_include('inc', 'xmlsitemap'); - if ($arg[1] == 'config') { - // Alert the user to any potential problems detected by hook_requirements. - xmlsitemap_check_status(); - } - $output .= _xmlsitemap_get_blurb(); - } - - return $output; -} - -/** - * Implements hook_perm(). - */ -function xmlsitemap_permission() { - $permissions['administer xmlsitemap'] = array( - 'title' => t('Administer XML sitemap settings'), - ); - $permissions['use xmlsitemap'] = array( - 'title' => t('Use XML sitemap'), - 'description' => t('Users can change individually the default XML Sitemap settings.'), - ); - return $permissions; -} - -/** - * Implements hook_menu(). - */ -function xmlsitemap_menu() { - $items['admin/config/search/xmlsitemap'] = array( - 'title' => 'XML sitemap', - 'description' => "Configure your site's XML sitemaps to help search engines find and index pages on your site.", - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_sitemap_list_form'), - 'access arguments' => array('administer xmlsitemap'), - 'file' => 'xmlsitemap.admin.inc', - ); - $items['admin/config/search/xmlsitemap/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/config/search/xmlsitemap/add'] = array( - 'title' => 'Add new XML sitemap', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_sitemap_edit_form'), - 'access arguments' => array('administer xmlsitemap'), - 'type' => MENU_LOCAL_ACTION, - 'file' => 'xmlsitemap.admin.inc', - 'modal' => TRUE, - 'options' => array('modal' => TRUE), - ); - $items['admin/config/search/xmlsitemap/edit/%xmlsitemap_sitemap'] = array( - 'title' => 'Edit XML sitemap', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_sitemap_edit_form', 5), - 'access arguments' => array('administer xmlsitemap'), - 'file' => 'xmlsitemap.admin.inc', - 'modal' => TRUE, - ); - $items['admin/config/search/xmlsitemap/delete/%xmlsitemap_sitemap'] = array( - 'title' => 'Delete XML sitemap', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_sitemap_delete_form', 5), - 'access arguments' => array('administer xmlsitemap'), - 'file' => 'xmlsitemap.admin.inc', - 'modal' => TRUE, - ); - - $items['admin/config/search/xmlsitemap/settings'] = array( - 'title' => 'Settings', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_settings_form'), - 'access arguments' => array('administer xmlsitemap'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'xmlsitemap.admin.inc', - 'weight' => 10, - ); - $items['admin/config/search/xmlsitemap/settings/%xmlsitemap_link_bundle/%'] = array( - 'load arguments' => array(6), - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_link_bundle_settings_form', 5), - 'access callback' => 'xmlsitemap_link_bundle_access', - 'access arguments' => array(5), - 'file' => 'xmlsitemap.admin.inc', - 'modal' => TRUE, - ); - - $items['admin/config/search/xmlsitemap/rebuild'] = array( - 'title' => 'Rebuild links', - 'description' => 'Rebuild the site map.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_rebuild_form'), - 'access callback' => '_xmlsitemap_rebuild_form_access', - 'type' => MENU_LOCAL_TASK, - 'file' => 'xmlsitemap.admin.inc', - 'weight' => 20, - ); - - $items['sitemap.xml'] = array( - 'page callback' => 'xmlsitemap_output_chunk', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - 'file' => 'xmlsitemap.pages.inc', - ); - $items['sitemap.xsl'] = array( - 'page callback' => 'xmlsitemap_output_xsl', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - 'file' => 'xmlsitemap.pages.inc', - ); - - return $items; -} - -/** - * Menu access callback; determines if the user can use the rebuild links page. - */ -function _xmlsitemap_rebuild_form_access() { - module_load_include('generate.inc', 'xmlsitemap'); - $rebuild_types = xmlsitemap_get_rebuildable_link_types(); - return !empty($rebuild_types) && user_access('administer xmlsitemap'); -} - -/** - * Implements hook_cron(). - * - * @todo Use new Queue system. Need to add {sitemap}.queued. - * @todo Regenerate one at a time? - */ -function xmlsitemap_cron() { - // If there were no new or changed links, skip. - if (!variable_get('xmlsitemap_regenerate_needed', FALSE)) { - return; - } - // If cron sitemap file regeneration is disabled, stop. - if (variable_get('xmlsitemap_disable_cron_regeneration', 0)) { - return; - } - - // If the minimum sitemap lifetime hasn't been passed, skip. - $lifetime = REQUEST_TIME - variable_get('xmlsitemap_generated_last', 0); - if ($lifetime < variable_get('xmlsitemap_minimum_lifetime', 0)) { - return; - } - - // Regenerate the sitemap XML files. - module_load_include('generate.inc', 'xmlsitemap'); - xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch'); -} - -/** - * Implements hook_modules_enabled(). - */ -function xmlsitemap_modules_enabled(array $modules) { - cache_clear_all('xmlsitemap:', 'cache', TRUE); -} - -/** - * Implements hook_modules_disabled(). - */ -function xmlsitemap_modules_disabled(array $modules) { - cache_clear_all('xmlsitemap:', 'cache', TRUE); -} - -/** - * Implements hook_robotstxt(). - */ -function xmlsitemap_robotstxt() { - if ($sitemap = xmlsitemap_sitemap_load_by_context()) { - $robotstxt[] = 'Sitemap: ' . url($sitemap->uri['path'], $sitemap->uri['options']); - return $robotstxt; - } -} - -/** - * Internal default variables for xmlsitemap_var(). - */ -function xmlsitemap_variables() { - global $base_url; - return array( - 'xmlsitemap_rebuild_needed' => FALSE, - 'xmlsitemap_regenerate_needed' => FALSE, - 'xmlsitemap_minimum_lifetime' => 0, - 'xmlsitemap_generated_last' => 0, - 'xmlsitemap_xsl' => 1, - 'xmlsitemap_prefetch_aliases' => 1, - 'xmlsitemap_chunk_size' => 'auto', - 'xmlsitemap_batch_limit' => 100, - 'xmlsitemap_path' => 'xmlsitemap', - 'xmlsitemap_base_url' => $base_url, - 'xmlsitemap_developer_mode' => 0, - 'xmlsitemap_frontpage_priority' => 1.0, - 'xmlsitemap_frontpage_changefreq' => XMLSITEMAP_FREQUENCY_DAILY, - 'xmlsitemap_lastmod_format' => XMLSITEMAP_LASTMOD_MEDIUM, - 'xmlsitemap_gz' => FALSE, - 'xmlsitemap_disable_cron_regeneration' => 0, - 'xmlsitemap_output_elements' => array('lastmod', 'changefreq', 'priority'), - // Removed variables are set to NULL so they can still be deleted. - 'xmlsitemap_regenerate_last' => NULL, - 'xmlsitemap_custom_links' => NULL, - 'xmlsitemap_priority_default' => NULL, - 'xmlsitemap_languages' => NULL, - 'xmlsitemap_max_chunks' => NULL, - 'xmlsitemap_max_filesize' => NULL, - ); -} - -/** - * Internal implementation of variable_get(). - */ -function xmlsitemap_var($name, $default = NULL) { - $defaults = &drupal_static(__FUNCTION__); - if (!isset($defaults)) { - $defaults = xmlsitemap_variables(); - } - - $name = 'xmlsitemap_' . $name; - - // @todo Remove when stable. - if (!isset($defaults[$name])) { - trigger_error(strtr('Default variable for %variable not found.', array('%variable' => drupal_placeholder($name)))); - } - - return variable_get($name, isset($default) || !isset($defaults[$name]) ? $default : $defaults[$name]); -} - -/** - * @defgroup xmlsitemap_api XML sitemap API. - * @{ - * This is the XML sitemap API to be used by modules wishing to work with - * XML sitemap and/or link data. - */ - -/** - * Load an XML sitemap array from the database. - * - * @param array $smid - * An XML sitemap ID. - * - * @return object - * The XML sitemap object. - * - * @codingStandardsIgnoreStart - */ -function xmlsitemap_sitemap_load($smid) { - // @codingStandardsIgnoreEnd - $sitemap = xmlsitemap_sitemap_load_multiple(array($smid)); - return $sitemap ? reset($sitemap) : FALSE; -} - -/** - * Load multiple XML sitemaps from the database. - * - * @param array $smids - * An array of XML sitemap IDs, or FALSE to load all XML sitemaps. - * @param array $conditions - * An array of conditions in the form 'field' => $value. - * - * @return array - * An array of XML sitemap objects. - * - * @codingStandardsIgnoreStart - */ -function xmlsitemap_sitemap_load_multiple($smids = array(), array $conditions = array()) { - // @codingStandardsIgnoreEnd - if ($smids !== FALSE) { - $conditions['smid'] = $smids; - } - - $query = db_select('xmlsitemap_sitemap'); - $query->fields('xmlsitemap_sitemap'); - foreach ($conditions as $field => $value) { - $query->condition($field, $value); - } - - $sitemaps = $query->execute()->fetchAllAssoc('smid'); - foreach ($sitemaps as $smid => $sitemap) { - $sitemaps[$smid]->context = unserialize($sitemap->context); - $sitemaps[$smid]->uri = xmlsitemap_sitemap_uri($sitemaps[$smid]); - } - - return $sitemaps; -} - -/** - * Load an XML sitemap array from the database based on its context. - * - * @param array $context - * An optional XML sitemap context array to use to find the correct XML - * sitemap. If not provided, the current site's context will be used. - * - * @see xmlsitemap_get_current_context() - */ -function xmlsitemap_sitemap_load_by_context(array $context = NULL) { - if (!isset($context)) { - $context = xmlsitemap_get_current_context(); - } - $hash = xmlsitemap_sitemap_get_context_hash($context); - $smid = db_query_range("SELECT smid FROM {xmlsitemap_sitemap} WHERE smid = :hash", 0, 1, array(':hash' => $hash))->fetchField(); - return xmlsitemap_sitemap_load($smid); -} - -/** - * Save changes to an XML sitemap or add a new XML sitemap. - * - * @param object $sitemap - * The XML sitemap array to be saved. If $sitemap->smid is omitted, a new - * XML sitemap will be added. - * - * @todo Save the sitemap's URL as a column? - */ -function xmlsitemap_sitemap_save(stdClass $sitemap) { - if (!isset($sitemap->context)) { - $sitemap->context = array(); - } - - // Make sure context is sorted before saving the hash. - $sitemap->is_new = empty($sitemap->smid); - $sitemap->old_smid = $sitemap->is_new ? NULL : $sitemap->smid; - $sitemap->smid = xmlsitemap_sitemap_get_context_hash($sitemap->context); - - // If the context was changed, we need to perform additional actions. - if (!$sitemap->is_new && $sitemap->smid != $sitemap->old_smid) { - // Rename the files directory so the sitemap does not break. - $old_sitemap = (object) array('smid' => $sitemap->old_smid); - $old_dir = xmlsitemap_get_directory($old_sitemap); - $new_dir = xmlsitemap_get_directory($sitemap); - xmlsitemap_directory_move($old_dir, $new_dir); - - // Change the smid field so drupal_write_record() does not fail. - db_update('xmlsitemap_sitemap') - ->fields(array('smid' => $sitemap->smid)) - ->condition('smid', $sitemap->old_smid) - ->execute(); - - // Mark the sitemaps as needing regeneration. - variable_set('xmlsitemap_regenerate_needed', TRUE); - } - - if ($sitemap->is_new) { - drupal_write_record('xmlsitemap_sitemap', $sitemap); - module_invoke_all('xmlsitemap_sitemap_insert', $sitemap); - } - else { - drupal_write_record('xmlsitemap_sitemap', $sitemap, array('smid')); - module_invoke_all('xmlsitemap_sitemap_update', $sitemap); - } - - return $sitemap; -} - -/** - * Delete an XML sitemap. - * - * @param array $smid - * An XML sitemap ID. - * - * @codingStandardsIgnoreStart - */ -function xmlsitemap_sitemap_delete($smid) { - // @codingStandardsIgnoreEnd - xmlsitemap_sitemap_delete_multiple(array($smid)); -} - -/** - * Delete multiple XML sitemaps. - * - * @param array $smids - * An array of XML sitemap IDs. - */ -function xmlsitemap_sitemap_delete_multiple(array $smids) { - if (!empty($smids)) { - $sitemaps = xmlsitemap_sitemap_load_multiple($smids); - db_delete('xmlsitemap_sitemap') - ->condition('smid', $smids) - ->execute(); - - foreach ($sitemaps as $sitemap) { - xmlsitemap_clear_directory($sitemap, TRUE); - module_invoke_all('xmlsitemap_sitemap_delete', $sitemap); - } - } -} - -/** - * Return the expected file path for a specific sitemap chunk. - * - * @param object $sitemap - * An XML sitemap array. - * @param string $chunk - * An optional specific chunk in the sitemap. Defaults to the index page. - */ -function xmlsitemap_sitemap_get_file(stdClass $sitemap, $chunk = 'index') { - return xmlsitemap_get_directory($sitemap) . "/{$chunk}.xml"; -} - -/** - * Find the maximum file size of all a sitemap's XML files. - * - * @param object $sitemap - * The XML sitemap array. - */ -function xmlsitemap_sitemap_get_max_filesize(stdClass $sitemap) { - $dir = xmlsitemap_get_directory($sitemap); - $sitemap->max_filesize = 0; - foreach (file_scan_directory($dir, '/\.xml$/') as $file) { - $sitemap->max_filesize = max($sitemap->max_filesize, filesize($file->uri)); - } - return $sitemap->max_filesize; -} - -/** - * Get context. - */ -function xmlsitemap_sitemap_get_context_hash(array &$context) { - asort($context); - return drupal_hash_base64(serialize($context)); -} - -/** - * Returns the uri elements of an XML sitemap. - * - * @param object $sitemap - * An unserialized data array for an XML sitemap. - * - * @return array - * An array containing the 'path' and 'options' keys used to build the uri of - * the XML sitemap, and matching the signature of url(). - */ -function xmlsitemap_sitemap_uri(stdClass $sitemap) { - global $base_url; - $uri['path'] = 'sitemap.xml'; - $uri['options'] = module_invoke_all('xmlsitemap_context_url_options', $sitemap->context); - drupal_alter('xmlsitemap_context_url_options', $uri['options'], $sitemap->context); - $uri['options'] += array( - 'absolute' => TRUE, - 'base_url' => variable_get('xmlsitemap_base_url', $base_url), - ); - return $uri; -} - -/** - * Load a specific sitemap link from the database. - * - * @param string $entity_type - * A string with the entity type. - * @param int $entity_id - * An integer with the entity ID. - * - * @return array - * A sitemap link (array) or FALSE if the conditions were not found. - */ -function xmlsitemap_link_load($entity_type, $entity_id) { - $link = xmlsitemap_link_load_multiple(array('type' => $entity_type, 'id' => $entity_id)); - return $link ? reset($link) : FALSE; -} - -/** - * Load sitemap links from the database. - * - * @param array $conditions - * An array of conditions on the {xmlsitemap} table in the form - * 'field' => $value. - * - * @return array - * An array of sitemap link arrays. - */ -function xmlsitemap_link_load_multiple(array $conditions = array()) { - $query = db_select('xmlsitemap'); - $query->fields('xmlsitemap'); - - foreach ($conditions as $field => $value) { - $query->condition($field, $value); - } - - $links = $query->execute()->fetchAll(PDO::FETCH_ASSOC); - - return $links; -} - -/** - * Presave a sitemap link. - * - * @param array $link - * An array with a sitemap link. - * @param array $context - * An optional context array containing data related to the link. - */ -function xmlsitemap_link_presave(array $link, array $context = array()) { - // Force link access to 0 in presave so that the link is saved with revoked - // access until the node permissions are checked in the cron. - $link['access'] = 0; - - // Allow other modules to alter the sitemap link presave. - drupal_alter('xmlsitemap_link_presave', $link, $context); - - // Save or update a sitemap link which will be overwritten in Drupal cron job. - xmlsitemap_link_save($link, $context); -} - -/** - * Saves or updates a sitemap link. - * - * @param array $link - * An array with a sitemap link. - * @param array $context - * An optional context array containing data related to the link. - * - * @return array - * The saved sitemap link. - */ -function xmlsitemap_link_save(array $link, array $context = array()) { - $link += array( - 'access' => 1, - 'status' => 1, - 'status_override' => 0, - 'lastmod' => 0, - 'priority' => XMLSITEMAP_PRIORITY_DEFAULT, - 'priority_override' => 0, - 'changefreq' => 0, - 'changecount' => 0, - 'language' => LANGUAGE_NONE, - ); - - // Allow other modules to alter the link before saving. - drupal_alter('xmlsitemap_link', $link, $context); - - // Temporary validation checks. - // @todo Remove in final? - if ($link['priority'] < 0 || $link['priority'] > 1) { - trigger_error(t('Invalid sitemap link priority %priority.
@link', array( - '%priority' => $link['priority'], - '@link' => var_export($link, TRUE), - )), E_USER_ERROR); - } - if ($link['changecount'] < 0) { - trigger_error(t('Negative changecount value. Please report this to @516928.
@link', array( - '@516928' => 'https://www.drupal.org/node/516928', - '@link' => var_export($link, TRUE), - )), E_USER_ERROR); - $link['changecount'] = 0; - } - - $existing = db_query_range("SELECT loc, access, status, lastmod, priority, changefreq, changecount, language FROM {xmlsitemap} WHERE type = :type AND id = :id", 0, 1, array(':type' => $link['type'], ':id' => $link['id']))->fetchAssoc(); - - // Check if this is a changed link and set the regenerate flag if necessary. - if (!variable_get('xmlsitemap_regenerate_needed', FALSE)) { - _xmlsitemap_check_changed_link($link, $existing, TRUE); - } - - // Save the link and allow other modules to respond to the link being saved. - if ($existing) { - drupal_write_record('xmlsitemap', $link, array('type', 'id')); - module_invoke_all('xmlsitemap_link_update', $link, $context); - } - else { - drupal_write_record('xmlsitemap', $link); - module_invoke_all('xmlsitemap_link_insert', $link, $context); - } - - return $link; -} - -/** - * Perform a mass update of sitemap data. - * - * If visible links are updated, this will automatically set the regenerate - * needed flag to TRUE. - * - * @param array $updates - * An array of values to update fields to, keyed by field name. - * @param array $conditions - * An array of values to match keyed by field. - * - * @return int - * The number of links that were updated. - * - * @codingStandardsIgnoreStart - */ -function xmlsitemap_link_update_multiple($updates = array(), $conditions = array(), $check_flag = TRUE) { - // @codingStandardsIgnoreEnd - // If we are going to modify a visible sitemap link, we will need to set - // the regenerate needed flag. - if ($check_flag && !variable_get('xmlsitemap_regenerate_needed', FALSE)) { - _xmlsitemap_check_changed_links($conditions, $updates, TRUE); - } - - // Process updates. - $query = db_update('xmlsitemap'); - $query->fields($updates); - foreach ($conditions as $field => $value) { - $query->condition($field, $value); - } - - return $query->execute(); -} - -/** - * Delete a specific sitemap link from the database. - * - * If a visible sitemap link was deleted, this will automatically set the - * regenerate needed flag. - * - * @param string $entity_type - * A string with the entity type. - * @param int $entity_id - * An integer with the entity ID. - * - * @return int - * The number of links that were deleted. - */ -function xmlsitemap_link_delete($entity_type, $entity_id) { - $conditions = array('type' => $entity_type, 'id' => $entity_id); - return xmlsitemap_link_delete_multiple($conditions); -} - -/** - * Delete multiple sitemap links from the database. - * - * If visible sitemap links were deleted, this will automatically set the - * regenerate needed flag. - * - * @param array $conditions - * An array of conditions on the {xmlsitemap} table in the form - * 'field' => $value. - * - * @return int - * The number of links that were deleted. - */ -function xmlsitemap_link_delete_multiple(array $conditions) { - // Because this function is called from sub-module uninstall hooks, we have - // to manually check if the table exists since it could have been removed - // in xmlsitemap_uninstall(). - // @todo Remove this check when https://www.drupal.org/node/151452 is fixed. - if (!db_table_exists('xmlsitemap')) { - return FALSE; - } - - if (!variable_get('xmlsitemap_regenerate_needed', TRUE)) { - _xmlsitemap_check_changed_links($conditions, array(), TRUE); - } - - // @todo Add a hook_xmlsitemap_link_delete() hook invoked here. - - $query = db_delete('xmlsitemap'); - foreach ($conditions as $field => $value) { - $query->condition($field, $value); - } - - return $query->execute(); -} - -/** - * Check if there is a visible sitemap link given a certain set of conditions. - * - * @param array $conditions - * An array of values to match keyed by field. - * @param string $flag - * An optional boolean that if TRUE, will set the regenerate needed flag if - * there is a match. Defaults to FALSE. - * - * @return bool - * TRUE if there is a visible link, or FALSE otherwise. - */ -function _xmlsitemap_check_changed_links(array $conditions = array(), array $updates = array(), $flag = FALSE) { - // If we are changing status or access, check for negative current values. - $conditions['status'] = (!empty($updates['status']) && empty($conditions['status'])) ? 0 : 1; - $conditions['access'] = (!empty($updates['access']) && empty($conditions['access'])) ? 0 : 1; - - $query = db_select('xmlsitemap'); - $query->addExpression('1'); - foreach ($conditions as $field => $value) { - $query->condition($field, $value); - } - $query->range(0, 1); - $changed = $query->execute()->fetchField(); - - if ($changed && $flag) { - variable_set('xmlsitemap_regenerate_needed', TRUE); - } - - return $changed; -} - -/** - * Check if there is sitemap link is changed from the existing data. - * - * @param array $link - * An array of the sitemap link. - * @param array $original_link - * An optional array of the existing data. This should only contain the - * fields necessary for comparison. If not provided the existing data will be - * loaded from the database. - * @param bool $flag - * An optional boolean that if TRUE, will set the regenerate needed flag if - * there is a match. Defaults to FALSE. - * - * @return bool - * TRUE if the link is changed, or FALSE otherwise. - * - * @codingStandardsIgnoreStart - */ -function _xmlsitemap_check_changed_link(array $link, $original_link = NULL, $flag = FALSE) { - // @codingStandardsIgnoreEnd - $changed = FALSE; - - if ($original_link === NULL) { - // Load only the fields necessary for data to be changed in the sitemap. - $original_link = db_query_range("SELECT loc, access, status, lastmod, priority, changefreq, changecount, language FROM {xmlsitemap} WHERE type = :type AND id = :id", 0, 1, array(':type' => $link['type'], ':id' => $link['id']))->fetchAssoc(); - } - - if (!$original_link) { - if ($link['access'] && $link['status']) { - // Adding a new visible link. - $changed = TRUE; - } - } - else { - if (!($original_link['access'] && $original_link['status']) && $link['access'] && $link['status']) { - // Changing a non-visible link to a visible link. - $changed = TRUE; - } - elseif ($original_link['access'] && $original_link['status'] && array_diff_assoc($original_link, $link)) { - // Changing a visible link. - $changed = TRUE; - } - } - - if ($changed && $flag) { - variable_set('xmlsitemap_regenerate_needed', TRUE); - } - - return $changed; -} - -/** - * @} End of "defgroup xmlsitemap_api" - */ -function xmlsitemap_get_directory(stdClass $sitemap = NULL) { - $directory = &drupal_static(__FUNCTION__); - - if (!isset($directory)) { - $directory = variable_get('xmlsitemap_path', 'xmlsitemap'); - } - - if (!empty($sitemap->smid)) { - return file_build_uri($directory . '/' . $sitemap->smid); - } - else { - return file_build_uri($directory); - } -} - -/** - * Check that the sitemap files directory exists and is writable. - */ -function xmlsitemap_check_directory(stdClass $sitemap = NULL) { - $directory = xmlsitemap_get_directory($sitemap); - $result = file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); - if (!$result) { - watchdog('file system', 'The directory %directory does not exist or is not writable.', array('%directory' => $directory), WATCHDOG_ERROR); - } - return $result; -} - -/** - * Check all directories. - */ -function xmlsitemap_check_all_directories() { - $directories = array(); - - $sitemaps = xmlsitemap_sitemap_load_multiple(FALSE); - foreach ($sitemaps as $smid => $sitemap) { - $directory = xmlsitemap_get_directory($sitemap); - $directories[$directory] = $directory; - } - - foreach ($directories as $directory) { - $result = file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); - if ($result) { - $directories[$directory] = TRUE; - } - else { - $directories[$directory] = FALSE; - } - } - - return $directories; -} - -/** - * Clear Directory. - */ -function xmlsitemap_clear_directory(stdClass $sitemap = NULL, $delete = FALSE) { - $directory = xmlsitemap_get_directory($sitemap); - return _xmlsitemap_delete_recursive($directory, $delete); -} - -/** - * Move a directory to a new location. - * - * @param string $old_dir - * A string specifying the filepath or URI of the original directory. - * @param string $new_dir - * A string specifying the filepath or URI of the new directory. - * @param string $replace - * Replace behavior when the destination file already exists. - * - * @return bool - * TRUE if the directory was moved successfully. FALSE otherwise. - */ -function xmlsitemap_directory_move($old_dir, $new_dir, $replace = FILE_EXISTS_REPLACE) { - $success = file_prepare_directory($new_dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); - - $old_path = drupal_realpath($old_dir); - $new_path = drupal_realpath($new_dir); - if (!is_dir($old_path) || !is_dir($new_path) || !$success) { - return FALSE; - } - - $files = file_scan_directory($old_dir, '/.*/'); - foreach ($files as $file) { - $file->uri_new = $new_dir . '/' . basename($file->filename); - $success &= (bool) file_unmanaged_move($file->uri, $file->uri_new, $replace); - } - - // The remove the directory. - $success &= drupal_rmdir($old_dir); - return $success; -} - -/** - * Recursively delete all files and folders in the specified filepath. - * - * This is a backport of Drupal 7's file_unmanaged_delete_recursive(). - * - * Note that this only deletes visible files with write permission. - * - * @param string $path - * A filepath relative to the Drupal root directory. - * @param bool $delete_root - * A boolean if TRUE will delete the $path directory afterwards. - */ -function _xmlsitemap_delete_recursive($path, $delete_root = FALSE) { - // Resolve streamwrapper URI to local path. - $path = drupal_realpath($path); - if (is_dir($path)) { - $dir = dir($path); - while (($entry = $dir->read()) !== FALSE) { - if ($entry == '.' || $entry == '..') { - continue; - } - $entry_path = $path . '/' . $entry; - file_unmanaged_delete_recursive($entry_path, TRUE); - } - $dir->close(); - return $delete_root ? drupal_rmdir($path) : TRUE; - } - return file_unmanaged_delete($path); -} - -/** - * Returns information about supported sitemap link types. - * - * @param string $type - * (optional) The link type to return information for. If omitted, - * information for all link types is returned. - * @param bool $reset - * (optional) Boolean whether to reset the static cache and do nothing. Only - * used for tests. - * - * @see hook_xmlsitemap_link_info() - * @see hook_xmlsitemap_link_info_alter() - */ -function xmlsitemap_get_link_info($type = NULL, $reset = FALSE) { - global $language; - $link_info = &drupal_static(__FUNCTION__); - - if ($reset) { - $link_info = NULL; - cache_clear_all('xmlsitemap:link_info:', 'cache', TRUE); - } - - if (!isset($link_info)) { - $cid = 'xmlsitemap:link_info:' . $language->language; - if ($cache = cache_get($cid)) { - $link_info = $cache->data; - } - else { - entity_info_cache_clear(); - $link_info = entity_get_info(); - foreach ($link_info as $key => $info) { - if (empty($info['uri callback']) || !isset($info['xmlsitemap'])) { - // Remove any non URL-able or XML sitemap un-supported entites. - unset($link_info[$key]); - } - foreach ($info['bundles'] as $bundle_key => $bundle) { - if (!isset($bundle['xmlsitemap'])) { - // Remove any un-supported entity bundles. - // unset($link_info[$key]['bundles'][$bundle_key]);. - } - } - } - $link_info = array_merge($link_info, module_invoke_all('xmlsitemap_link_info')); - foreach ($link_info as $key => &$info) { - $info += array( - 'type' => $key, - 'base table' => FALSE, - 'bundles' => array(), - 'xmlsitemap' => array(), - ); - if (!isset($info['xmlsitemap']['rebuild callback']) && !empty($info['base table']) && !empty($info['entity keys']['id']) && !empty($info['xmlsitemap']['process callback'])) { - $info['xmlsitemap']['rebuild callback'] = 'xmlsitemap_rebuild_batch_fetch'; - } - foreach ($info['bundles'] as $bundle => &$bundle_info) { - $bundle_info += array( - 'xmlsitemap' => array(), - ); - $bundle_info['xmlsitemap'] += xmlsitemap_link_bundle_load($key, $bundle, FALSE); - } - } - drupal_alter('xmlsitemap_link_info', $link_info); - ksort($link_info); - // Cache by language since this info contains translated strings. - cache_set($cid, $link_info); - } - } - - if (isset($type)) { - return isset($link_info[$type]) ? $link_info[$type] : NULL; - } - - return $link_info; -} - -/** - * Enabled Bundles. - */ -function xmlsitemap_get_link_type_enabled_bundles($entity_type) { - $bundles = array(); - $info = xmlsitemap_get_link_info($entity_type); - foreach ($info['bundles'] as $bundle => $bundle_info) { - $settings = xmlsitemap_link_bundle_load($entity_type, $bundle); - if (!empty($settings['status'])) { - // If (!empty($bundle_info['xmlsitemap']['status'])) {. - $bundles[] = $bundle; - } - } - return $bundles; -} - -/** - * Indexed Status. - */ -function xmlsitemap_get_link_type_indexed_status($entity_type, $bundle = '') { - $info = xmlsitemap_get_link_info($entity_type); - - $status['indexed'] = db_query("SELECT COUNT(id) FROM {xmlsitemap} WHERE type = :entity AND subtype = :bundle", array(':entity' => $entity_type, ':bundle' => $bundle))->fetchField(); - $status['visible'] = db_query("SELECT COUNT(id) FROM {xmlsitemap} WHERE type = :entity AND subtype = :bundle AND status = 1 AND access = 1", array(':entity' => $entity_type, ':bundle' => $bundle))->fetchField(); - - $total = new EntityFieldQuery(); - $total->entityCondition('entity_type', $entity_type); - $total->entityCondition('bundle', $bundle); - $total->entityCondition('entity_id', 0, '>'); - // $total->addTag('xmlsitemap_link_bundle_access');. - $total->addTag('xmlsitemap_link_indexed_status'); - $total->addMetaData('entity', $entity_type); - $total->addMetaData('bundle', $bundle); - $total->addMetaData('entity_info', $info); - $total->count(); - $status['total'] = $total->execute(); - - return $status; -} - -/** - * Implements hook_entity_query_alter(). - * - * @todo Remove when https://www.drupal.org/node/1054168 is fixed. - */ -function xmlsitemap_entity_query_alter($query) { - $conditions = &$query->entityConditions; - - // Alter user entity queries only. - if (isset($conditions['entity_type']) && $conditions['entity_type']['value'] == 'user' && isset($conditions['bundle'])) { - unset($conditions['bundle']); - } -} - -/** - * Budle Settings. - */ -function xmlsitemap_link_bundle_settings_save($entity, $bundle, array $settings, $update_links = TRUE) { - if ($update_links) { - $old_settings = xmlsitemap_link_bundle_load($entity, $bundle); - if ($settings['status'] != $old_settings['status']) { - xmlsitemap_link_update_multiple(array('status' => $settings['status']), array( - 'type' => $entity, - 'subtype' => $bundle, - 'status_override' => 0, - )); - } - if ($settings['priority'] != $old_settings['priority']) { - xmlsitemap_link_update_multiple(array( - 'priority' => $settings['priority'], - ), array( - 'type' => $entity, - 'subtype' => $bundle, - 'priority_override' => 0, - )); - } - } - - variable_set("xmlsitemap_settings_{$entity}_{$bundle}", $settings); - cache_clear_all('xmlsitemap:link_info:', 'cache', TRUE); - // xmlsitemap_get_link_info(NULL, TRUE);. -} - -/** - * Bundle Rename. - */ -function xmlsitemap_link_bundle_rename($entity, $bundle_old, $bundle_new) { - if ($bundle_old != $bundle_new) { - $settings = xmlsitemap_link_bundle_load($entity, $bundle_old); - variable_del("xmlsitemap_settings_{$entity}_{$bundle_old}"); - xmlsitemap_link_bundle_settings_save($entity, $bundle_new, $settings, FALSE); - xmlsitemap_link_update_multiple(array('subtype' => $bundle_new), array('type' => $entity, 'subtype' => $bundle_old)); - } -} - -/** - * Rename a link type. - */ -function xmlsitemap_link_type_rename($entity_old, $entity_new, $bundles = NULL) { - $variables = db_query("SELECT name FROM {variable} WHERE name LIKE :pattern", array(':pattern' => db_like('xmlsitemap_settings_' . $entity_old . '_') . '%'))->fetchCol(); - foreach ($variables as $variable) { - $value = variable_get($variable); - variable_del($variable); - if (isset($value)) { - $variable_new = str_replace('xmlsitemap_settings_' . $entity_old, 'xmlsitemap_settings_' . $entity_new, $variable); - variable_set($variable_new, $value); - } - } - - xmlsitemap_link_update_multiple(array('type' => $entity_new), array('type' => $entity_old), FALSE); - xmlsitemap_get_link_info(NULL, TRUE); -} - -/** - * Bundle Load. - */ -function xmlsitemap_link_bundle_load($entity, $bundle, $load_bundle_info = TRUE) { - $info = array( - 'entity' => $entity, - 'bundle' => $bundle, - ); - if ($load_bundle_info) { - $entity_info = xmlsitemap_get_link_info($entity); - if (isset($entity_info['bundles'][$bundle])) { - $info['info'] = $entity_info['bundles'][$bundle]; - } - } - $info += variable_get("xmlsitemap_settings_{$entity}_{$bundle}", array()); - $info += array( - 'status' => XMLSITEMAP_STATUS_DEFAULT, - 'priority' => XMLSITEMAP_PRIORITY_DEFAULT, - ); - return $info; -} - -/** - * Bundle Delete. - */ -function xmlsitemap_link_bundle_delete($entity, $bundle, $delete_links = TRUE) { - variable_del("xmlsitemap_settings_{$entity}_{$bundle}"); - if ($delete_links) { - xmlsitemap_link_delete_multiple(array('type' => $entity, 'subtype' => $bundle)); - } - cache_clear_all('xmlsitemap:link_info:', 'cache', TRUE); - // xmlsitemap_get_link_info(NULL, TRUE);. -} - -/** - * Bundle Access. - */ -function xmlsitemap_link_bundle_access($entity, $bundle = NULL) { - if (is_array($entity) && !isset($bundle)) { - $bundle = $entity; - } - else { - $bundle = xmlsitemap_link_bundle_load($entity, $bundle); - } - - if (isset($bundle['info']['admin'])) { - $admin = $bundle['info']['admin']; - $admin += array('access arguments' => array()); - - if (!isset($admin['access callback']) && count($admin['access arguments']) == 1) { - $admin['access callback'] = 'user_access'; - } - - if (!empty($admin['access callback'])) { - return call_user_func_array($admin['access callback'], $admin['access arguments']); - } - } - - return FALSE; -} - -/** - * Get Bundle. - */ -function xmlsitemap_get_bundle_path($entity, $bundle) { - $info = xmlsitemap_get_link_info($entity); - - if (!empty($info['bundles'][$bundle]['admin']['real path'])) { - return $info['bundles'][$bundle]['admin']['real path']; - } - elseif (!empty($info['bundles'][$bundle]['admin']['path'])) { - return $info['bundles'][$bundle]['admin']['path']; - } - else { - return FALSE; - } -} - -/** - * Implements hook_field_attach_rename_bundle(). - */ -function xmlsitemap_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) { - xmlsitemap_link_bundle_rename($entity_type, $bundle_old, $bundle_new); -} - -/** - * Implements hook_field_attach_delete_bundle(). - */ -function xmlsitemap_field_attach_delete_bundle($entity_type, $bundle, $instances) { - xmlsitemap_link_bundle_delete($entity_type, $bundle, TRUE); -} - -/** - * Determine the frequency of updates to a link. - * - * @param string $interval - * An interval value in seconds. - * - * @return string - * A string representing the update frequency according to the sitemaps.org - * protocol. - */ -function xmlsitemap_get_changefreq($interval) { - if ($interval <= 0 || !is_numeric($interval)) { - return FALSE; - } - - foreach (xmlsitemap_get_changefreq_options() as $value => $frequency) { - if ($interval <= $value) { - return $frequency; - } - } - - return 'never'; -} - -/** - * Get the current number of sitemap chunks. - */ -function xmlsitemap_get_chunk_count($reset = FALSE) { - static $chunks; - if (!isset($chunks) || $reset) { - $count = max(xmlsitemap_get_link_count($reset), 1); - $chunks = ceil($count / xmlsitemap_get_chunk_size($reset)); - } - return $chunks; -} - -/** - * Get the current number of sitemap links. - */ -function xmlsitemap_get_link_count($reset = FALSE) { - static $count; - if (!isset($count) || $reset) { - $count = db_query("SELECT COUNT(id) FROM {xmlsitemap} WHERE access = 1 AND status = 1")->fetchField(); - } - return $count; -} - -/** - * Get the sitemap chunk size. - * - * This function is useful with the chunk size is set to automatic as it will - * calculate the appropriate value. Use this function instead of @code - * xmlsitemap_var('chunk_size') @endcode when the actual value is needed. - * - * @param bool $reset - * A boolean to reset the saved, static result. Defaults to FALSE. - * - * @return int - * An integer with the number of links in each sitemap page. - */ -function xmlsitemap_get_chunk_size($reset = FALSE) { - static $size; - if (!isset($size) || $reset) { - $size = xmlsitemap_var('chunk_size'); - if ($size === 'auto') { - // Prevent divide by zero. - $count = max(xmlsitemap_get_link_count($reset), 1); - $size = min(ceil($count / 10000) * 5000, XMLSITEMAP_MAX_SITEMAP_LINKS); - } - } - return $size; -} - -/** - * Recalculate the changefreq of a sitemap link. - * - * @param array $link - * A sitemap link array. - * - * @codingStandardsIgnoreStart - */ -function xmlsitemap_recalculate_changefreq(&$link) { - // @codingStandardsIgnoreEnd - $link['changefreq'] = round((($link['changefreq'] * $link['changecount']) + (REQUEST_TIME - $link['lastmod'])) / ($link['changecount'] + 1)); - $link['changecount']++; - $link['lastmod'] = REQUEST_TIME; -} - -/** - * Calculates the average interval between UNIX timestamps. - * - * @param array $timestamps - * An array of UNIX timestamp integers. - * - * @return int - * An integer of the average interval. - * - * @codingStandardsIgnoreStart - */ -function xmlsitemap_calculate_changefreq($timestamps) { - // @codingStandardsIgnoreEnd - sort($timestamps); - $count = count($timestamps) - 1; - $diff = 0; - - for ($i = 0; $i < $count; $i++) { - $diff += $timestamps[$i + 1] - $timestamps[$i]; - } - - return $count > 0 ? round($diff / $count) : 0; -} - -/** - * Submit handler; Set the regenerate needed flag if variables have changed. - * - * This function needs to be called before system_settings_form_submit() or any - * calls to variable_set(). - */ -function xmlsitemap_form_submit_flag_regenerate($form, $form_state) { - foreach ($form_state['values'] as $variable => $value) { - $stored_value = variable_get($variable, 'not_a_variable'); - if (is_array($value) && !empty($form_state['values']['array_filter'])) { - $value = array_keys(array_filter($value)); - } - if ($stored_value != 'not_a_variable' && $stored_value != $value) { - variable_set('xmlsitemap_regenerate_needed', TRUE); - drupal_set_message(t('XML sitemap settings have been modified and the files should be regenerated. You can run cron manually to regenerate the cached files.', array('@run-cron' => url('admin/reports/status/run-cron', array('query' => drupal_get_destination())))), 'warning', FALSE); - return; - } - } -} - -/** - * Set the current user stored in $GLOBALS['user']. - * - * @todo Remove when https://www.drupal.org/node/287292 is fixed. - */ -function xmlsitemap_switch_user($new_user = NULL) { - global $user; - $user_original = &drupal_static(__FUNCTION__); - - if (!isset($new_user)) { - if (isset($user_original)) { - // Restore the original user. - $user = $user_original; - $user_original = NULL; - drupal_save_session(TRUE); - } - else { - return FALSE; - } - } - elseif (is_numeric($new_user) && $user->uid != $new_user) { - // Get the full user object. - if (!$new_user) { - $new_user = drupal_anonymous_user(); - } - elseif (!$new_user = user_load($new_user)) { - return FALSE; - } - - // Backup the original user object. - if (!isset($user_original)) { - $user_original = $user; - drupal_save_session(FALSE); - } - - $user = $new_user; - } - elseif (is_object($new_user) && $user->uid != $new_user->uid) { - // Backup the original user object. - if (!isset($user_original)) { - $user_original = $user; - drupal_save_session(FALSE); - } - - $user = $new_user; - } - else { - return FALSE; - } - - return $user; -} - -/** - * Restore the user that was originally loaded. - * - * @codingStandardsIgnoreLine - * @return object. - * Current user. - */ -function xmlsitemap_restore_user() { - return xmlsitemap_switch_user(); -} - -/** - * Form Link. - */ -function xmlsitemap_process_form_link_options($form, &$form_state) { - $link = &$form_state['values']['xmlsitemap']; - $fields = array('status' => XMLSITEMAP_STATUS_DEFAULT, 'priority' => XMLSITEMAP_PRIORITY_DEFAULT); - - if (empty($link)) { - return; - } - foreach ($fields as $field => $default) { - if ($link[$field] === 'default') { - $link[$field] = isset($link[$field . '_default']) ? $link[$field . '_default'] : $default; - $link[$field . '_override'] = 0; - } - else { - $link[$field . '_override'] = 1; - } - } -} - -/** - * Link bundle settings form submit. - */ -function xmlsitemap_link_bundle_settings_form_submit($form, &$form_state) { - $entity = $form['xmlsitemap']['#entity']; - $bundle = $form['xmlsitemap']['#bundle']; - - // Handle new bundles by fetching the proper bundle key value from the form - // state values. - if (empty($bundle)) { - $entity_info = $form['xmlsitemap']['#entity_info']; - if (isset($entity_info['bundle keys']['bundle'])) { - $bundle_key = $entity_info['bundle keys']['bundle']; - if (isset($form_state['values'][$bundle_key])) { - $bundle = $form_state['values'][$bundle_key]; - $form['xmlsitemap']['#bundle'] = $bundle; - } - } - } - - xmlsitemap_link_bundle_settings_save($entity, $bundle, $form_state['values']['xmlsitemap']); - - $entity_info = $form['xmlsitemap']['#entity_info']; - if (!empty($form['xmlsitemap']['#show_message'])) { - drupal_set_message(t('XML sitemap settings for the @bundle-label %bundle have been saved.', array('@bundle-label' => drupal_strtolower($entity_info['bundle label']), '%bundle' => $entity_info['bundles'][$bundle]['label']))); - } - - // Unset the form values since we have already saved the bundle settings and - // we don't want these values to get saved as variables in-case this form - // Also uses system_settings_form(). - unset($form_state['values']['xmlsitemap']); -} - -/** - * Get Freq. - * - * @todo Document this function. - * @todo Make these translatable - */ -function xmlsitemap_get_changefreq_options() { - return array( - XMLSITEMAP_FREQUENCY_ALWAYS => 'always', - XMLSITEMAP_FREQUENCY_HOURLY => 'hourly', - XMLSITEMAP_FREQUENCY_DAILY => 'daily', - XMLSITEMAP_FREQUENCY_WEEKLY => 'weekly', - XMLSITEMAP_FREQUENCY_MONTHLY => 'monthly', - XMLSITEMAP_FREQUENCY_YEARLY => 'yearly', - ); -} - -/** - * Load a language object by its language code. - * - * @todo Remove when https://www.drupal.org/node/660736 is fixed in Drupal core. - * - * @param string $language - * A language code. If not provided the default language will be returned. - * - * @return object - * A language object. - */ -function xmlsitemap_language_load($language = LANGUAGE_NONE) { - $languages = &drupal_static(__FUNCTION__); - - if (!isset($languages)) { - $languages = language_list(); - $languages[LANGUAGE_NONE] = NULL; - } - - return isset($languages[$language]) ? $languages[$language] : NULL; -} - -/** - * @defgroup xmlsitemap_context_api XML sitemap API for sitemap contexts. - * @{ - */ -function xmlsitemap_get_context_info($context = NULL, $reset = FALSE) { - global $language; - $info = &drupal_static(__FUNCTION__); - - if ($reset) { - $info = NULL; - } - elseif ($cached = cache_get('xmlsitemap:context_info:' . $language->language)) { - $info = $cached->data; - } - - if (!isset($info)) { - $info = module_invoke_all('xmlsitemap_context_info'); - drupal_alter('xmlsitemap_context_info', $info); - ksort($info); - // Cache by language since this info contains translated strings. - cache_set('xmlsitemap:context_info:' . $language->language, $info); - } - - if (isset($context)) { - return isset($info[$context]) ? $info[$context] : NULL; - } - - return $info; -} - -/** - * Get the sitemap context of the current request. - */ -function xmlsitemap_get_current_context() { - $context = &drupal_static(__FUNCTION__); - - if (!isset($context)) { - $context = module_invoke_all('xmlsitemap_context'); - drupal_alter('xmlsitemap_context', $context); - asort($context); - } - - return $context; -} - -/** - * Context summary. - */ -function _xmlsitemap_sitemap_context_summary(stdClass $sitemap, $context_key, array $context_info) { - $context_value = isset($sitemap->context[$context_key]) ? $sitemap->context[$context_key] : NULL; - - if (!isset($context_value)) { - return t('Default'); - } - elseif (!empty($context_info['summary callback'])) { - return $context_info['summary callback']($context_value); - } - else { - return $context_value; - } -} - -/** - * @} End of "defgroup xmlsitemap_context_api" - */ - -/** - * Run a not-progressive batch operation. - */ -function xmlsitemap_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 https://www.drupal.org/node/638712 is fixed. - $batch =& batch_get(); - $batch['progressive'] = FALSE; - - // Run the batch process. - batch_process(); - - lock_release($batch_callback); - return TRUE; -} - -/** - * Workaround for missing breadcrumbs on callback and action paths. - * - * @todo Remove when https://www.drupal.org/node/576290 is fixed. - */ -function _xmlsitemap_set_breadcrumb($path = 'admin/config/search/xmlsitemap') { - $breadcrumb = array(); - $path = explode('/', $path); - do { - $menu_path = implode('/', $path); - $menu_item = menu_get_item($menu_path); - array_unshift($breadcrumb, l($menu_item['title'], $menu_path)); - } while (array_pop($path) && !empty($path)); - array_unshift($breadcrumb, l(t('Home'), NULL)); - drupal_set_breadcrumb($breadcrumb); -} - -/** - * Get operation link. - */ -function xmlsitemap_get_operation_link($url, $options = array()) { - static $destination; - - if (!isset($destination)) { - $destination = drupal_get_destination(); - } - - $link = array('href' => $url) + $options; - - // Fetch the item's menu router link info and title. - if (!isset($link['title'])) { - $item = menu_get_item($url); - $link['title'] = $item['title']; - } - - $link += array('query' => $destination); - drupal_alter('xmlsitemap_operation_link', $link); - return $link; -} - -/** - * Implements hook_cron_queue_info(). - */ -function xmlsitemap_cron_queue_info() { - $info['xmlsitemap_link_process'] = array( - 'worker callback' => 'xmlsitemap_link_queue_process', - 'time' => 60, - ); - - return $info; -} - -/** - * Queue callback for processing sitemap links. - */ -function xmlsitemap_link_queue_process($data) { - $info = xmlsitemap_get_link_info($data['type']); - $ids = isset($data['ids']) ? $data['ids'] : array($data['id']); - if (function_exists($info['xmlsitemap']['process callback'])) { - $info['xmlsitemap']['process callback']($ids); - } -} - -/** - * Enqueue sitemap links to be updated via the xmlsitemap_link_process queue. - * - * @param string $type - * The link type. - * @param array|int $ids - * An array of link IDs or a singular link ID. - */ -function xmlsitemap_link_enqueue($type, $ids) { - $data = array(); - $data['type'] = $type; - $data['ids'] = is_array($ids) ? $ids : array($ids); - - /** @var DrupalReliableQueueInterface $queue */ - $queue = DrupalQueue::get('xmlsitemap_link_process'); - $queue->createItem($data); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.pages.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.pages.inc deleted file mode 100644 index 1b3d191ed4..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.pages.inc +++ /dev/null @@ -1,161 +0,0 @@ -chunks > 1) { - return 'index'; - } - else { - return 1; - } - } - else { - return (int) $_GET['page']; - } -} - -/** - * Output a sitemap page. - * - * @see xmlsitemap_sitemap_load_by_context() - * @see xmlsitemap_get_current_chunk() - * @see xmlsitemap_sitemap_get_file() - * @see xmlsitemap_output_file() - */ -function xmlsitemap_output_chunk() { - $sitemap = xmlsitemap_sitemap_load_by_context(); - if (!$sitemap) { - return MENU_NOT_FOUND; - } - - $chunk = xmlsitemap_get_current_chunk($sitemap); - $file = xmlsitemap_sitemap_get_file($sitemap, $chunk); - - // Provide debugging information if enabled. - if (variable_get('xmlsitemap_developer_mode', 0) && isset($_GET['debug'])) { - $output = array(); - $context = xmlsitemap_get_current_context(); - $output[] = "Current context: " . print_r($context, TRUE); - $output[] = "Sitemap: " . print_r($sitemap, TRUE); - $output[] = "Chunk: $chunk"; - $output[] = "Cache file location: $file"; - $output[] = "Cache file exists: " . (file_exists($file) ? 'Yes' : 'No'); - return implode('
', $output); - } - - return xmlsitemap_output_file($file); -} - -/** - * Output the contents of a file to the browser and check caching headers. - */ -function xmlsitemap_output_file($file, array $headers = array()) { - if (!file_exists($file) || !is_readable($file)) { - return MENU_NOT_FOUND; - } - - $mtime = filemtime($file); - $last_modified = gmdate(DATE_RFC1123, $mtime); - $etag = '"' . md5($last_modified) . '"'; - - // See if the client has provided the required HTTP headers. - $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE; - $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : FALSE; - if ($if_modified_since && $if_none_match && $if_none_match == $etag && $if_modified_since == $last_modified) { - header('HTTP/1.1 304 Not Modified'); - // All 304 responses must send an etag if the 200 response for the same - // object contained an etag. - header('Etag: ' . $etag); - exit; - } - - $headers += array( - 'Content-type' => 'text/xml; charset=utf-8', - 'Last-modified' => $last_modified, - 'Etag' => $etag, - 'Expires' => gmdate(DATE_RFC1123, $mtime + variable_get('xmlsitemap_minimum_lifetime', 0)), - 'Cache-Control' => 'must-revalidate', - 'X-Robots-Tag' => 'noindex, follow', - ); - - // Transfer the file as output. - xmlsitemap_file_transfer($file, $headers); -} - -/** - * Modified version of file_transfer() that invokes hook_exit()s afterwards. - * - * @see file_transfer() - */ -function xmlsitemap_file_transfer($uri, $headers) { - if (ob_get_level()) { - ob_end_clean(); - } - - foreach ($headers as $name => $value) { - drupal_add_http_header($name, $value); - } - drupal_send_headers(); - - // Attempt to increase time to transfer file. - drupal_set_time_limit(240); - - $scheme = variable_get('file_default_scheme', 'public'); - // Transfer file in 16 KB chunks to save memory usage. - if ($scheme && file_stream_wrapper_valid_scheme($scheme) && $fd = fopen($uri, 'rb')) { - while (!feof($fd)) { - print fread($fd, 1024 * 16); - } - fclose($fd); - // Disable session manipulation if PHP transferred a file. - drupal_save_session(FALSE); - } - else { - drupal_not_found(); - } - drupal_exit(); -} - -/** - * Output an XML transformation file for the sitemap XML. - */ -function xmlsitemap_output_xsl() { - // Read the XSL content from the file. - $module_path = drupal_get_path('module', 'xmlsitemap'); - $xsl_content = file_get_contents($module_path . '/xsl/xmlsitemap.xsl'); - - // Make sure the strings in the XSL content are translated properly. - $replacements = array( - 'Sitemap file' => t('Sitemap file'), - 'Generated by the Drupal XML sitemap.' => t('Generated by the Drupal XML sitemap.', array('@link-xmlsitemap' => 'https://www.drupal.org/project/xmlsitemap')), - 'Number of sitemaps in this index' => t('Number of sitemaps in this index'), - 'Click on the table headers to change sorting.' => t('Click on the table headers to change sorting.'), - 'Sitemap URL' => t('Sitemap URL'), - 'Last modification date' => t('Last modification date'), - 'Number of URLs in this sitemap' => t('Number of URLs in this sitemap'), - 'URL location' => t('URL location'), - 'Change frequency' => t('Change frequency'), - 'Priority' => t('Priority'), - '[jquery]' => base_path() . 'misc/jquery.js', - '[jquery-tablesort]' => base_path() . $module_path . '/xsl/jquery.tablesorter.min.js', - '[xsl-js]' => base_path() . $module_path . '/xsl/xmlsitemap.xsl.js', - '[xsl-css]' => base_path() . $module_path . '/xsl/xmlsitemap.xsl.css', - ); - $xsl_content = strtr($xsl_content, $replacements); - - // Output the XSL content. - drupal_add_http_header('Content-type', 'application/xml; charset=utf-8'); - drupal_add_http_header('X-Robots-Tag', 'noindex, follow'); - print $xsl_content; -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.test deleted file mode 100644 index 69ca587e3c..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.test +++ /dev/null @@ -1,962 +0,0 @@ -assertNoWatchdogErrors(); - - parent::tearDown(); - } - - /** - * Assert the page does not respond with the specified response code. - * - * @param string $code - * Response code. For example 200 is a successful page request. For a list - * of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. - * @param string $message - * Message to display. - * - * @return string - * Assertion result. - */ - protected function assertNoResponse($code, $message = '') { - $curl_code = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE); - $match = is_array($code) ? in_array($curl_code, $code) : $curl_code == $code; - return $this->assertFalse($match, $message ? $message : t('HTTP response not expected !code, actual !curl_code', array('!code' => $code, '!curl_code' => $curl_code)), t('Browser')); - } - - /** - * Check the files directory is created (massive fails if not done). - * - * @todo This can be removed when https://www.drupal.org/node/654752 is fixed. - */ - protected function checkFilesDirectory() { - if (!xmlsitemap_check_directory()) { - $this->fail(t('Sitemap directory was found and writable for testing.')); - } - } - - /** - * Retrieves an XML sitemap. - * - * @param array $context - * An optional array of the XML sitemap's context. - * @param array $options - * Options to be forwarded to url(). These values will be merged with, but - * always override $sitemap->uri['options']. - * @param array $headers - * An array containing additional HTTP request headers, each formatted as - * "name: value". - * - * @return string - * The retrieved HTML string, also available as $this->drupalGetContent() - */ - protected function drupalGetSitemap(array $context = array(), array $options = array(), array $headers = array()) { - $sitemap = xmlsitemap_sitemap_load_by_context($context); - if (!$sitemap) { - return $this->fail('Could not load sitemap by context.'); - } - return $this->drupalGet($sitemap->uri['path'], $options + $sitemap->uri['options'], $headers); - } - - /** - * Regenerate the sitemap by setting the regenerate flag and running cron. - */ - protected function regenerateSitemap() { - variable_set('xmlsitemap_regenerate_needed', TRUE); - variable_set('xmlsitemap_generated_last', 0); - $this->cronRun(); - $this->assertTrue(variable_get('xmlsitemap_generated_last', 0) && !variable_get('xmlsitemap_regenerate_needed', FALSE), t('XML sitemaps regenerated and flag cleared.')); - } - - /** - * Assert Sitemap Link. - */ - protected function assertSitemapLink($entity_type, $entity_id = NULL) { - if (is_array($entity_type)) { - $links = xmlsitemap_link_load_multiple($entity_type); - $link = $links ? reset($links) : FALSE; - } - else { - $link = xmlsitemap_link_load($entity_type, $entity_id); - } - $this->assertTrue(is_array($link), 'Link loaded.'); - return $link; - } - - /** - * Assert No Sitemap Link. - */ - protected function assertNoSitemapLink($entity_type, $entity_id = NULL) { - if (is_array($entity_type)) { - $links = xmlsitemap_link_load_multiple($entity_type); - $link = $links ? reset($links) : FALSE; - } - else { - $link = xmlsitemap_link_load($entity_type, $entity_id); - } - $this->assertFalse($link, 'Link not loaded.'); - return $link; - } - - /** - * Assert Sitemap Link Visible. - */ - protected function assertSitemapLinkVisible($entity_type, $entity_id) { - $link = xmlsitemap_link_load($entity_type, $entity_id); - $this->assertTrue($link && $link['access'] && $link['status'], t('Sitemap link @type @id is visible.', array('@type' => $entity_type, '@id' => $entity_id))); - } - - /** - * Assert Sitemap Link Not Visible. - */ - protected function assertSitemapLinkNotVisible($entity_type, $entity_id) { - $link = xmlsitemap_link_load($entity_type, $entity_id); - $this->assertTrue($link && !($link['access'] && $link['status']), t('Sitemap link @type @id is not visible.', array( - '@type' => $entity_type, - '@id' => $entity_id, - ))); - } - - /** - * Assert Sitemap Link Values. - */ - protected function assertSitemapLinkValues($entity_type, $entity_id, array $conditions) { - $link = xmlsitemap_link_load($entity_type, $entity_id); - - if (!$link) { - return $this->fail(t('Could not load sitemap link for @type @id.', array( - '@type' => $entity_type, - '@id' => $entity_id, - ))); - } - - foreach ($conditions as $key => $value) { - if ($value === NULL || $link[$key] === NULL) { - // For nullable fields, always check for identical values (===). - $this->assertIdentical($link[$key], $value, t('Identical values for @type @id link field @key.', array( - '@type' => $entity_type, - '@id' => $entity_id, - '@key' => $key, - ))); - } - else { - // Otherwise check simple equality (==). - $this->assertEqual($link[$key], $value, t('Equal values for @type @id link field @key.', array( - '@type' => $entity_type, - '@id' => $entity_id, - '@key' => $key, - ))); - } - } - } - - /** - * Assert Not Sitemap Link Values. - */ - protected function assertNotSitemapLinkValues($entity_type, $entity_id, array $conditions) { - $link = xmlsitemap_link_load($entity_type, $entity_id); - - if (!$link) { - return $this->fail(t('Could not load sitemap link for @type @id.', array( - '@type' => $entity_type, - '@id' => $entity_id, - ))); - } - - foreach ($conditions as $key => $value) { - if ($value === NULL || $link[$key] === NULL) { - // For nullable fields, always check for identical values (===). - $this->assertNotIdentical($link[$key], $value, t('Not identical values for @type @id link field @key.', array( - '@type' => $entity_type, - '@id' => $entity_id, - '@key' => $key, - ))); - } - else { - // Otherwise check simple equality (==). - $this->assertNotEqual($link[$key], $value, t('Not equal values for link @type @id field @key.', array( - '@type' => $entity_type, - '@id' => $entity_id, - '@key' => $key, - ))); - } - } - } - - /** - * Assert Raw Sitemap Links. - */ - protected function assertRawSitemapLinks() { - $links = func_get_args(); - foreach ($links as $link) { - $path = url($link['loc'], array('language' => xmlsitemap_language_load($link['language']), 'absolute' => TRUE)); - $this->assertRaw($link['loc'], t('Link %path found in the sitemap.', array('%path' => $path))); - } - } - - /** - * Assert No Raw Sitemap Links. - */ - protected function assertNoRawSitemapLinks() { - $links = func_get_args(); - foreach ($links as $link) { - $path = url($link['loc'], array('language' => xmlsitemap_language_load($link['language']), 'absolute' => TRUE)); - $this->assertNoRaw($link['loc'], t('Link %path not found in the sitemap.', array('%path' => $path))); - } - } - - /** - * Add Sitemap Link. - */ - protected function addSitemapLink(array $link = array()) { - $last_id = &drupal_static(__FUNCTION__, 1); - - $link += array( - 'type' => 'testing', - 'id' => $last_id, - 'access' => 1, - 'status' => 1, - ); - - // Make the default path easier to read than a random string. - $link += array('loc' => $link['type'] . '-' . $link['id']); - - $last_id = max($last_id, $link['id']) + 1; - xmlsitemap_link_save($link); - return $link; - } - - /** - * Assert Flag. - */ - protected function assertFlag($variable, $assert_value = TRUE, $reset_if_true = TRUE) { - $value = xmlsitemap_var($variable); - - if ($reset_if_true && $value) { - variable_set('xmlsitemap_' . $variable, FALSE); - } - - return $this->assertEqual($value, $assert_value, "xmlsitemap_$variable is " . ($assert_value ? 'TRUE' : 'FALSE')); - } - - /** - * Assert XML Sitemap Problems. - * - * @codingStandardsIgnoreStart - */ - protected function assertXMLSitemapProblems($problem_text = FALSE) { - // @codingStandardsIgnoreEnd - $this->drupalGet('admin/config/search/xmlsitemap'); - $this->assertText(t('One or more problems were detected with your XML sitemap configuration')); - if ($problem_text) { - $this->assertText($problem_text); - } - } - - /** - * Assert No XML Sitemap Problems. - * - * @codingStandardsIgnoreStart - */ - protected function assertNoXMLSitemapProblems() { - // @codingStandardsIgnoreEnd - $this->drupalGet('admin/config/search/xmlsitemap'); - $this->assertNoText(t('One or more problems were detected with your XML sitemap configuration')); - } - - /** - * Fetch all seen watchdog messages. - * - * @todo Add unit tests for this function. - */ - protected function getWatchdogMessages(array $conditions = array(), $reset = FALSE) { - static $seen_ids = array(); - - if (!module_exists('dblog') || $reset) { - $seen_ids = array(); - return array(); - } - - $query = db_select('watchdog'); - $query->fields('watchdog', array( - 'wid', - 'type', - 'severity', - 'message', - 'variables', - 'timestamp', - )); - foreach ($conditions as $field => $value) { - if ($field == 'variables' && !is_string($value)) { - $value = serialize($value); - } - $query->condition($field, $value); - } - if ($seen_ids) { - $query->condition('wid', $seen_ids, 'NOT IN'); - } - $query->orderBy('timestamp'); - $messages = $query->execute()->fetchAllAssoc('wid'); - - $seen_ids = array_merge($seen_ids, array_keys($messages)); - return $messages; - } - - /** - * Assert Watchdog Message. - */ - protected function assertWatchdogMessage(array $conditions, $message = 'Watchdog message found.') { - $this->assertTrue($this->getWatchdogMessages($conditions), $message); - } - - /** - * Assert No Watchdog Message. - */ - protected function assertNoWatchdogMessage(array $conditions, $message = 'Watchdog message not found.') { - $this->assertFalse($this->getWatchdogMessages($conditions), $message); - } - - /** - * Check that there were no watchdog errors or worse. - */ - protected function assertNoWatchdogErrors() { - $messages = $this->getWatchdogMessages(); - $verbose = array(); - - foreach ($messages as $message) { - $message->text = $this->formatWatchdogMessage($message); - if (in_array($message->severity, array( - WATCHDOG_EMERGENCY, - WATCHDOG_ALERT, - WATCHDOG_CRITICAL, - WATCHDOG_ERROR, - WATCHDOG_WARNING, - ))) { - $this->fail($message->text); - } - $verbose[] = $message->text; - } - - if ($verbose) { - array_unshift($verbose, '

Watchdog messages

'); - $this->verbose(implode("
", $verbose), 'Watchdog messages from test run'); - } - - // Clear the seen watchdog messages since we've failed on any errors. - $this->getWatchdogMessages(array(), TRUE); - } - - /** - * Format a watchdog message in a one-line summary. - * - * @param object $message - * A watchdog message object. - * - * @return string - * A string containing the watchdog message's timestamp, severity, type, - * and actual message. - */ - private function formatWatchdogMessage(stdClass $message) { - static $levels; - - if (!isset($levels)) { - module_load_include('admin.inc', 'dblog'); - $levels = watchdog_severity_levels(); - } - - return t('@timestamp - @severity - @type - !message', array( - '@timestamp' => $message->timestamp, - '@severity' => $levels[$message->severity], - '@type' => $message->type, - '!message' => theme_dblog_message(array('event' => $message, 'link' => FALSE)), - )); - } - - /** - * Log verbose message in a text file. - * - * This is a copy of DrupalWebTestCase->verbose() but allows a customizable - * summary message rather than hard-coding 'Verbose message'. - * - * @param string $verbose_message - * The verbose message to be stored. - * @param string $message - * Message to display. - * - * @see simpletest_verbose() - * - * @todo Remove when https://www.drupal.org/node/800426 is fixed. - */ - protected function verbose($verbose_message, $message = 'Verbose message') { - if ($id = simpletest_verbose($verbose_message)) { - $url = file_create_url($this->originalFileDirectory . '/simpletest/verbose/' . get_class($this) . '-' . $id . '.html'); - $this->error(l($message, $url, array('attributes' => array('target' => '_blank'))), 'User notice'); - } - } - -} - -/** - * XML Sitemap UnitTest. - */ -class XMLSitemapUnitTest extends XMLSitemapTestHelper { - - /** - * Get Info. - */ - public static function getInfo() { - return array( - 'name' => 'XML sitemap unit tests', - 'description' => 'Unit tests for the XML sitemap module.', - 'group' => 'XML sitemap', - ); - } - - /** - * Test Assert Flag. - */ - public function testAssertFlag() { - variable_set('xmlsitemap_rebuild_needed', TRUE); - $this->assertTrue(xmlsitemap_var('rebuild_needed')); - $this->assertTrue($this->assertFlag('rebuild_needed', TRUE, FALSE)); - $this->assertTrue(xmlsitemap_var('rebuild_needed')); - $this->assertTrue($this->assertFlag('rebuild_needed', TRUE, TRUE)); - $this->assertFalse(xmlsitemap_var('rebuild_needed')); - $this->assertTrue($this->assertFlag('rebuild_needed', FALSE, FALSE)); - $this->assertFalse(xmlsitemap_var('rebuild_needed')); - } - - /** - * Tests for xmlsitemap_get_changefreq(). - */ - public function testGetChangefreq() { - // The test values. - $values = array( - 0, - mt_rand(1, XMLSITEMAP_FREQUENCY_ALWAYS), - mt_rand(XMLSITEMAP_FREQUENCY_ALWAYS + 1, XMLSITEMAP_FREQUENCY_HOURLY), - mt_rand(XMLSITEMAP_FREQUENCY_HOURLY + 1, XMLSITEMAP_FREQUENCY_DAILY), - mt_rand(XMLSITEMAP_FREQUENCY_DAILY + 1, XMLSITEMAP_FREQUENCY_WEEKLY), - mt_rand(XMLSITEMAP_FREQUENCY_WEEKLY + 1, XMLSITEMAP_FREQUENCY_MONTHLY), - mt_rand(XMLSITEMAP_FREQUENCY_MONTHLY + 1, XMLSITEMAP_FREQUENCY_YEARLY), - mt_rand(XMLSITEMAP_FREQUENCY_YEARLY + 1, mt_getrandmax()), - ); - - // The expected values. - $expected = array( - FALSE, - 'always', - 'hourly', - 'daily', - 'weekly', - 'monthly', - 'yearly', - 'never', - ); - - foreach ($values as $i => $value) { - $actual = xmlsitemap_get_changefreq($value); - $this->assertIdentical($actual, $expected[$i]); - } - } - - /** - * Tests for xmlsitemap_get_chunk_count(). - */ - public function testGetChunkCount() { - // Set a low chunk size for testing. - variable_set('xmlsitemap_chunk_size', 4); - - // Make the total number of links just equal to the chunk size. - $count = db_query("SELECT COUNT(id) FROM {xmlsitemap}")->fetchField(); - for ($i = $count; $i < 4; $i++) { - $this->addSitemapLink(); - $this->assertEqual(xmlsitemap_get_chunk_count(TRUE), 1); - } - $this->assertEqual(db_query("SELECT COUNT(id) FROM {xmlsitemap}")->fetchField(), 4); - - // Add a disabled link, should not change the chunk count. - $this->addSitemapLink(array('status' => FALSE)); - $this->assertEqual(xmlsitemap_get_chunk_count(TRUE), 1); - - // Add a visible link, should finally bump up the chunk count. - $this->addSitemapLink(); - $this->assertEqual(xmlsitemap_get_chunk_count(TRUE), 2); - - // Change all links to disabled. The chunk count should be 1 not 0. - db_query("UPDATE {xmlsitemap} SET status = 0"); - $this->assertEqual(xmlsitemap_get_chunk_count(TRUE), 1); - $this->assertEqual(xmlsitemap_get_link_count(), 0); - - // Delete all links. The chunk count should be 1 not 0. - db_delete('xmlsitemap')->execute(); - - $this->assertEqual(db_query("SELECT COUNT(id) FROM {xmlsitemap}")->fetchField(), 0); - $this->assertEqual(xmlsitemap_get_chunk_count(TRUE), 1); - } - - // @codingStandardsIgnoreStart - // Function testGetChunkFile() { - // } - // - // function testGetChunkSize() { - // } - // - // function testGetLinkCount() { - // } - // @codingStandardsIgnoreEnd - - /** - * Tests for xmlsitemap_calculate_changereq(). - */ - public function testCalculateChangefreq() { - // The test values. - $values = array( - array(), - array(REQUEST_TIME), - array(REQUEST_TIME, REQUEST_TIME - 200), - array(REQUEST_TIME - 200, REQUEST_TIME, REQUEST_TIME - 600), - ); - - // Expected values. - $expected = array(0, 0, 200, 300); - - foreach ($values as $i => $value) { - $actual = xmlsitemap_calculate_changefreq($value); - $this->assertEqual($actual, $expected[$i]); - } - } - - /** - * Test for xmlsitemap_recalculate_changefreq(). - */ - public function testRecalculateChangefreq() { - // The starting test value. - $value = array( - 'lastmod' => REQUEST_TIME - 1000, - 'changefreq' => 0, - 'changecount' => 0, - ); - - // Expected values. - $expecteds = array( - array('lastmod' => REQUEST_TIME, 'changefreq' => 1000, 'changecount' => 1), - array('lastmod' => REQUEST_TIME, 'changefreq' => 500, 'changecount' => 2), - array('lastmod' => REQUEST_TIME, 'changefreq' => 333, 'changecount' => 3), - ); - - foreach ($expecteds as $expected) { - xmlsitemap_recalculate_changefreq($value); - $this->assertEqual($value, $expected); - } - } - - /** - * Tests for xmlsitemap_switch_user and xmlsitemap_restore_user(). - */ - public function testSwitchUser() { - global $user; - - $original_user = $user; - $new_user = $this->drupalCreateUser(); - - // Switch to a new valid user. - $this->assertEqual(xmlsitemap_switch_user($new_user), TRUE); - $this->assertEqual($user->uid, $new_user->uid); - - // Switch again to the anonymous user. - $this->assertEqual(xmlsitemap_switch_user(0), TRUE); - $this->assertEqual($user->uid, 0); - - // Switch again to the new user. - $this->assertEqual(xmlsitemap_switch_user($new_user->uid), TRUE); - $this->assertEqual($user->uid, $new_user->uid); - - // Test that after two switches the original user was restored. - $this->assertEqual(xmlsitemap_restore_user(), TRUE); - $this->assertEqual($user->uid, $original_user->uid); - - // Attempt to switch to the same user. - $this->assertEqual(xmlsitemap_switch_user($original_user->uid), FALSE); - $this->assertEqual($user->uid, $original_user->uid); - $this->assertEqual(xmlsitemap_restore_user(), FALSE); - $this->assertEqual($user->uid, $original_user->uid); - - // Attempt to switch to an invalid user ID. - $invalid_uid = db_query("SELECT MAX(uid) FROM {users}")->fetchField() + 100; - $this->assertEqual(xmlsitemap_switch_user($invalid_uid), FALSE); - $this->assertEqual($user->uid, $original_user->uid); - $this->assertEqual(xmlsitemap_restore_user(), FALSE); - $this->assertEqual($user->uid, $original_user->uid); - - // Attempt user switching when the original user is anonymous. - $user = drupal_anonymous_user(); - $this->assertEqual(xmlsitemap_switch_user(0), FALSE); - $this->assertEqual($user->uid, 0); - $this->assertEqual(xmlsitemap_restore_user(), FALSE); - $this->assertEqual($user->uid, 0); - } - - // @codingStandardsIgnoreStart - // function testLoadLink() { - // } - // @codingStandardsIgnoreEnd - - /** - * Tests for xmlsitemap_link_save(). - */ - public function testSaveLink() { - $link = array( - 'type' => 'testing', - 'id' => 1, - 'loc' => 'testing', - 'status' => 1, - ); - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['status'] = 0; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['priority'] = 0.5; - $link['loc'] = 'new_location'; - $link['status'] = 1; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['priority'] = 0.0; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['priority'] = 0.1; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['priority'] = 1.0; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['priority'] = 1; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', FALSE); - - $link['priority'] = 0; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['priority'] = 0.5; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', TRUE); - - $link['priority'] = 0.5; - $link['priority_override'] = 0; - $link['status'] = 1; - xmlsitemap_link_save($link); - $this->assertFlag('regenerate_needed', FALSE); - } - - /** - * Tests for xmlsitemap_link_delete(). - */ - public function testLinkDelete() { - // Add our testing data. - $link1 = $this->addSitemapLink(array('loc' => 'testing1', 'status' => 0)); - $link2 = $this->addSitemapLink(array('loc' => 'testing1', 'status' => 1)); - $link3 = $this->addSitemapLink(array('status' => 0)); - variable_set('xmlsitemap_regenerate_needed', FALSE); - - // Test delete multiple links. - // Test that the regenerate flag is set when visible links are deleted. - $deleted = xmlsitemap_link_delete_multiple(array('loc' => 'testing1')); - $this->assertEqual($deleted, 2); - $this->assertFalse(xmlsitemap_link_load($link1['type'], $link1['id'])); - $this->assertFalse(xmlsitemap_link_load($link2['type'], $link2['id'])); - $this->assertTrue(xmlsitemap_link_load($link3['type'], $link3['id'])); - $this->assertFlag('regenerate_needed', TRUE); - - $deleted = xmlsitemap_link_delete($link3['type'], $link3['id']); - $this->assertEqual($deleted, 1); - $this->assertFalse(xmlsitemap_link_load($link3['type'], $link3['id'])); - $this->assertFlag('regenerate_needed', FALSE); - } - - /** - * Tests for xmlsitemap_link_update_multiple(). - */ - public function testUpdateLinks() { - // Add our testing data. - $links = array(); - $links[1] = $this->addSitemapLink(array('subtype' => 'group1')); - $links[2] = $this->addSitemapLink(array('subtype' => 'group1')); - $links[3] = $this->addSitemapLink(array('subtype' => 'group2')); - variable_set('xmlsitemap_regenerate_needed', FALSE); - // Id | type | subtype | language | access | status | priority - // 1 | testing | group1 | '' | 1 | 1 | 0.5 - // 2 | testing | group1 | '' | 1 | 1 | 0.5 - // 3 | testing | group2 | '' | 1 | 1 | 0.5. - $updated = xmlsitemap_link_update_multiple(array('status' => 0), array( - 'type' => 'testing', - 'subtype' => 'group1', - 'status_override' => 0, - )); - $this->assertEqual($updated, 2); - $this->assertFlag('regenerate_needed', TRUE); - // Id | type | subtype | language | status | priority - // 1 | testing | group1 | '' | 0 | 0.5 - // 2 | testing | group1 | '' | 0 | 0.5 - // 3 | testing | group2 | '' | 1 | 0.5. - $updated = xmlsitemap_link_update_multiple(array('priority' => 0.0), array( - 'type' => 'testing', - 'subtype' => 'group1', - 'priority_override' => 0, - )); - $this->assertEqual($updated, 2); - $this->assertFlag('regenerate_needed', FALSE); - // Id | type | subtype | language | status | priority - // 1 | testing | group1 | '' | 0 | 0.0 - // 2 | testing | group1 | '' | 0 | 0.0 - // 3 | testing | group2 | '' | 1 | 0.5. - $updated = xmlsitemap_link_update_multiple(array('subtype' => 'group2'), array( - 'type' => 'testing', - 'subtype' => 'group1', - )); - $this->assertEqual($updated, 2); - $this->assertFlag('regenerate_needed', FALSE); - // Id | type | subtype | language | status | priority - // 1 | testing | group2 | '' | 0 | 0.0 - // 2 | testing | group2 | '' | 0 | 0.0 - // 3 | testing | group2 | '' | 1 | 0.5. - $updated = xmlsitemap_link_update_multiple(array('status' => 1), array( - 'type' => 'testing', - 'subtype' => 'group2', - 'status_override' => 0, - 'status' => 0, - )); - $this->assertEqual($updated, 2); - $this->assertFlag('regenerate_needed', TRUE); - // Id | type | subtype | language | status | priority - // 1 | testing | group2 | '' | 1 | 0.0 - // 2 | testing | group2 | '' | 1 | 0.0 - // 3 | testing | group2 | '' | 1 | 0.5. - } - - /** - * Test that duplicate paths are skipped during generation. - */ - public function testDuplicatePaths() { - $link1 = $this->addSitemapLink(array('loc' => 'duplicate')); - $link2 = $this->addSitemapLink(array('loc' => 'duplicate')); - $this->regenerateSitemap(); - $this->drupalGetSitemap(); - $this->assertUniqueText('duplicate'); - } - - /** - * Test that the sitemap will not be genereated before the lifetime expires. - */ - public function testMinimumLifetime() { - variable_set('xmlsitemap_minimum_lifetime', 300); - $this->regenerateSitemap(); - - $link = $this->addSitemapLink(array('loc' => 'lifetime-test')); - $this->cronRun(); - $this->drupalGetSitemap(); - $this->assertResponse(200); - $this->assertNoRaw('lifetime-test'); - - variable_set('xmlsitemap_generated_last', REQUEST_TIME - 400); - $this->cronRun(); - $this->drupalGetSitemap(); - $this->assertRaw('lifetime-test'); - - xmlsitemap_link_delete($link['type'], $link['id']); - $this->cronRun(); - $this->drupalGetSitemap(); - $this->assertRaw('lifetime-test'); - - $this->regenerateSitemap(); - $this->drupalGetSitemap(); - $this->assertResponse(200); - $this->assertNoRaw('lifetime-test'); - } - -} - -/** - * XML Sitemap Functional Test. - */ -class XMLSitemapFunctionalTest extends XMLSitemapTestHelper { - - /** - * Get Info. - */ - public static function getInfo() { - return array( - 'name' => 'XML sitemap interface tests', - 'description' => 'Functional tests for the XML sitemap module.', - 'group' => 'XML sitemap', - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'path'; - parent::setUp($modules); - $this->admin_user = $this->drupalCreateUser(array( - 'access content', - 'administer site configuration', - 'administer xmlsitemap', - )); - $this->drupalLogin($this->admin_user); - } - - /** - * Test the sitemap file caching. - */ - public function testSitemapCaching() { - $this->regenerateSitemap(); - $this->drupalGetSitemap(); - $this->assertResponse(200); - $etag = $this->drupalGetHeader('etag'); - $last_modified = $this->drupalGetHeader('last-modified'); - $this->assertTrue($etag, t('Etag header found.')); - $this->assertTrue($last_modified, t('Last-modified header found.')); - - $this->drupalGetSitemap(array(), array(), array('If-Modified-Since: ' . $last_modified, 'If-None-Match: ' . $etag)); - $this->assertResponse(304); - } - - /** - * Test base URL functionality. - * - * @codingStandardsIgnoreStart - */ - public function testBaseURL() { - // @codingStandardsIgnoreEnd - $edit = array('xmlsitemap_base_url' => ''); - $this->drupalPost('admin/config/search/xmlsitemap/settings', $edit, t('Save configuration')); - $this->assertText(t('Default base URL field is required.')); - - $edit = array('xmlsitemap_base_url' => 'invalid'); - $this->drupalPost('admin/config/search/xmlsitemap/settings', $edit, t('Save configuration')); - $this->assertText(t('Invalid base URL.')); - - $edit = array('xmlsitemap_base_url' => 'http://example.com/ '); - $this->drupalPost('admin/config/search/xmlsitemap/settings', $edit, t('Save configuration')); - $this->assertText(t('Invalid base URL.')); - - $edit = array('xmlsitemap_base_url' => 'http://example.com/'); - $this->drupalPost('admin/config/search/xmlsitemap/settings', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.')); - - $this->regenerateSitemap(); - $this->drupalGetSitemap(array(), array('base_url' => NULL)); - $this->assertRaw('http://example.com/'); - } - - /** - * Test Status Report Function. - * - * Test that configuration problems are reported properly in the status - * report. - */ - public function testStatusReport() { - // Test the rebuild flag. - // @codingStandardsIgnoreStart - // @todo Re-enable these tests once we get a xmlsitemap_test.module. - // variable_set('xmlsitemap_generated_last', REQUEST_TIME); - // variable_set('xmlsitemap_rebuild_needed', TRUE); - // $this->assertXMLSitemapProblems(t('The XML sitemap data is out of sync and needs to be completely rebuilt.')); - // $this->clickLink(t('completely rebuilt')); - // $this->assertResponse(200); - // variable_set('xmlsitemap_rebuild_needed', FALSE); - // $this->assertNoXMLSitemapProblems(); - // Test the regenerate flag (and cron hasn't run in a while). - // @codingStandardsIgnoreEnd - variable_set('xmlsitemap_regenerate_needed', TRUE); - variable_set('xmlsitemap_generated_last', REQUEST_TIME - variable_get('cron_threshold_warning', 172800) - 100); - $this->assertXMLSitemapProblems(t('The XML cached files are out of date and need to be regenerated. You can run cron manually to regenerate the sitemap files.')); - $this->clickLink(t('run cron manually')); - $this->assertResponse(200); - $this->assertNoXMLSitemapProblems(); - - // Test chunk count > 1000. - // Test directory not writable. - } - -} - -/** - * XML Sitemap Robots Txt Integration Test. - */ -class XMLSitemapRobotsTxtIntegrationTest extends XMLSitemapTestHelper { - - /** - * Get Info. - */ - public static function getInfo() { - return array( - 'name' => 'XML sitemap robots.txt', - 'description' => 'Integration tests for the XML sitemap and robots.txt module.', - 'group' => 'XML sitemap', - 'dependencies' => array('robotstxt'), - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'robotstxt'; - parent::setUp($modules); - } - - /** - * Test Robots Txt. - */ - public function testRobotsTxt() { - // Request the un-clean robots.txt path so this will work in case there is - // still the robots.txt file in the root directory. - $this->drupalGet('', array('query' => array('q' => 'robots.txt'))); - $this->assertRaw('Sitemap: ' . url('sitemap.xml', array('absolute' => TRUE))); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.xmlsitemap.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.xmlsitemap.inc deleted file mode 100644 index 0befbcabcd..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap.xmlsitemap.inc +++ /dev/null @@ -1,394 +0,0 @@ -sitemap = $sitemap; - $this->sitemap_page = $page; - $this->uri = xmlsitemap_sitemap_get_file($sitemap, $page); - $this->openUri($this->uri); - } - - /** - * Open URI. - */ - public function openUri($uri) { - $return = parent::openUri($uri); - if (!$return) { - throw new XMLSitemapGenerationException(t('Could not open file @file for writing.', array('@file' => $uri))); - } - return $return; - } - - /** - * Start Document. - */ - public function startDocument($version = '1.0', $encoding = 'UTF-8', $standalone = NULL) { - $this->setIndent(FALSE); - $result = parent::startDocument($version, $encoding); - if (!$result) { - throw new XMLSitemapGenerationException(t('Unknown error occurred while writing to file @file.', array('@file' => $this->uri))); - } - if (variable_get('xmlsitemap_xsl', 1)) { - $this->writeXSL(); - } - $this->startElement($this->rootElement, TRUE); - return $result; - } - - /** - * Get Sitemap URL. - */ - public function getSitemapUrl($path, array $options = array()) { - global $base_url; - $options += $this->sitemap->uri['options']; - $options += array( - 'absolute' => TRUE, - 'base_url' => variable_get('xmlsitemap_base_url', $base_url), - 'language' => language_default(), - 'alias' => TRUE, - ); - if (!empty($options['protocol_relative'])) { - $options['base_url'] = preg_replace('~^https?:~', '', $options['base_url']); - } - return url($path, $options); - } - - /** - * Add the XML stylesheet to the XML page. - * - * @codingStandardsIgnoreStart - */ - public function writeXSL() { - // @codingStandardsIgnoreEnd - $this->writePi('xml-stylesheet', 'type="text/xsl" href="' . $this->getSitemapUrl('sitemap.xsl', array('absolute' => FALSE)) . '"'); - $this->writeRaw(PHP_EOL); - } - - /** - * Return an array of attributes for the root element of the XML. - */ - public function getRootAttributes() { - $attributes['xmlns'] = 'http://www.sitemaps.org/schemas/sitemap/0.9'; - if (variable_get('xmlsitemap_developer_mode', 0)) { - $attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance'; - $attributes['xsi:schemaLocation'] = 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'; - } - - drupal_alter('xmlsitemap_root_attributes', $attributes, $this->sitemap); - - return $attributes; - } - - /** - * Generate XML. - * - * @codingStandardsIgnoreStart - */ - public function generateXML() { - // @codingStandardsIgnoreEnd - return xmlsitemap_generate_chunk($this->sitemap, $this, $this->sitemap_page); - } - - /** - * Start Element. - */ - public function startElement($name, $root = FALSE) { - parent::startElement($name); - - if ($root) { - foreach ($this->getRootAttributes() as $name => $value) { - $this->writeAttribute($name, $value); - } - $this->writeRaw(PHP_EOL); - } - } - - /** - * Write an full XML sitemap element tag. - * - * @param string $name - * The element name. - * @param array $element - * An array of the elements properties and values. - */ - public function writeSitemapElement($name, array &$element) { - $this->writeElement($name, $element); - $this->writeRaw(PHP_EOL); - - // After a certain number of elements have been added, flush the buffer - // to the output file. - $this->sitemapElementCount++; - if (($this->sitemapElementCount % $this->linkCountFlush) == 0) { - $this->flush(); - } - } - - /** - * Write full element tag including support for nested elements. - * - * @param string $name - * The element name. - * @param string|array $content - * The element contents or an array of the elements' sub-elements. - * - * @todo Missing a return value since XMLWriter::writeElement() has one. - */ - public function writeElement($name, $content = NULL) { - if (is_array($content)) { - $this->startElement($name); - $xml_content = format_xml_elements($content); - // Remove additional spaces from the output. - $xml_content = str_replace(array(" <", ">\n"), array("<", ">"), $xml_content); - $this->writeRaw($xml_content); - $this->endElement(); - } - else { - parent::writeElement($name, check_plain((string) $content)); - } - } - - /** - * Get URI. - * - * @codingStandardsIgnoreStart - */ - public function getURI() { - // @codingStandardsIgnoreEnd - return $this->uri; - } - - /** - * Get Count Sitemap Element. - */ - public function getSitemapElementCount() { - return $this->sitemapElementCount; - } - - /** - * Document. - */ - public function endDocument() { - $return = parent::endDocument(); - - if (!$return) { - throw new XMLSitemapGenerationException(t('Unknown error occurred while writing to file @file.', array('@file' => $this->uri))); - } - - // @code - // If (xmlsitemap_var('gz')) { - // $file_gz = $file . '.gz'; - // file_put_contents($file_gz, gzencode(file_get_contents($file), 9)); - // } - // @endcode - return $return; - } - -} - -/** - * XML Sitemap Index Writer. - */ -class XMLSitemapIndexWriter extends XMLSitemapWriter { - - protected $rootElement = 'sitemapindex'; - - /** - * Construct. - */ - public function __construct(stdClass $sitemap, $page = 'index') { - parent::__construct($sitemap, 'index'); - } - - /** - * Get Root Attributes. - */ - public function getRootAttributes() { - $attributes['xmlns'] = 'http://www.sitemaps.org/schemas/sitemap/0.9'; - if (variable_get('xmlsitemap_developer_mode', 0)) { - $attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance'; - $attributes['xsi:schemaLocation'] = 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd'; - } - - drupal_alter('xmlsitemap_root_attributes', $attributes, $this->sitemap); - - return $attributes; - } - - /** - * Generate XML. - * - * @codingStandardsIgnoreStart - */ - public function generateXML() { - // @codingStandardsIgnoreEnd - $lastmod_format = variable_get('xmlsitemap_lastmod_format', XMLSITEMAP_LASTMOD_MEDIUM); - - for ($i = 1; $i <= $this->sitemap->chunks; $i++) { - $element = array( - 'loc' => $this->getSitemapUrl('sitemap.xml', array('query' => array('page' => $i))), - // @todo Use the actual lastmod value of the chunk file. - 'lastmod' => gmdate($lastmod_format, REQUEST_TIME), - ); - $this->writeSitemapElement('sitemap', $element); - } - } - -} - -/** - * Implements hook_xmlsitemap_link_info(). - */ -function xmlsitemap_xmlsitemap_link_info() { - return array( - 'frontpage' => array( - 'label' => t('Frontpage'), - 'xmlsitemap' => array( - 'settings callback' => 'xmlsitemap_link_frontpage_settings', - ), - ), - ); -} - -/** - * XML sitemap link type settings callback for frontpage link entity. - */ -function xmlsitemap_link_frontpage_settings(&$form) { - module_load_include('admin.inc', 'xmlsitemap'); - if (user_access('administer site configuration')) { - $form['#description'] = t('The front page path can be changed in the site information configuration.', array('@url-frontpage' => url('admin/config/system/site-information'))); - } - $form['xmlsitemap_frontpage_priority'] = array( - '#type' => 'select', - '#title' => t('Priority'), - '#options' => xmlsitemap_get_priority_options(), - '#default_value' => variable_get('xmlsitemap_frontpage_priority', 1.0), - ); - $form['xmlsitemap_frontpage_changefreq'] = array( - '#type' => 'select', - '#title' => t('Change frequency'), - '#options' => xmlsitemap_get_changefreq_options(), - '#default_value' => variable_get('xmlsitemap_frontpage_changefreq', XMLSITEMAP_FREQUENCY_DAILY), - ); - return $form; -} - -/** - * Implements hook_xmlsitemap_link_alter(). - */ -function xmlsitemap_xmlsitemap_link_alter(&$link) { - // Alter the frontpage priority. - if ($link['type'] == 'frontpage' || $link['loc'] == '' || $link['loc'] == variable_get('site_frontpage', 'node')) { - $link['priority'] = variable_get('xmlsitemap_frontpage_priority', 1.0); - $link['changefreq'] = variable_get('xmlsitemap_frontpage_changefreq', XMLSITEMAP_FREQUENCY_DAILY); - } -} - -/** - * Implements hook_xmlsitemap_links(). - */ -function xmlsitemap_xmlsitemap_links() { - // Frontpage link. - $links[] = array( - 'type' => 'frontpage', - 'id' => 0, - 'loc' => '', - ); - return $links; -} - -/** - * Implements hook_xmlsitemap_sitemap_operations(). - */ -function xmlsitemap_xmlsitemap_sitemap_operations() { - $operations['update'] = array( - 'label' => t('Update cached files'), - 'action past' => t('Updated'), - 'callback' => 'xmlsitemap_sitemap_multiple_update', - ); - return $operations; -} - -/** - * XML sitemap operation callback; regenerate sitemap files using the batch API. - * - * @param array $smids - * An array of XML sitemap IDs. - * - * @see xmlsitemap_regenerate_batch() - */ -function xmlsitemap_sitemap_multiple_update(array $smids) { - module_load_include('generate.inc', 'xmlsitemap'); - $batch = xmlsitemap_regenerate_batch($smids); - batch_set($batch); -} - -/** - * Implements hook_query_TAG_alter(). - */ -function xmlsitemap_query_xmlsitemap_link_bundle_access_alter(QueryAlterableInterface $query) { - if ($query instanceof EntityFieldQuery && $entity = $query->getMetaData('entity')) { - $info = $query->getMetaData('entity_info'); - $bundle = $query->getMetaData('bundle'); - if (empty($bundle)) { - $bundle = xmlsitemap_get_link_type_enabled_bundles($entity); - } - $query->entityCondition('bundle', $bundle, is_array($bundle) ? 'IN' : '='); - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/README.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/README.txt deleted file mode 100644 index 547899838b..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/README.txt +++ /dev/null @@ -1,76 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Recommended modules -* Installation -* Configuration -* Maintainers - - -INTRODUCTION ------------- - -The XML sitemap custom module, part of the XML sitemap -(https://www.drupal.org/project/xmlsitemap) package, adds user configurable -links to the sitemap. The XML sitemap module creates a sitemap that conforms to -the sitemaps.org specification. This helps search engines to more intelligently -crawl a website and keep their results up to date. - -* For a full description of the module, visit - https://www.drupal.org/documentation/modules/xmlsitemap - -* To submit bug reports and feature suggestions, or to track changes visit - https://www.drupal.org/project/issues/xmlsitemap - - -REQUIREMENTS ------------- - -This module requires the following module: - -* XML sitemap - https://www.drupal.org/project/xmlsitemap - - -RECOMMENDED MODULES -------------------- - -* Ctools - https://www.drupal.org/project/ctools -* RobotsTxt - https://www.drupal.org/project/robotstxt -* Site Verification - https://www.drupal.org/project/site_verify -* Browscap - https://www.drupal.org/project/browscap -* Vertical Tabs - https://www.drupal.org/project/vertical_tabs - - -INSTALLATION ------------- - -This is a submodule of the XML sitemap module. Install the XML sitemap module as -you would normally install a contributed Drupal module. Visit -https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- - -1. Install the XML sitemap module. -2. Enable the XML sitemap module. -3. To include custom links in the sitemap, enable the XML custom submodule. -4. Navigate to Administration > Configuration > Search > XML Sitemap. -5. Select on the Custom Links tab to add a custom link. -6. Enter the address and select Save. -7. Select on the XML sitemap vertical tab. -8. Select on the Rebuild Links tab in the upper right. -9. Select on "Rebuild sitemap" even if the message says that you do not need to. -10. Now you're taken back to the config page which shows you the link to your - XML sitemap which you can click and confirm that pages have been added. - - -MAINTAINERS ------------ - -* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu -* Dave Reid - https://www.drupal.org/u/dave-reid -* Juampy NR (juampynr) - https://www.drupal.org/u/juampynr -* Tasya Rukmana (tadityar) - https://www.drupal.org/u/tadityar diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc deleted file mode 100644 index af9454d884..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc +++ /dev/null @@ -1,220 +0,0 @@ - array('data' => t('Location'), 'field' => 'loc', 'sort' => 'asc'), - 'priority' => array('data' => t('Priority'), 'field' => 'priority'), - 'changefreq' => array('data' => t('Change frequency'), 'field' => 'changefreq'), - 'language' => array('data' => t('Language'), 'field' => 'language'), - 'operations' => array('data' => t('Operations')), - ); - // Do not include the language column if locale is disabled. - if (!module_exists('locale')) { - unset($header['language']); - } - - $rows = array(); - $destination = drupal_get_destination(); - - $query = db_select('xmlsitemap') - ->extend('PagerDefault') - ->extend('TableSort'); - $query->fields('xmlsitemap'); - $query->condition('type', 'custom'); - $query->limit(25); - $query->orderByHeader($header); - $result = $query->execute(); - - foreach ($result as $link) { - $row = array(); - $row['loc'] = l($link->loc, $link->loc); - $row['priority'] = number_format($link->priority, 1); - $row['changefreq'] = $link->changefreq ? drupal_ucfirst(xmlsitemap_get_changefreq($link->changefreq)) : t('None'); - if (isset($header['language'])) { - $row['language'] = module_invoke('locale', 'language_name', $link->language); - } - $operations = array(); - $operations['edit'] = xmlsitemap_get_operation_link('admin/config/search/xmlsitemap/custom/edit/' . $link->id, array('title' => t('Edit'), 'modal' => TRUE)); - $operations['delete'] = xmlsitemap_get_operation_link('admin/config/search/xmlsitemap/custom/delete/' . $link->id, array('title' => t('Delete'), 'modal' => TRUE)); - $row['operations'] = array( - 'data' => array( - '#theme' => 'links', - '#links' => $operations, - '#attributes' => array('class' => array('links', 'inline')), - ), - ); - $rows[] = $row; - } - - // @todo Convert to tableselect - $build['xmlsitemap_custom_table'] = array( - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => t('No custom links available.') . ' ' . l(t('Add custom link'), 'admin/config/search/xmlsitemap/custom/add', array('query' => $destination)), - ); - $build['xmlsitemap_custom_pager'] = array('#theme' => 'pager'); - return $build; -} - -/** - * Edit Link Form. - */ -function xmlsitemap_custom_edit_link_form($form, &$form_state, $link = array()) { - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - _xmlsitemap_set_breadcrumb('admin/config/search/xmlsitemap/custom'); - - $link += array( - 'id' => db_query("SELECT MAX(id) FROM {xmlsitemap} WHERE type = 'custom'")->fetchField() + 1, - 'loc' => '', - 'priority' => XMLSITEMAP_PRIORITY_DEFAULT, - 'lastmod' => 0, - 'changefreq' => 0, - 'changecount' => 0, - 'language' => LANGUAGE_NONE, - ); - - $form['type'] = array( - '#type' => 'value', - '#value' => 'custom', - ); - $form['id'] = array( - '#type' => 'value', - '#value' => $link['id'], - ); - $form['loc'] = array( - '#type' => 'textfield', - '#title' => t('Path to link'), - '#field_prefix' => url('', array('absolute' => TRUE)), - '#default_value' => $link['loc'] ? drupal_get_path_alias($link['loc'], $link['language']) : '', - '#required' => TRUE, - '#size' => 30, - ); - $form['priority'] = array( - '#type' => 'select', - '#title' => t('Priority'), - '#options' => xmlsitemap_get_priority_options(), - '#default_value' => number_format($link['priority'], 1), - '#description' => t('The priority of this URL relative to other URLs on your site.'), - ); - $form['changefreq'] = array( - '#type' => 'select', - '#title' => t('Change frequency'), - '#options' => array(0 => t('None')) + xmlsitemap_get_changefreq_options(), - '#default_value' => $link['changefreq'], - '#description' => t('How frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page.'), - ); - $languages = module_exists('locale') ? locale_language_list() : array(); - $form['language'] = array( - '#type' => 'select', - '#title' => t('Language'), - '#default_value' => $link['language'], - '#options' => array(LANGUAGE_NONE => t('Language neutral')) + $languages, - '#access' => $languages, - ); - - $form['actions'] = array( - '#type' => 'actions', - ); - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => t('Save'), - '#weight' => 5, - ); - $form['actions']['cancel'] = array( - '#markup' => l(t('Cancel'), 'admin/config/search/xmlsitemap/custom'), - '#weight' => 10, - ); - - return $form; -} - -/** - * Edit Link Form Validate. - */ -function xmlsitemap_custom_edit_link_form_validate($form, &$form_state) { - $link = &$form_state['values']; - - // Make sure we trim and normalize the path first. - $link['loc'] = trim($link['loc']); - $link['loc'] = drupal_get_normal_path($link['loc'], $link['language']); - - // Test anonymous user access to the custom link paths. - xmlsitemap_switch_user(0); - $menu_item = menu_get_item($link['loc']); - xmlsitemap_restore_user(); - - // Since the menu item access results are cached, manually check the current - // path. - if ($menu_item && strpos($link['loc'], 'admin/config/search/xmlsitemap/custom') === 0 && !user_access('administer xmlsitemap', drupal_anonymous_user())) { - $menu_item['access'] = FALSE; - } - - if (db_query_range("SELECT 1 FROM {xmlsitemap} WHERE type <> 'custom' AND loc = :loc AND status = 1 AND access = 1 AND language IN (:languages)", 0, 1, array( - ':loc' => $link['loc'], - ':languages' => array(LANGUAGE_NONE, $link['language']), - ))->fetchField()) { - form_set_error('loc', t('There is already an existing link in the sitemap with the path %link.', array('%link' => $link['loc']))); - } - elseif (empty($menu_item['access']) && !is_readable('./' . $link['loc'])) { - // @todo Harden this file exists check to make sure we can't link to files - // like .htaccess. - form_set_error('loc', t('The custom link %link is either invalid or it cannot be accessed by anonymous users.', array('%link' => $link['loc']))); - } -} - -/** - * Edit Link Form Submit. - */ -function xmlsitemap_custom_edit_link_form_submit($form, &$form_state) { - $link = $form_state['values']; - xmlsitemap_link_save($link); - drupal_set_message(t('The custom link for %loc was saved.', array('%loc' => $link['loc']))); - $form_state['redirect'] = 'admin/config/search/xmlsitemap/custom'; -} - -/** - * Delete Link Form. - */ -function xmlsitemap_custom_delete_link_form($form, &$form_state, array $link) { - // @todo Remove when https://www.drupal.org/node/576290 is fixed. - _xmlsitemap_set_breadcrumb('admin/config/search/xmlsitemap/custom'); - - $form['#link'] = $link; - $form['id'] = array( - '#type' => 'value', - '#value' => $link['id'], - ); - $form['link'] = array( - '#type' => 'value', - '#value' => $link, - ); - - return confirm_form( - $form, - t('Are you sure you want to delete the custom link for %loc?', array('%loc' => $link['loc'])), - 'admin/config/search/xmlsitemap/custom', - t('This action cannot be undone.'), - t('Delete'), - t('Cancel') - ); -} - -/** - * Delete Link Form Submit. - */ -function xmlsitemap_custom_delete_link_form_submit($form, &$form_state) { - $link = $form_state['values']['link']; - xmlsitemap_link_delete('custom', $link['id']); - drupal_set_message(t('The custom link for %loc has been deleted.', array('%loc' => $link['loc']))); - watchdog('xmlsitemap', 'The custom link for %loc has been deleted.', array('%loc' => $link['loc']), WATCHDOG_NOTICE); - $form_state['redirect'] = 'admin/config/search/xmlsitemap/custom'; -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info deleted file mode 100644 index e45cc439e0..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info +++ /dev/null @@ -1,13 +0,0 @@ -name = XML sitemap custom -description = Adds user configurable links to the sitemap. -package = XML sitemap -core = 7.x -dependencies[] = xmlsitemap -files[] = xmlsitemap_custom.test -configure = admin/config/search/xmlsitemap/custom - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.install b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.install deleted file mode 100644 index 6731a55d5a..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.install +++ /dev/null @@ -1,14 +0,0 @@ - 'custom')); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.module deleted file mode 100644 index 9093442009..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.module +++ /dev/null @@ -1,68 +0,0 @@ - 'Custom links', - 'page callback' => 'xmlsitemap_custom_list_links', - 'access arguments' => array('administer xmlsitemap'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'xmlsitemap_custom.admin.inc', - ); - $items['admin/config/search/xmlsitemap/custom/add'] = array( - 'title' => 'Add custom link', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_custom_edit_link_form'), - 'access arguments' => array('administer xmlsitemap'), - 'type' => MENU_LOCAL_ACTION, - 'file' => 'xmlsitemap_custom.admin.inc', - 'modal' => TRUE, - ); - $items['admin/config/search/xmlsitemap/custom/edit/%xmlsitemap_custom'] = array( - 'title' => 'Edit custom link', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_custom_edit_link_form', 6), - 'access arguments' => array('administer xmlsitemap'), - 'file' => 'xmlsitemap_custom.admin.inc', - 'modal' => TRUE, - ); - $items['admin/config/search/xmlsitemap/custom/delete/%xmlsitemap_custom'] = array( - 'title' => 'Delete custom link', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_custom_delete_link_form', 6), - 'access arguments' => array('administer xmlsitemap'), - 'file' => 'xmlsitemap_custom.admin.inc', - 'modal' => TRUE, - ); - return $items; -} - -/** - * Menu load callback; load a custom sitemap link from the {xmlsitemap} table. - * - * @param string $id - * The sitemap link ID of the custom link to load. - * - * @see xmlsitemap_link_load() - */ -function xmlsitemap_custom_load($id) { - return xmlsitemap_link_load('custom', $id); -} - -/** - * Implements hook_xmlsitemap_link_info(). - */ -function xmlsitemap_custom_xmlsitemap_link_info() { - return array( - 'custom' => array( - 'label' => t('Custom links'), - ), - ); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.test deleted file mode 100644 index 16a211a81a..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.test +++ /dev/null @@ -1,132 +0,0 @@ - 'XML sitemap custom interface tests', - 'description' => 'Functional tests for the XML sitemap custom module.', - 'group' => 'XML sitemap', - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'xmlsitemap_custom'; - $modules[] = 'path'; - parent::setUp($modules); - - $this->admin_user = $this->drupalCreateUser(array('access content', 'administer xmlsitemap')); - $this->drupalLogin($this->admin_user); - } - - /** - * Test Custom Links. - */ - public function testCustomLinks() { - // Set a path alias for the node page. - $alias = array('source' => 'system/files', 'alias' => 'public-files'); - path_save($alias); - - $this->drupalGet('admin/config/search/xmlsitemap/custom'); - $this->clickLink(t('Add custom link')); - - // Test an invalid path. - $edit['loc'] = 'invalid-testing-path'; - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertText(t('The custom link @link is either invalid or it cannot be accessed by anonymous users.', array('@link' => $edit['loc']))); - $this->assertNoSitemapLink(array('type' => 'custom', 'loc' => $edit['loc'])); - - // Test a path not accessible to anonymous user. - $edit['loc'] = 'admin/people/people'; - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertText(t('The custom link @link is either invalid or it cannot be accessed by anonymous users.', array('@link' => $edit['loc']))); - $this->assertNoSitemapLink(array('type' => 'custom', 'loc' => $edit['loc'])); - - // Test that the current page, which should not give a false positive for - // $menu_item['access'] since the result has been cached already. - $edit['loc'] = 'admin/config/search/xmlsitemap/custom/add'; - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertText(t('The custom link @link is either invalid or it cannot be accessed by anonymous users.', array('@link' => $edit['loc']))); - $this->assertNoSitemapLink(array('type' => 'custom', 'loc' => $edit['loc'])); - - // Add an aliased path with padded spaces. - $edit['loc'] = ' public-files '; - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertText('The custom link for system/files was saved'); - $links = xmlsitemap_link_load_multiple(array('type' => 'custom', 'loc' => 'system/files')); - $this->assertEqual(count($links), 1, t('Custom link saved in the database.')); - $link = reset($links); - $this->assertSitemapLinkValues('custom', $link['id'], array( - 'priority' => 0.5, - 'changefreq' => 0, - 'access' => 1, - 'status' => 1, - )); - - $this->clickLink('Edit'); - $edit = array( - 'priority' => 0.1, - 'changefreq' => XMLSITEMAP_FREQUENCY_ALWAYS, - ); - $this->drupalPost(NULL, $edit, t('Save')); - $this->assertText('The custom link for system/files was saved'); - $this->assertSitemapLinkValues('custom', $link['id'], array( - 'priority' => 0.1, - 'changefreq' => XMLSITEMAP_FREQUENCY_ALWAYS, - 'access' => 1, - 'status' => 1, - )); - - $this->clickLink('Delete'); - $this->drupalPost(NULL, array(), t('Delete')); - $this->assertText('The custom link for system/files has been deleted.'); - $this->assertNoSitemapLink(array('type' => 'custom', 'loc' => 'system/files')); - } - - /** - * Test adding files as custom links. - */ - public function testCustomFileLinks() { - // Test an invalid file. - $edit['loc'] = $this->randomName(); - $this->drupalPost('admin/config/search/xmlsitemap/custom/add', $edit, t('Save')); - $this->assertText(t('The custom link @link is either invalid or it cannot be accessed by anonymous users.', array('@link' => $edit['loc']))); - $this->assertNoSitemapLink(array('type' => 'custom', 'loc' => $edit['loc'])); - - // Test an unaccessible file . - // @codingStandardsIgnoreStart - // $edit['loc'] = '.htaccess'; - // $this->drupalPost('admin/config/search/xmlsitemap/custom/add', $edit, t('Save')); - // $this->assertText(t('The custom link @link is either invalid or it cannot be accessed by anonymous users.', array('@link' => $edit['loc']))); - // $this->assertNoSitemapLink(array('type' => 'custom', 'loc' => $edit['loc'])); - // @codingStandardsIgnoreEnd - // Test a valid file. - $edit['loc'] = 'misc/drupal.js'; - $this->drupalPost('admin/config/search/xmlsitemap/custom/add', $edit, t('Save')); - $this->assertText('The custom link for ' . $edit['loc'] . ' was saved'); - $links = xmlsitemap_link_load_multiple(array('type' => 'custom', 'loc' => $edit['loc'])); - $this->assertEqual(count($links), 1, t('Custom link saved in the database.')); - - // Test a valid folder. - $edit['loc'] = 'misc'; - $this->drupalPost('admin/config/search/xmlsitemap/custom/add', $edit, t('Save')); - $this->assertText('The custom link for ' . $edit['loc'] . ' was saved'); - $links = xmlsitemap_link_load_multiple(array('type' => 'custom', 'loc' => $edit['loc'])); - $this->assertEqual(count($links), 1, t('Custom link saved in the database.')); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/README.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/README.txt deleted file mode 100644 index 41f0f85ba3..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/README.txt +++ /dev/null @@ -1,79 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Recommended modules -* Installation -* Configuration -* Troubleshooting -* Maintainers - -INTRODUCTION ------------- - -The XML sitemap engines module, part of the XML sitemap -(https://www.drupal.org/project/xmlsitemap) package, uploads the sitemap to -search engines automatically. The XML sitemap module creates a sitemap that -conforms to the sitemaps.org specification. This helps search engines to more -intelligently crawl a website and keep their results up to date. - -* For a full description of the module visit - https://www.drupal.org/documentation/modules/xmlsitemap - -* To submit bug reports and feature suggestions, or to track changes visit - https://www.drupal.org/project/issues/xmlsitemap - - -REQUIREMENTS ------------- - -This module requires the following module: - -* XML sitemap - https://www.drupal.org/project/xmlsitemap - - -RECOMMENDED MODULES -------------------- - -* Ctools - https://www.drupal.org/project/ctools -* RobotsTxt - https://www.drupal.org/project/robotstxt -* Site Verification - https://www.drupal.org/project/site_verify -* Browscap - https://www.drupal.org/project/browscap -* Vertical Tabs - https://www.drupal.org/project/vertical_tabs - - -INSTALLATION ------------- - -This is a submodule of the XML sitemap module. Install the XML sitemap module -as you would normally install a contributed Drupal module. Visit -https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- - -1. Install the XML sitemap module. -2. Enable the XML sitemap module. -3. To upload sitemaps to the search engines and customize how often the sitemaps - should be uploaded, enable the XML sitemap engines module. -4. After building an XML sitemap, navigate to Administration > Configuration > - XML sitemap > Search Engines. -5. Choose which engines you wish to send the sitemap to by selecting the - appropriate checkboxes. Save configuration. - - -TROUBLESHOOTING ---------------- - -To verify the sitemap’s ownership with search engines, be sure Cron is run -regularly. - - -MAINTAINERS ------------ -* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu -* Dave Reid - https://www.drupal.org/u/dave-reid -* Juampy NR (juampynr) - https://www.drupal.org/u/juampynr -* Tasya Rukmana (tadityar) - https://www.drupal.org/u/tadityar diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines.test deleted file mode 100644 index a4d625a966..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines.test +++ /dev/null @@ -1,180 +0,0 @@ - 'XML sitemap engines functional tests', - 'description' => 'Functional tests for the XML sitemap engines module.', - 'group' => 'XML sitemap', - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'xmlsitemap_engines'; - $modules[] = 'xmlsitemap_engines_test'; - parent::setUp($modules); - - $this->admin_user = $this->drupalCreateUser(array('access content', 'administer xmlsitemap')); - $this->drupalLogin($this->admin_user); - - // @todo For some reason the test client does not have clean URLs while - // the test runner does, so it causes mismatches in watchdog assertions - // later. - variable_set('clean_url', 0); - - $this->submit_url = url('ping', array('absolute' => TRUE, 'query' => array('sitemap' => ''))) . '[sitemap]'; - } - - /** - * Submit Engines. - */ - public function submitEngines() { - variable_set('xmlsitemap_engines_submit_last', REQUEST_TIME - 10000); - variable_set('xmlsitemap_generated_last', REQUEST_TIME - 100); - variable_set('xmlsitemap_engines_minimum_lifetime', 0); - xmlsitemap_engines_cron(); - $this->assertTrue(variable_get('xmlsitemap_engines_submit_last', 0) > (REQUEST_TIME - 100), 'Submitted the sitemaps to search engines.'); - } - - /** - * Test Prepare URL. - * - * @codingStandardsIgnoreStart - */ - public function testPrepareURL() { - // @codingStandardsIgnoreEnd - $sitemap = 'http://example.com/sitemap.xml'; - $input = 'http://example.com/ping?sitemap=[sitemap]&foo=bar'; - $output = 'http://example.com/ping?sitemap=http://example.com/sitemap.xml&foo=bar'; - $this->assertEqual(xmlsitemap_engines_prepare_url($input, $sitemap), $output); - } - - /** - * Test Submit Sitemaps. - */ - public function testSubmitSitemaps() { - $sitemaps = array(); - $sitemap = new stdClass(); - $sitemap->uri = array( - 'path' => 'http://example.com/sitemap.xml', - 'options' => array(), - ); - $sitemaps[] = $sitemap; - $sitemap = new stdClass(); - $sitemap->uri = array( - 'path' => 'http://example.com/sitemap-2.xml', - 'options' => array(), - ); - $sitemaps[] = $sitemap; - xmlsitemap_engines_submit_sitemaps($this->submit_url, $sitemaps); - - $this->assertWatchdogMessage(array( - 'type' => 'xmlsitemap', - 'message' => 'Recieved ping for @sitemap.', - 'variables' => array( - '@sitemap' => 'http://example.com/sitemap.xml', - ), - )); - $this->assertWatchdogMessage(array( - 'type' => 'xmlsitemap', - 'message' => 'Recieved ping for @sitemap.', - 'variables' => array( - '@sitemap' => 'http://example.com/sitemap-2.xml', - ), - )); - } - - /** - * Test Ping. - */ - public function testPing() { - $edit = array('xmlsitemap_engines_engines[simpletest]' => TRUE); - $this->drupalPost('admin/config/search/xmlsitemap/engines', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.')); - - $this->submitEngines(); - $this->assertWatchdogMessage(array('type' => 'xmlsitemap', 'message' => 'Submitted the sitemap to %url and received response @code.')); - $this->assertWatchdogMessage(array('type' => 'xmlsitemap', 'message' => 'Recieved ping for @sitemap.')); - } - - /** - * Test Custom URL. - * - * @codingStandardsIgnoreStart - */ - public function testCustomURL() { - // @codingStandardsIgnoreEnd - $edit = array('xmlsitemap_engines_custom_urls' => 'an-invalid-url'); - $this->drupalPost('admin/config/search/xmlsitemap/engines', $edit, t('Save configuration')); - $this->assertText('Invalid URL an-invalid-url.'); - $this->assertNoText('The configuration options have been saved.'); - - $url = url('ping', array('absolute' => TRUE)); - $edit = array('xmlsitemap_engines_custom_urls' => $url); - $this->drupalPost('admin/config/search/xmlsitemap/engines', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.')); - - $this->submitEngines(); - $this->assertWatchdogMessage(array( - 'type' => 'xmlsitemap', - 'message' => 'Submitted the sitemap to %url and received response @code.', - 'variables' => array( - '%url' => $url, - '@code' => '404', - ), - )); - $this->assertWatchdogMessage(array('type' => 'xmlsitemap', 'message' => 'No valid sitemap parameter provided.')); - $this->assertWatchdogMessage(array('type' => 'page not found', 'message' => 'ping')); - - $edit = array('xmlsitemap_engines_custom_urls' => $this->submit_url); - $this->drupalPost('admin/config/search/xmlsitemap/engines', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.')); - - $this->submitEngines(); - $url = xmlsitemap_engines_prepare_url($this->submit_url, url('sitemap.xml', array('absolute' => TRUE))); - $this->assertWatchdogMessage(array( - 'type' => 'xmlsitemap', - 'message' => 'Submitted the sitemap to %url and received response @code.', - 'variables' => array( - '%url' => $url, - '@code' => '200', - ), - )); - $this->assertWatchdogMessage(array( - 'type' => 'xmlsitemap', - 'message' => 'Recieved ping for @sitemap.', - 'variables' => array( - '@sitemap' => url('sitemap.xml', array( - 'absolute' => TRUE, - )), - ), - )); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info deleted file mode 100644 index f655db4c5a..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info +++ /dev/null @@ -1,11 +0,0 @@ -name = XML sitemap engines test -description = Support module for XML sitemap engines testing. -package = Testing -core = 7.x -hidden = TRUE - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.module deleted file mode 100644 index a60ee8afe4..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.module +++ /dev/null @@ -1,51 +0,0 @@ - 'xmlsitemap_engines_test_pinged', - // @codingStandardsIgnoreLine - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** - * Implements hook_xmlsitemap_engine_info(). - */ -function xmlsitemap_engines_test_xmlsitemap_engine_info() { - $engines['simpletest'] = array( - 'name' => t('SimpleTest'), - 'url' => 'http://example.com/', - ); - return $engines; -} - -/** - * Implements hook_xmlsitemap_engine_info_alter(). - */ -function xmlsitemap_engines_test_xmlsitemap_engine_info_alter(&$engines) { - $engines['simpletest']['url'] = url('ping', array('absolute' => TRUE, 'query' => array('sitemap' => ''))) . '[sitemap]'; -} - -/** - * Test pinged. - */ -function xmlsitemap_engines_test_pinged() { - if (empty($_GET['sitemap']) || !valid_url($_GET['sitemap'])) { - watchdog('xmlsitemap', 'No valid sitemap parameter provided.', array(), WATCHDOG_WARNING); - // @todo Remove this? Causes an extra watchdog error to be handled. - return MENU_NOT_FOUND; - } - else { - watchdog('xmlsitemap', 'Recieved ping for @sitemap.', array('@sitemap' => $_GET['sitemap'])); - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.admin.inc b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.admin.inc deleted file mode 100644 index 1a1e2c238f..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.admin.inc +++ /dev/null @@ -1,82 +0,0 @@ - $engine_info) { - $engine_options[$engine] = $engine_info['name']; - } - asort($engine_options); - - $form['xmlsitemap_engines_engines'] = array( - '#type' => 'checkboxes', - '#title' => t('Submit the sitemap to the following engines'), - '#default_value' => variable_get('xmlsitemap_engines_engines', array()), - '#options' => $engine_options, - ); - $form['xmlsitemap_engines_minimum_lifetime'] = array( - '#type' => 'select', - '#title' => t('Do not submit more often than every'), - '#options' => drupal_map_assoc(array( - 3600, - 10800, - 21600, - 32400, - 43200, - 86400, - 172800, - 259200, - 604800, - 604800 * 2, - 604800 * 4, - ), 'format_interval'), - '#default_value' => variable_get('xmlsitemap_engines_minimum_lifetime', 86400), - ); - $form['xmlsitemap_engines_submit_updated'] = array( - '#type' => 'checkbox', - '#title' => t('Only submit if the sitemap has been updated since the last submission.'), - '#default_value' => variable_get('xmlsitemap_engines_submit_updated', TRUE), - ); - $form['xmlsitemap_engines_custom_urls'] = array( - '#type' => 'textarea', - '#title' => t('Custom submission URLs'), - '#description' => t('Enter one URL per line. The token [sitemap] will be replaced with the URL to your sitemap. For example: %example-before would become %example-after.', array( - '%example-before' => 'http://example.com/ping?[sitemap]', - '%example-after' => xmlsitemap_engines_prepare_url('http://example.com/ping?[sitemap]', url('sitemap.xml', array( - 'absolute' => TRUE, - ))), - )), - '#default_value' => variable_get('xmlsitemap_engines_custom_urls', ''), - '#rows' => 2, - '#wysiwyg' => FALSE, - '#element_validate' => array('xmlsitemap_engines_validate_custom_urls'), - ); - - // Ensure the xmlsitemap_engines variable gets filterd to a simple array. - $form['array_filter'] = array('#type' => 'value', '#value' => TRUE); - - return system_settings_form($form); -} - -/** - * Validate the custom submission URL element. - */ -function xmlsitemap_engines_validate_custom_urls($element, &$form_state) { - $custom_urls = preg_split('/[\r\n]+/', $element['#value'], -1, PREG_SPLIT_NO_EMPTY); - foreach ($custom_urls as $custom_url) { - $url = xmlsitemap_engines_prepare_url($custom_url, ''); - if (!valid_url($url, TRUE)) { - form_error($element, t('Invalid URL %url.', array('%url' => $custom_url))); - } - } - $form_state['values']['xmlsitemap_engines_custom_urls'] = implode("\n", $custom_urls); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.api.php b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.api.php deleted file mode 100644 index 63fe155b41..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.api.php +++ /dev/null @@ -1,34 +0,0 @@ - t('Example search engine'), - 'url' => 'http://example.com/ping?sitemap=[sitemap]', - ); - return $engines; -} - -/** - * Alter the list of sitemap engines. - */ -function hook_xmlsitemap_engine_info_alter(&$engines) { - $engines['example']['name'] = t('Kitten Search'); - $engines['example']['url'] = 'http://kittens.com/ping?sitemap=[sitemap]'; -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info deleted file mode 100644 index c192d5631c..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info +++ /dev/null @@ -1,14 +0,0 @@ -name = XML sitemap engines -description = Submit the sitemap to search engines. -package = XML sitemap -core = 7.x -dependencies[] = xmlsitemap -files[] = tests/xmlsitemap_engines.test -recommends[] = site_verify -configure = admin/config/search/xmlsitemap/engines - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.install b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.install deleted file mode 100644 index 72ec1cc776..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.install +++ /dev/null @@ -1,45 +0,0 @@ -fields(array('weight' => 2)) - ->condition('type', 'module') - ->condition('name', 'xmlsitemap_engines') - ->execute(); -} - -/** - * Implements hook_uninstall(). - */ -function xmlsitemap_engines_uninstall() { - variable_del('xmlsitemap_engines_engines'); - variable_del('xmlsitemap_engines_custom_urls'); - variable_del('xmlsitemap_engines_minimum_lifetime'); - variable_del('xmlsitemap_engines_submit_last'); - variable_del('xmlsitemap_engines_submit_updated'); -} - -/** - * Deprecate support for Ask.com, Moreover, and Yahoo! search engines. - */ -function xmlsitemap_engines_update_6202() { - $engines = variable_get('xmlsitemap_engines_engines', array()); - $removed = array( - 'ask' => 'Ask.com', - 'moreover' => 'Moreover', - 'yahoo' => 'Yahoo.com', - ); - $engines = array_diff($engines, array_keys($removed)); - variable_set('xmlsitemap_engines_engines', $engines); - return t('The following search engines have deprecated their XML sitemap ping services and have been disabled: !list.', array('!list' => implode(', ', $removed))); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.module deleted file mode 100644 index 300d2da745..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.module +++ /dev/null @@ -1,257 +0,0 @@ - 'xmlsitemap', - ); - $hooks['xmlsitemap_engine_info_alter'] = array( - 'group' => 'xmlsitemap', - ); - return $hooks; -} - -/** - * Implements hook_help(). - */ -function xmlsitemap_engines_help($path, $arg) { - $output = ''; - switch ($path) { - case 'admin/config/search/xmlsitemap/engines': - if (!module_exists('site_verify')) { - $output .= '

' . t('In order to verify site ownership with the search engines listed below, it is highly recommended to download and install the Site verification module.', array('@site-verify' => 'https://www.drupal.org/project/site_verify')) . '

'; - } - break; - } - - return $output; -} - -/** - * Implements hook_menu(). - */ -function xmlsitemap_engines_menu() { - $items['admin/config/search/xmlsitemap/engines'] = array( - 'title' => 'Search Engines', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('xmlsitemap_engines_settings_form'), - 'access arguments' => array('administer xmlsitemap'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'xmlsitemap_engines.admin.inc', - ); - // @code - // $items['admin/config/search/xmlsitemap/engines/submit'] = array( - // 'page callback' => 'xmlsitemap_engines_submit', - // 'access callback' => 'xmlsitemap_engines_submit_access', - // 'type' => MENU_CALLBACK, - // ); - // @endcode - return $items; -} - -/** - * Implements hook_cron(). - */ -function xmlsitemap_engines_cron() { - if (xmlsitemap_engines_submit_access()) { - xmlsitemap_engines_submit_engines(); - } -} - -/** - * Check if can submit. - */ -function xmlsitemap_engines_can_submit() { - // Skip if the site is offline since search engines will not be able to - // access the site's content. - if (variable_get('maintenance_mode', 0) || defined('MAINTENANCE_MODE')) { - return FALSE; - } - - if (!variable_get('xmlsitemap_engines_engines', array()) && !variable_get('xmlsitemap_engines_custom_urls', '')) { - return FALSE; - } - - return TRUE; -} - -/** - * Submit access. - */ -function xmlsitemap_engines_submit_access() { - if (!xmlsitemap_engines_can_submit()) { - return FALSE; - } - - // Allow manual submissions to run. - // @code - // @codingStandardsIgnoreLine - // if ($_GET['q'] == 'admin/config/search/xmlsitemap/engines/submit' && user_access('administer xmlsitemap')) { - // return TRUE; - // } - // @endcode - $submit_updated = variable_get('xmlsitemap_engines_submit_updated', TRUE); - $submitted_last = variable_get('xmlsitemap_engines_submit_last', 0); - $minimum_lifetime = variable_get('xmlsitemap_engines_minimum_lifetime', 86400); - - // Skip if sitemap data has not been updated since last submission. - if ($submit_updated && variable_get('xmlsitemap_generated_last', 0) <= $submitted_last) { - return FALSE; - } - - // Skip if the time since last submission is less than the minimum lifetime. - if ((REQUEST_TIME - $submitted_last) < $minimum_lifetime) { - return FALSE; - } - - return TRUE; -} - -/** - * Submit the sitemaps to all the specified search engines. - * - * @param array $smids - * An optional array of XML sitemap IDs. If not provided, it will load all - * existing XML sitemaps. - */ -function xmlsitemap_engines_submit_engines(array $smids = array()) { - if (empty($smids)) { - $smids = FALSE; - } - - $sitemaps = xmlsitemap_sitemap_load_multiple($smids); - $engines = variable_get('xmlsitemap_engines_engines', array()); - $engine_info = xmlsitemap_engines_get_engine_info(); - - foreach ($engines as $engine) { - if (isset($engine_info[$engine]['url'])) { - xmlsitemap_engines_submit_sitemaps($engine_info[$engine]['url'], $sitemaps); - } - } - - $custom_urls = variable_get('xmlsitemap_engines_custom_urls', ''); - $custom_urls = preg_split('/[\r\n]+/', $custom_urls, -1, PREG_SPLIT_NO_EMPTY); - foreach ($custom_urls as $custom_url) { - xmlsitemap_engines_submit_sitemaps($custom_url, $sitemaps); - } - - variable_set('xmlsitemap_engines_submit_last', REQUEST_TIME); -} - -/** - * Submit the sitemaps to a specific URL. - * - * @param string $url - * The URL for sitemap submission. - * @param array $sitemaps - * An array of URLs of the sitemaps to submit. - */ -function xmlsitemap_engines_submit_sitemaps($url, array $sitemaps) { - foreach ($sitemaps as $sitemap) { - $sitemap->url = url($sitemap->uri['path'], $sitemap->uri['options']); - $submit_url = xmlsitemap_engines_prepare_url($url, $sitemap->url); - $request = drupal_http_request($submit_url); - watchdog('xmlsitemap', 'Submitted the sitemap to %url and received response @code.', array('%url' => $submit_url, '@code' => $request->code)); - } -} - -/** - * Replace valid tokens in the URL with their appropriate values. - * - * @param string $url - * An un-tokenized URL. - * - * @return string - * A tokenized URL. - */ -function xmlsitemap_engines_prepare_url($url, $sitemap) { - return str_replace('[sitemap]', $sitemap, $url); -} - -/** - * Returns information about supported search engines. - * - * @param string $engine - * (optional) The engine to return information for. If omitted, information - * for all engines is returned. - * - * @see hook_xmlsitemap_engines_info() - * @see hook_xmlsitemap_engines_info_alter() - */ -function xmlsitemap_engines_get_engine_info($engine = NULL) { - global $language; - $engines = &drupal_static(__FUNCTION__); - - if (!isset($engines)) { - if ($cached = cache_get('xmlsitemap:engines:' . $language->language)) { - $engines = $cached->data; - } - else { - // Fetch the results of all hook_xmlsitemap_engine_info() implementations. - $engines = module_invoke_all('xmlsitemap_engine_info'); - // Allow other modulse to alter the engine info. - drupal_alter('xmlsitemap_engine_info', $engines); - // Cache by language since engine names are translated. - cache_set('xmlsitemap:engines:' . $language->language, $engines); - } - } - - if (isset($engine)) { - return isset($engines[$engine]) ? $engines[$engine] : NULL; - } - else { - return $engines; - } -} - -/** - * Implements hook_xmlsitemap_engine_info(). - */ -function xmlsitemap_engines_xmlsitemap_engine_info() { - $engines['google'] = array( - 'name' => t('Google'), - 'url' => 'https://www.google.com/webmasters/tools/ping?sitemap=[sitemap]', - 'help url' => 'https://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184', - ); - $engines['bing'] = array( - 'name' => t('Bing'), - 'url' => 'https://www.bing.com/webmaster/ping.aspx?siteMap=[sitemap]', - 'help url' => 'https://www.bing.com/webmaster', - ); - return $engines; -} - -/** - * Implements hook_variables(). - */ -function xmlsitemap_engines_variables() { - $variables = array( - 'xmlsitemap_engines_engines' => array(), - 'xmlsitemap_engines_custom_urls' => '', - 'xmlsitemap_engines_minimum_lifetime' => 86400, - 'xmlsitemap_engines_submit_last' => 0, - 'xmlsitemap_engines_submit_updated' => TRUE, - ); - return $variables; -} - -/** - * Implements hook_xmlsitemap_sitemap_operations(). - */ -function xmlsitemap_engines_xmlsitemap_sitemap_operations() { - if (xmlsitemap_engines_can_submit()) { - $operations['xmlsitemap_engines_submit'] = array( - 'label' => t('Submit to search engines'), - 'action past' => t('Submitted'), - 'callback' => 'xmlsitemap_engines_submit_engines', - ); - return $operations; - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info deleted file mode 100644 index da3fe3f0f3..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info +++ /dev/null @@ -1,13 +0,0 @@ -name = XML sitemap internationalization -description = Enables multilingual XML sitemaps. -package = XML sitemap -core = 7.x -dependencies[] = xmlsitemap -dependencies[] = i18n -files[] = xmlsitemap_i18n.test - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module deleted file mode 100644 index 3908ba30bb..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module +++ /dev/null @@ -1,126 +0,0 @@ - t('Language'), - 'summary callback' => 'locale_language_name', - 'default' => language_default('language'), - ); - return $context; -} - -/** - * Implements hook_xmlsitemap_context(). - */ -function xmlsitemap_i18n_xmlsitemap_context() { - $context['language'] = $GLOBALS['language']->language; - return $context; -} - -/** - * Implements xmlsitemap_context_url_options(). - */ -function xmlsitemap_i18n_xmlsitemap_context_url_options(array $context) { - $options = array(); - if (isset($context['language'])) { - $options['language'] = xmlsitemap_language_load($context['language']); - } - return $options; -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function xmlsitemap_i18n_form_xmlsitemap_sitemap_edit_form_alter(&$form, $form_state) { - $form['context']['language'] = array( - '#type' => 'select', - '#title' => t('Language'), - '#options' => locale_language_list(), - '#default_value' => isset($form['#sitemap']->context['language']) ? $form['#sitemap']->context['language'] : LANGUAGE_NONE, - ); -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Set the regeneration needed flag if settings are changed. - */ -function xmlsitemap_form_locale_languages_overview_form_alter(&$form, $form_state) { - array_unshift($form['#submit'], 'xmlsitemap_form_submit_flag_regenerate'); -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Set the regeneration needed flag if multilingual settings are changed. - */ -function xmlsitemap_i18n_form_i18n_admin_settings_alter(&$form, $form_state) { - array_unshift($form['#submit'], 'xmlsitemap_form_submit_flag_regenerate'); -} - -/** - * Implements hook_query_TAG_alter(). - * - * @see i18n_db_rewrite_where() - */ -function xmlsitemap_i18n_query_xmlsitemap_generate_alter(QueryAlterableInterface $query) { - $mode = variable_get('i18n_selection_mode', 'simple'); - $sitemap = $query->getMetaData('sitemap'); - - if (!isset($sitemap->context['language']) || $mode == 'off') { - return; - } - - // Get languages to simplify query building. - $current = $sitemap->context['language']; - $default = language_default(); - - if ($mode == 'mixed' && $current == $default) { - // If mode is mixed but current = default, is the same as 'simple'. - $mode = 'simple'; - } - - switch ($mode) { - case 'simple': - // Current language and language neutral. - $query->condition('x.language', array($current, LANGUAGE_NONE)); - break; - - case 'mixed': - // Mixed current language (if available) or default language (if not) and - // language neutral. - $query->condition('x.language', array($current, $default, LANGUAGE_NONE)); - break; - - case 'default': - // Only default language and language neutral. - $query->condition('x.language', array($default, LANGUAGE_NONE)); - break; - - case 'strict': - // Only current language (for nodes), simple for all other types. - $node_condition = db_and(); - $node_condition->condition('x.type', 'node'); - $node_condition->condition('x.language', $current); - $normal_condition = db_and(); - $normal_condition->condition('x.type', 'node', '<>'); - $normal_condition->condition('x.language', array($current, LANGUAGE_NONE)); - $condition = db_or(); - $condition->condition($node_condition); - $condition->condition($normal_condition); - $query->condition($condition); - break; - - case 'off': - // All content. No language conditions apply. - break; - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.test deleted file mode 100644 index 9467d0f4ab..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.test +++ /dev/null @@ -1,176 +0,0 @@ -execute(); - - $sitemap = new stdClass(); - $sitemap->context = array('language' => 'en'); - xmlsitemap_sitemap_save($sitemap); - $sitemap = new stdClass(); - $sitemap->context = array('language' => 'fr'); - xmlsitemap_sitemap_save($sitemap); - } - -} - -/** - * I18n Test. - */ -class XMLSitemapI18nTest extends XMLSitemapI18nWebTestCase { - - /** - * Get Info. - */ - public static function getInfo() { - return array( - 'name' => 'XML sitemap i18n tests', - 'description' => 'Functional and integration tests for the XML sitemap and internationalization modules.', - 'group' => 'XML sitemap', - 'dependencies' => array('i18n', 'disable-this-test-for-now'), - ); - } - - /** - * Language Selection. - */ - public function testLanguageSelection() { - // Create our three different language nodes. - $node = $this->addSitemapLink(array('type' => 'node', 'language' => LANGUAGE_NONE)); - $node_en = $this->addSitemapLink(array('type' => 'node', 'language' => 'en')); - $node_fr = $this->addSitemapLink(array('type' => 'node', 'language' => 'fr')); - - // Create three non-node language nodes. - $link = $this->addSitemapLink(array('language' => LANGUAGE_NONE)); - $link_en = $this->addSitemapLink(array('language' => 'en')); - $link_fr = $this->addSitemapLink(array('language' => 'fr')); - - variable_set('i18n_selection_mode', 'off'); - $this->regenerateSitemap(); - $this->drupalGetSitemap(array('language' => 'en')); - $this->assertRawSitemapLinks($node, $node_en, $node_fr, $link, $link_en, $link_fr); - $this->drupalGetSitemap(array('language' => 'fr')); - $this->assertRawSitemapLinks($node, $node_en, $node_fr, $link, $link_en, $link_fr); - - variable_set('i18n_selection_mode', 'simple'); - $this->regenerateSitemap(); - $this->drupalGetSitemap(array('language' => 'en')); - $this->assertRawSitemapLinks($node, $node_en, $link, $link_en); - $this->assertNoRawSitemapLinks($node_fr, $link_fr); - $this->drupalGetSitemap(array('language' => 'fr')); - $this->assertRawSitemapLinks($node, $node_fr, $link, $link_fr); - $this->assertNoRawSitemapLinks($node_en, $link_en); - - variable_set('i18n_selection_mode', 'mixed'); - $this->regenerateSitemap(); - $this->drupalGetSitemap(array('language' => 'en')); - $this->assertRawSitemapLinks($node, $node_en, $link, $link_en); - $this->assertNoRawSitemapLinks($node_fr, $link_fr); - $this->drupalGetSitemap(array('language' => 'fr')); - $this->assertRawSitemapLinks($node, $node_en, $node_fr, $link, $link_en, $link_fr); - - variable_set('i18n_selection_mode', 'default'); - $this->regenerateSitemap(); - $this->drupalGetSitemap(array('language' => 'en')); - $this->assertRawSitemapLinks($node, $node_en, $link, $link_en); - $this->assertNoRawSitemapLinks($node_fr, $link_fr); - $this->drupalGetSitemap(array('language' => 'fr')); - $this->assertRawSitemapLinks($node, $node_en, $link, $link_en); - $this->assertNoRawSitemapLinks($node_fr, $link_fr); - - // With strict mode, the language neutral node should not be found, but the - // language neutral non-node should be. - variable_set('i18n_selection_mode', 'strict'); - $this->regenerateSitemap(); - $this->drupalGetSitemap(array('language' => 'en')); - $this->assertRawSitemapLinks($node_en, $link, $link_en); - $this->assertNoRawSitemapLinks($node, $node_fr, $link_fr); - $this->drupalGetSitemap(array('language' => 'fr')); - $this->assertRawSitemapLinks($node_fr, $link, $link_fr); - $this->assertNoRawSitemapLinks($node, $node_en, $link_en); - } - -} - -/** - * Node Test. - */ -class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase { - - /** - * Get Info. - */ - public static function getInfo() { - return array( - 'name' => 'XML sitemap i18n node tests', - 'description' => 'Functional and integration tests for the XML sitemap node and internationalization modules.', - 'group' => 'XML sitemap', - 'dependencies' => array('i18n', 'disable-this-test-for-now'), - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'xmlsitemap_node'; - parent::setUp($modules); - - variable_set('language_content_type_page', 1); - $this->admin_user = $this->drupalCreateUser(array('administer nodes')); - $this->drupalLogin($this->admin_user); - } - - /** - * Node Language Data. - */ - public function testNodeLanguageData() { - $node = $this->drupalCreateNode(array()); - - $this->drupalPost('node/' . $node->nid . '/edit', array('language' => 'en'), t('Save')); - $link = $this->assertSitemapLink('node', $node->nid); - $this->assertIdentical($link['language'], 'en'); - - $this->drupalPost('node/' . $node->nid . '/edit', array('language' => 'fr'), t('Save')); - $link = $this->assertSitemapLink('node', $node->nid); - $this->assertIdentical($link['language'], 'fr'); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/README.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/README.txt deleted file mode 100644 index cd61435fde..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/README.txt +++ /dev/null @@ -1,79 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Recommended modules -* Installation -* Configuration -* Maintainers - - -INTRODUCTION ------------- - -The XML sitemap menu module, part of the XML sitemap -(https://www.drupal.org/project/xmlsitemap) package, enables menu links to be on -the site map. The XML sitemap module creates a sitemap that conforms to the -sitemaps.org specification. This helps search engines to more intelligently -crawl a website and keep their results up to date. - -* For a full description of the module visit - https://www.drupal.org/documentation/modules/xmlsitemap - -* To submit bug reports and feature suggestions, or to track changes visit - https://www.drupal.org/project/issues/xmlsitemap - - -REQUIREMENTS ------------- - -This module requires the following module: - -* XML sitemap - https://www.drupal.org/project/xmlsitemap - - -RECOMMENDED MODULES -------------------- - -* Ctools - https://www.drupal.org/project/ctools -* RobotsTxt - https://www.drupal.org/project/robotstxt -* Site Verification - https://www.drupal.org/project/site_verify -* Browscap - https://www.drupal.org/project/browscap -* Vertical Tabs - https://www.drupal.org/project/vertical_tabs - - -INSTALLATION ------------- - -This is a submodule of the XML sitemap module. Install the XML sitemap module as -you would normally install a contributed Drupal module. Visit -https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- - -1. Install the XML sitemap module. -2. Enable the XML sitemap module. -3. To include menu items in the sitemap, enable the XML sitemap menu submodule. -4. Navigate to Administration > Configuration > Search > XML Sitemap. -5. Select the Settings tab and there will be a Menu link field set. Open. -6. Choose the menu link to be edited. There will now be a XML sitemap horizontal - tab. Under "Inclusion" change "Excluded" to become "Included". Select Save. -7. Once that is all complete, go to Configuration > Search and Metadata > XML - Sitemap. -8. Select the Rebuild Links tab in the upper right. -9. Select on "Rebuild sitemap" even if the message says that you do not need to. -10. Now you're taken back to the configuration page which shows you the link to - your XML sitemap which you can select and confirm that pages have been - added. - - -MAINTAINERS ------------ - -* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu -* Dave Reid - https://www.drupal.org/u/dave-reid -* Juampy NR (juampynr) - https://www.drupal.org/u/juampynr -* Tasya Rukmana (tadityar) - https://www.drupal.org/u/tadityar diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info deleted file mode 100644 index 2286474ff7..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info +++ /dev/null @@ -1,13 +0,0 @@ -name = XML sitemap menu -description = Adds menu item links to the sitemap. -package = XML sitemap -core = 7.x -dependencies[] = xmlsitemap -dependencies[] = menu -files[] = xmlsitemap_menu.test - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.install b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.install deleted file mode 100644 index 54136da358..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.install +++ /dev/null @@ -1,47 +0,0 @@ - variable_get('xmlsitemap_menu_status_' . $menu, XMLSITEMAP_STATUS_DEFAULT), - 'priority' => variable_get('xmlsitemap_menu_priority_' . $menu, XMLSITEMAP_PRIORITY_DEFAULT), - ); - variable_set('xmlsitemap_settings_menu_' . $menu, $settings); - variable_del('xmlsitemap_menu_status_' . $menu); - variable_del('xmlsitemap_menu_priority_' . $menu); - variable_del('xmlsitemap_menu_calculate_priority_' . $menu); - } - variable_del('xmlsitemap_menu_menus'); - variable_del('xmlsitemap_menu_calculate_priority'); -} - -/** - * Rename the menu type to 'menu_link'. - */ -function xmlsitemap_menu_update_6201() { - drupal_load('module', 'xmlsitemap'); - xmlsitemap_link_type_rename('menu', 'menu_link'); -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module deleted file mode 100644 index 9864c5fe0c..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module +++ /dev/null @@ -1,329 +0,0 @@ - t('Menu link'), - 'controller class' => 'DrupalDefaultEntityController', - 'base table' => 'menu_links', - 'uri callback' => 'xmlsitemap_menu_menu_link_uri', - 'fieldable' => FALSE, - 'static cache' => TRUE, - 'field cache' => TRUE, - 'entity keys' => array( - 'id' => 'mlid', - 'bundle' => 'menu_name', - 'label' => 'link_title', - 'revision' => '', - ), - 'load hook' => NULL, - 'view modes' => array(), - 'translation' => array(), - 'schema_fields_sql' => array( - 'base table' => drupal_schema_fields_sql('menu_links'), - ), - 'xmlsitemap' => array( - 'process callback' => 'xmlsitemap_menu_xmlsitemap_process_menu_links', - ), - 'bundle label' => t('Menu'), - 'token type' => 'menu_link', - ); - - foreach (menu_get_menus() as $type => $name) { - $info['menu_link']['bundles'][$type] = array( - 'label' => $name, - 'admin' => array( - 'path' => 'admin/structure/menu/manage/%menu/edit', - 'bundle argument' => 4, - 'real path' => 'admin/structure/menu/manage/' . $type . '/edit', - 'access arguments' => array('administer menus'), - ), - ); - } - } - else { - // If the entity type already exists ensure the xmlsitemap is added. - $info['menu_link'] += array( - 'uri callback' => 'xmlsitemap_menu_menu_link_uri', - 'xmlsitemap' => array( - 'process callback' => 'xmlsitemap_menu_xmlsitemap_process_menu_links', - ), - ); - if (!isset($info['menu_link']['bundle label'])) { - $info['menu_link']['bundle label'] = t('Menu'); - } - } -} - -/** - * Entity URI callback. - */ -function xmlsitemap_menu_menu_link_uri($menu_item) { - return is_array($menu_item) ? $menu_item['href'] : $menu_item->href; -} - -/** - * Implements hook_cron(). - * - * Process old menu links not found in the {xmlsitemap} table. - */ -function xmlsitemap_menu_cron() { - xmlsitemap_menu_xmlsitemap_index_links(xmlsitemap_var('batch_limit')); -} - -/** - * Implements hook_xmlsitemap_index_links(). - */ -function xmlsitemap_menu_xmlsitemap_index_links($limit) { - if ($menus = xmlsitemap_get_link_type_enabled_bundles('menu_link')) { - $sql = "SELECT ml.mlid FROM {menu_links} ml LEFT JOIN {xmlsitemap} x ON x.type = 'menu' AND ml.mlid = x.id WHERE x.id IS NULL AND ml.menu_name IN (:menus) ORDER BY ml.mlid DESC"; - $mlids = db_query_range($sql, 0, $limit, array(':menus' => $menus))->fetchCol(); - xmlsitemap_menu_xmlsitemap_process_menu_links($mlids); - } -} - -/** - * Process menu sitemap links. - * - * @param array $mlids - * An array of menu link IDs. - */ -function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids, array $xmlsitemap = array()) { - // Set the global user variable to the anonymous user. - xmlsitemap_switch_user(0); - - foreach ($mlids as $mlid) { - $menu_item = menu_link_load($mlid); - if (empty($menu_item)) { - continue; - } - if (!empty($xmlsitemap)) { - $menu_item['xmlsitemap'] = $xmlsitemap; - } - $link = xmlsitemap_menu_create_link($menu_item); - xmlsitemap_link_save($link, array($link['type'] => $menu_item)); - } - - // Set the global user variable back to the original user. - xmlsitemap_restore_user(); -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * @see menu_edit_menu() - * @see xmlsitemap_add_link_bundle_settings() - */ -function xmlsitemap_menu_form_menu_edit_menu_alter(&$form, $form_state) { - $menu = isset($form['menu_name']['#default_value']) ? $form['menu_name']['#default_value'] : ''; - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_link_bundle_settings($form, $form_state, 'menu_link', $menu); -} - -/** - * Example functions. - * - * Function xmlsitemap_menu_form_menu_overview_form_alter(&$form, $form_state) { - * $form['#submit'][] = 'xmlsitemap_menu_menu_overview_form_submit'; - * } - * - * Function xmlsitemap_menu_menu_overview_form_submit($form, $form_state) { - * $mlids = array(); - * foreach (element_children($form) as $mlid) { - * if (isset($form[$mlid]['#item'])) { - * $mlids[] = $form[$mlid]['#item']['mlid']; - * } - * } - * xmlsitemap_menu_xmlsitemap_process_menu_links($mlids); - * } - */ - -/** - * Implements hook_form_FORM_ID_alter(). - * - * @see menu_edit_item() - */ -function xmlsitemap_menu_form_menu_edit_item_alter(&$form, $form_state) { - $menu_name = $form['parent']['#default_value']; - $menu_name = substr($menu_name, 0, strpos($menu_name, ':')); - - // Add the link options. - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_form_link_options($form, 'menu_link', $menu_name, $form['mlid']['#value']); - $form['xmlsitemap']['#weight'] = 30; -} - -/** - * Implements hook_menu_insert(). - */ -function xmlsitemap_menu_menu_insert(array $menu) { - if (isset($menu['xmlsitemap'])) { - xmlsitemap_link_bundle_settings_save('menu_link', $menu['menu_name'], $menu['xmlsitemap']); - } - - // When menus change, the bundles we defined in - // xmlsitemap_menu_entity_info_alter() change, so we need to clear the cache. - entity_info_cache_clear(); -} - -/** - * Implements hook_menu_update(). - */ -function xmlsitemap_menu_menu_update(array $menu) { - if (isset($menu['xmlsitemap'])) { - xmlsitemap_link_bundle_settings_save('menu_link', $menu['menu_name'], $menu['xmlsitemap']); - } - - // When menus change, the bundles we defined in - // xmlsitemap_menu_entity_info_alter() change, so we need to clear the cache. - entity_info_cache_clear(); -} - -/** - * Implements hook_menu_delete(). - */ -function xmlsitemap_menu_menu_delete(array $menu) { - xmlsitemap_link_bundle_delete('menu_link', $menu['menu_name']); - - // When menus change, the bundles we defined in - // xmlsitemap_menu_entity_info_alter() change, so we need to clear the cache. - entity_info_cache_clear(); -} - -/** - * Implements hook_menu_link_insert(). - */ -function xmlsitemap_menu_menu_link_insert(array $link) { - $link += array('xmlsitemap' => array()); - xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']), $link['xmlsitemap']); -} - -/** - * Implements hook_menu_link_update(). - * - * @see hook_menu_link_alter() - */ -function xmlsitemap_menu_menu_link_update(array $link) { - // $link += array('xmlsitemap' => array()); - // @codingStandardsIgnoreLine - // xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']), $link['xmlsitemap']);. -} - -/** - * Implements hook_menu_link_alter(). - * - * We have to use this hook rather than hook_menu_link_update() because this - * hook is not always called if the user does not edit the core menu item - * fields. - * - * @see https://www.drupal.org/node/1013856 - */ -function xmlsitemap_menu_menu_link_alter(array &$link) { - if (!empty($link['mlid'])) { - $link += array('xmlsitemap' => array()); - xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']), $link['xmlsitemap']); - } -} - -/** - * Implements hook_menu_link_delete(). - */ -function xmlsitemap_menu_menu_link_delete(array $link) { - xmlsitemap_link_delete('menu_link', $link['mlid']); -} - -/** - * Create a sitemap link from a menu item. - * - * @param array $menu_item - * A loaded menu item. - */ -function xmlsitemap_menu_create_link(array $menu_item) { - if (!isset($menu_item['xmlsitemap'])) { - $menu_item['xmlsitemap'] = array(); - if ($menu_item['mlid'] && $link = xmlsitemap_link_load('menu_link', $menu_item['mlid'])) { - $menu_item['xmlsitemap'] = $link; - } - } - - $settings = xmlsitemap_link_bundle_load('menu_link', $menu_item['menu_name']); - - $menu_item['xmlsitemap'] += array( - 'type' => 'menu_link', - 'id' => $menu_item['mlid'], - 'status' => $settings['status'], - 'status_default' => $settings['status'], - 'status_override' => 0, - 'priority' => $settings['priority'], - 'priority_default' => $settings['priority'], - 'priority_override' => 0, - ); - - // The following values must always be checked because they are volatile. - $menu_item['xmlsitemap']['loc'] = $menu_item['href']; - $menu_item['xmlsitemap']['subtype'] = $menu_item['menu_name']; - $menu_item['xmlsitemap']['access'] = $menu_item['access'] && !$menu_item['external'] && !$menu_item['hidden']; - $menu_item['xmlsitemap']['language'] = isset($menu_item['options']['langcode']) ? $menu_item['options']['langcode'] : LANGUAGE_NONE; - - // Exclude menu items created for nodes that are added by xmlsitemap_node. - if ($menu_item['xmlsitemap']['access'] && $menu_item['router_path'] == 'node/%' && module_exists('xmlsitemap_node')) { - $node = node_load(substr($menu_item['link_path'], 5)); - if ($node) { - if (empty($node->xmlsitemap)) { - xmlsitemap_node_create_link($node); - } - if ($node->xmlsitemap['status'] && $node->xmlsitemap['access']) { - $menu_item['xmlsitemap']['status'] = FALSE; - } - } - } - - return $menu_item['xmlsitemap']; -} - -/** - * Calculate the priority of a menu link based on depth and weight. - */ -function xmlsitemap_menu_calculate_priority(array $menu_item) { - $priority = (MENU_MAX_DEPTH - $menu_item['depth'] + 1) / MENU_MAX_DEPTH; - $priority -= (50 + $menu_item['weight']) / (100 * (MENU_MAX_DEPTH + 1)); - return $priority; -} - -/** - * Internal default variables for template_var(). - */ -function xmlsitemap_menu_variables() { - $defaults = array(); - $menus = array_keys(menu_get_menus()); - foreach ($menus as $menu) { - $defaults['xmlsitemap_settings_menu_' . $menu] = array( - 'status' => XMLSITEMAP_STATUS_DEFAULT, - 'priority' => XMLSITEMAP_PRIORITY_DEFAULT, - ); - } - return $defaults; -} - -/** - * Implements hook_features_pipe_COMPONENT_alter(). - * - * Add variables to exported menus. - */ -function xmlsitemap_menu_features_pipe_menu_custom_alter(&$pipe, $data, $export) { - if (!empty($data)) { - foreach ($data as $menu_name) { - $pipe['variable'][] = "xmlsitemap_settings_menu_link_{$menu_name}"; - } - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.test deleted file mode 100644 index 2f8bd428de..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.test +++ /dev/null @@ -1,78 +0,0 @@ - 'XML sitemap menu', - 'description' => 'Functional tests for the XML sitemap menu module.', - 'group' => 'XML sitemap', - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'xmlsitemap_menu'; - $modules[] = 'menu'; - parent::setUp($modules); - - $this->admin_user = $this->drupalCreateUser(array('administer menu', 'administer xmlsitemap')); - $this->normal_user = $this->drupalCreateUser(array('access content')); - } - - /** - * Menu Settings. - */ - public function testMenuSettings() { - $this->drupalLogin($this->admin_user); - - $edit = array( - 'title' => $this->randomName(), - 'menu_name' => drupal_strtolower($this->randomName()), - 'xmlsitemap[status]' => '1', - 'xmlsitemap[priority]' => '1.0', - ); - $this->drupalPost('admin/structure/menu/add', $edit, 'Save'); - - $this->clickLink('Add link'); - $edit = array( - 'link_title' => $this->randomName(), - 'link_path' => 'node', - 'xmlsitemap[status]' => 'default', - 'xmlsitemap[priority]' => 'default', - ); - $this->drupalPost(NULL, $edit, 'Save'); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info deleted file mode 100644 index de615c9edb..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info +++ /dev/null @@ -1,13 +0,0 @@ -name = XML sitemap modal UI -description = "Provides an AJAX modal UI for common XML sitemap tasks." -package = XML sitemap -core = 7.x -dependencies[] = xmlsitemap -dependencies[] = ctools -hidden = TRUE - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module deleted file mode 100644 index 02259dc372..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module +++ /dev/null @@ -1,86 +0,0 @@ - $item) { - if (!empty($item['modal']) && strpos($path, '%ctools_js') === FALSE && $item['page callback'] === 'drupal_get_form') { - $items["$path/%ctools_js"] = $item; - $items["$path/%ctools_js"]['page callback'] = 'xmlsitemap_modal_get_form'; - $items["$path/%ctools_js"]['page arguments'][] = substr_count($path, '/') + 1; - } - } -} - -/** - * Display a Drupal form using CTools modal or normal page display. - */ -function xmlsitemap_modal_get_form() { - $args = func_get_args(); - $form_id = array_shift($args); - $ajax = array_pop($args); - - if ($ajax) { - ctools_include('ajax'); - ctools_include('modal'); - - $form_state = array( - 'ajax' => TRUE, - 'build_info' => array('args' => $args), - ); - $commands = ctools_modal_form_wrapper($form_id, $form_state); - - if (empty($commands)) { - $commands[] = ctools_modal_command_loading(); - if (!empty($_GET['destination'])) { - $commands[] = ctools_ajax_command_redirect($_GET['destination']); - } - } - print ajax_render($commands); - exit; - } - else { - array_unshift($args, $form_id); - return call_user_func_array('drupal_get_form', $args); - } -} - -/** - * Implements hook_xmlsitemap_operation_link_alter(). - */ -function xmlsitemap_modal_xmlsitemap_operation_link_alter(array &$link) { - static $ctools_modal_included; - - // Process modal frame links. - if (!empty($link['modal'])) { - unset($link['modal']); - - if (!isset($ctools_modal_included)) { - // Only process a few includes once per request. - ctools_include('ajax'); - ctools_include('modal'); - ctools_modal_add_js(); - drupal_add_css(drupal_get_path('module', 'xmlsitemap_modal') . '/xmlsitemap_modal.css'); - } - - $link['attributes']['class'][] = 'ctools-use-modal'; - - if (strpos($link['href'], 'nojs') === FALSE) { - $link['href'] .= '/nojs'; - } - else { - $link['href'] = trim($link['href'], '/'); - } - - // @todo Remove when https://www.drupal.org/node/565808 is fixed. - if (substr($link['href'], -4) === 'nojs') { - $link['href'] .= '/'; - } - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/README.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/README.txt deleted file mode 100644 index a5bb9a14ce..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/README.txt +++ /dev/null @@ -1,81 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Recommended modules -* Installation -* Configuration -* Maintainers - - -INTRODUCTION ------------- - -The XML sitemap node module, part of the XML sitemap -(https://www.drupal.org/project/xmlsitemap) package, enables content nodes to -be in the sitemap. The XML sitemap module creates a sitemap that conforms to -the sitemaps.org specification. This helps search engines to more intelligently -crawl a website and keep their results up to date. - -* For a full description of the module visit: - https://www.drupal.org/project/xmlsitemap - -* To submit bug reports and feature suggestions, or to track changes visit: - https://www.drupal.org/project/issues/xmlsitemap - - -REQUIREMENTS ------------- - -This module requires the following modules: - -* XML sitemap - (https://www.drupal.org/project/xmlsitemap) - - -RECOMMENDED MODULES -------------------- - -* Ctools - (https://www.drupal.org/project/ctools) -* RobotsTxt - (https://www.drupal.org/project/robotstxt) -* Site Verification - (https://www.drupal.org/project/site_verify) -* Browscap - (https://www.drupal.org/project/browscap) -* Vertical Tabs - (https://www.drupal.org/project/vertical_tabs) - - -INSTALLATION ------------- - -* This is a submodule of the XML sitemap module. Install the XML sitemap module -as you would normally install a contributed Drupal module. Visit -https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- - -1. Install the XML sitemap module. -2. Enable the XML sitemap module. -3. To include nodes in the sitemap, enable the XML sitemap node submodule. -4. To add nodes to the sitemap, visit the Edit page of the Content Type which - you want to appear on the sitemap. -5. Select the XML sitemap horizontal tab. -6. Under "Inclusion" change "Excluded" to become "Included". Save. -7. If enabled, all content of the specific node type will be included. - Individual nodes can be excluded on their specific node edit page. -8. Once that is all complete, go to Configurations --> Search and Metadata --> - XML sitemap. -9. Select the Rebuild Links tab in the upper right. -10. Select on "Rebuild sitemap" even if the message says that you do not need - to. -11. Now you're taken back to the config page which shows you the link to your - XML sitemap which you can select and confirm that pages have been added. - - -MAINTAINERS ------------ - -* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu -* Dave Reid - https://www.drupal.org/u/dave-reid -* Juampy NR (juampynr) - https://www.drupal.org/u/juampynr -* Tasya Rukmana (tadityar) - https://www.drupal.org/u/tadityar diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info deleted file mode 100644 index 7963361238..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info +++ /dev/null @@ -1,12 +0,0 @@ -name = XML sitemap node -description = Adds content links to the sitemap. -package = XML sitemap -core = 7.x -dependencies[] = xmlsitemap -files[] = xmlsitemap_node.test - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install deleted file mode 100644 index c7eaa5b50b..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install +++ /dev/null @@ -1,44 +0,0 @@ - variable_get('xmlsitemap_node_status_' . $node_type, XMLSITEMAP_STATUS_DEFAULT), - 'priority' => variable_get('xmlsitemap_node_priority_' . $node_type, XMLSITEMAP_PRIORITY_DEFAULT), - ); - variable_set('xmlsitemap_settings_node_' . $node_type, $settings); - variable_del('xmlsitemap_node_status_' . $node_type); - variable_del('xmlsitemap_node_priority_' . $node_type); - variable_del('xmlsitemap_node_update_' . $node_type); - } - return array(); -} - -/** - * Empty update. - */ -function xmlsitemap_node_update_6201() { -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module deleted file mode 100644 index c287f26b6d..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module +++ /dev/null @@ -1,392 +0,0 @@ - 'xmlsitemap_node_xmlsitemap_process_node_links', - ); -} - -/** - * Implements hook_cron(). - * - * Process old nodes not found in the {xmlsitemap} table. - */ -function xmlsitemap_node_cron() { - $limit = xmlsitemap_var('batch_limit'); - - // Process nodes that have been queued in hook_node_update(). - $queue = DrupalQueue::get('xmlsitemap_node'); - while ($limit > 0 && $item = $queue->claimItem()) { - $limit--; - try { - $node = node_load($item->data); - // The node could have been deleted in the meantime, skip XML sitemap - // updates in this case. - if ($node) { - $link = xmlsitemap_node_create_link($node); - xmlsitemap_link_save($link, array($link['type'] => $node)); - } - $queue->deleteItem($item); - } - catch (Exception $e) { - // In case of exception log it and leave the item in the queue - // to be processed again later. - watchdog_exception('xmlsitemap_node', $e); - } - } - - // Add nodes that are missing from the {xmlsitemap} table. - // This catches nodes that were created prior to this module being enabled. - xmlsitemap_node_xmlsitemap_index_links($limit); -} - -/** - * Implements hook_xmlsitemap_index_links(). - */ -function xmlsitemap_node_xmlsitemap_index_links($limit) { - if ($types = xmlsitemap_get_link_type_enabled_bundles('node')) { - $nids = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {xmlsitemap} x ON x.type = 'node' AND n.nid = x.id WHERE x.id IS NULL AND n.type IN (:types) ORDER BY n.nid DESC", 0, $limit, array(':types' => $types))->fetchCol(); - xmlsitemap_node_xmlsitemap_process_node_links($nids); - } -} - -/** - * Process node sitemap links. - * - * @param array $nids - * An array of node IDs. - */ -function xmlsitemap_node_xmlsitemap_process_node_links(array $nids) { - // Load no more than 15 nodes at a time. - if (count($nids) >= 1) { - $nids_chunks = array_chunk($nids, 15); - foreach ($nids_chunks as $chunk) { - $nodes = node_load_multiple($chunk); - foreach ($nodes as $node) { - $link = xmlsitemap_node_create_link($node); - xmlsitemap_link_save($link, array($link['type'] => $node)); - } - // Flush each entity from the load cache after processing, to avoid - // exceeding PHP memory limits if $nids is large. - entity_get_controller('node')->resetCache($chunk); - } - } -} - -/** - * Implements hook_node_insert(). - */ -function xmlsitemap_node_node_insert(stdClass $node) { - xmlsitemap_node_node_update($node); -} - -/** - * Implements hook_node_update(). - */ -function xmlsitemap_node_node_update(stdClass $node) { - // Save a sitemap link with revoked access until the node permissions are - // checked in the cron. - $link = xmlsitemap_node_create_link($node); - xmlsitemap_link_presave($link, array($link['type'] => $node)); - // Node access can not be accurately determined in hook_node_update() because - // node grants have not yet been written to the table, so we defer checking - // node access permissions and process the sitemap link during cron. - $queue = DrupalQueue::get('xmlsitemap_node'); - $queue->createItem($node->nid); -} - -/** - * Implements hook_node_delete(). - */ -function xmlsitemap_node_node_delete(stdClass $node) { - xmlsitemap_link_delete('node', $node->nid); -} - -/** - * Implements hook_comment_update(). - */ -function xmlsitemap_node_comment_update(stdClass $comment) { - if ($node = entity_load_unchanged('node', $comment->nid)) { - xmlsitemap_node_node_update($node); - } -} - -/** - * Implements hook_comment_publish(). - */ -function xmlsitemap_node_comment_publish(stdClass $comment) { - xmlsitemap_node_comment_update($comment); -} - -/** - * Implements hook_comment_unpublish(). - */ -function xmlsitemap_node_comment_unpublish(stdClass $comment) { - xmlsitemap_node_comment_update($comment); -} - -/** - * Implements hook_comment_delete(). - */ -function xmlsitemap_node_comment_delete(stdClass $comment) { - xmlsitemap_node_comment_update($comment); -} - -/** - * Implements hook_field_extra_fields(). - */ -function xmlsitemap_node_field_extra_fields() { - $extras = array(); - foreach (node_type_get_names() as $type => $name) { - $extras['node'][$type]['form']['xmlsitemap'] = array( - 'label' => t('XML sitemap'), - 'description' => t('XML sitemap module element'), - 'weight' => 30, - ); - } - return $extras; -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * @see node_type_form() - * @see xmlsitemap_add_link_bundle_settings() - */ -function xmlsitemap_node_form_node_type_form_alter(array &$form, array $form_state) { - $node_type = isset($form['#node_type']->type) ? $form['#node_type']->type : ''; - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_link_bundle_settings($form, $form_state, 'node', $node_type); -} - -/** - * Implements hook_form_alter(). - * - * @codingStandardsIgnoreLine - * - * Add the XML sitemap individual link options for a node. - * - * @see xmlsitemap_add_form_link_options() - */ -function xmlsitemap_node_form_node_form_alter(array &$form, array &$form_state) { - // Add the link options. - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_form_link_options($form, 'node', $form['type']['#value'], $form['nid']['#value']); - $form['xmlsitemap']['#weight'] = 30; -} - -/** - * Fetch all the timestamps for when a node was changed. - * - * @param object $node - * A node object. - * - * @return array - * An array of UNIX timestamp integers. - */ -function xmlsitemap_node_get_timestamps(stdClass $node) { - $timestamps = &drupal_static(__FUNCTION__, array()); - - if (!isset($timestamps[$node->nid])) { - $timestamps[$node->nid] = db_query("SELECT nr.timestamp FROM {node_revision} nr WHERE nr.nid = :nid", array(':nid' => $node->nid))->fetchCol(); - if (module_exists('comment')) { - $comment_timestamps = db_query("SELECT c.created FROM {comment} c WHERE c.nid = :nid AND c.status = :status", array(':nid' => $node->nid, ':status' => COMMENT_PUBLISHED))->fetchCol(); - $timestamps[$node->nid] = array_merge($timestamps[$node->nid], $comment_timestamps); - } - } - - return $timestamps[$node->nid]; -} - -/** - * Create a sitemap link from a node. - * - * The link will be saved as $node->xmlsitemap. - * - * @param object $node - * A node object. - */ -function xmlsitemap_node_create_link(stdClass $node) { - if (!isset($node->xmlsitemap) || !is_array($node->xmlsitemap)) { - $node->xmlsitemap = array(); - if ($node->nid && $link = xmlsitemap_link_load('node', $node->nid)) { - $node->xmlsitemap = $link; - } - } - - $settings = xmlsitemap_link_bundle_load('node', $node->type); - $uri = entity_uri('node', $node); - - $node->xmlsitemap += array( - 'type' => 'node', - 'id' => $node->nid, - 'subtype' => $node->type, - 'status' => $settings['status'], - 'status_default' => $settings['status'], - 'status_override' => 0, - 'priority' => $settings['priority'], - 'priority_default' => $settings['priority'], - 'priority_override' => 0, - ); - - // Always recalculate changefreq and changecount. - $timestamps = xmlsitemap_node_get_timestamps($node); - $node->xmlsitemap['changefreq'] = $node->nid ? xmlsitemap_calculate_changefreq($timestamps) : 0; - $node->xmlsitemap['changecount'] = $node->nid ? count($timestamps) - 1 : 0; - - // The following values must always be checked because they are volatile. - $node->xmlsitemap['loc'] = $uri['path']; - $node->xmlsitemap['lastmod'] = count($timestamps) ? max($timestamps) : 0; - $node->xmlsitemap['access'] = $node->nid ? xmlsitemap_node_view_access($node, drupal_anonymous_user()) : 1; - $node->xmlsitemap['language'] = isset($node->language) ? $node->language : LANGUAGE_NONE; - - return $node->xmlsitemap; -} - -/** - * Determine whether a user may view the specified node. - * - * @param object $node - * The node object on which the operation is to be performed, or node type - * (e.g. 'forum') for "create" operation. - * @param object $account - * Optional, a user object representing the user for whom the operation is to - * be performed. Determines access for a user other than the current user. - * - * @return bool - * TRUE if the operation may be performed, FALSE otherwise. - * - * This is for all intesive purposes a copy of Drupal 7's node_access() - * function. - */ -function xmlsitemap_node_view_access($node, $account = NULL) { - global $user; - - $op = 'view'; - $rights = &drupal_static(__FUNCTION__, array()); - - if (!$node || !in_array($op, array('view', 'update', 'delete', 'create'), TRUE)) { - // If there was no node to check against, or the $op was not one of the - // supported ones, we return access denied. - return FALSE; - } - // If no user object is supplied, the access check is for the current user. - if (empty($account)) { - $account = $user; - } - - // $node may be either an object or a node type. Since node types cannot be - // an integer, use either nid or type as the static cache id. - // $cid = is_object($node) ? $node->nid : $node; - // If we've already checked access for this node, user and op, return from - // cache. - if (isset($rights[$account->uid][$node->nid])) { - return $rights[$account->uid][$node->nid]; - } - - if (user_access('bypass node access', $account)) { - $rights[$account->uid][$node->nid] = TRUE; - return TRUE; - } - - if (!user_access('access content', $account)) { - $rights[$account->uid][$node->nid] = FALSE; - return FALSE; - } - - // We grant access to the node if both of the following conditions are met: - // - No modules say to deny access. - // - At least one module says to grant access. - // If no module specified either allow or deny, we fall back to the - // node_access table. - $access = module_invoke_all('node_access', $node, $op, $account); - if (in_array(NODE_ACCESS_DENY, $access, TRUE)) { - $rights[$account->uid][$node->nid] = FALSE; - return FALSE; - } - elseif (in_array(NODE_ACCESS_ALLOW, $access, TRUE)) { - $rights[$account->uid][$node->nid] = TRUE; - return TRUE; - } - - // Check if authors can view their own unpublished nodes. - if ($op == 'view' && !$node->status && user_access('view own unpublished content', $account) && $account->uid == $node->uid && $account->uid != 0) { - $rights[$account->uid][$node->nid] = TRUE; - return TRUE; - } - - // If the module did not override the access rights, use those set in the - // node_access table. - if ($op != 'create' && $node->nid) { - if (module_implements('node_grants')) { - $query = db_select('node_access'); - $query->addExpression('1'); - $query->condition('grant_' . $op, 1, '>='); - $nids = db_or()->condition('nid', $node->nid); - if ($node->status) { - $nids->condition('nid', 0); - } - $query->condition($nids); - $query->range(0, 1); - - // Fetch the node grants and allow other modules to alter them - // (D7 backport). - $grants = &drupal_static(__FUNCTION__ . ':grants', array()); - if (!isset($grants[$account->uid][$op])) { - // Indicate that this is our special function in the grants. - $account->xmlsitemap_node_access = TRUE; - $grants[$account->uid][$op] = node_access_grants($op, $account); - // Remove the special indicator. - unset($account->xmlsitemap_node_access); - } - - $grant_condition = db_or(); - foreach ($grants[$account->uid][$op] as $realm => $gids) { - foreach ($gids as $gid) { - $grant_condition->condition(db_and() - ->condition('gid', $gid) - ->condition('realm', $realm) - ); - } - } - if (count($grant_condition) > 0) { - $query->condition($grant_condition); - } - - $result = (bool) $query->execute()->fetchField(); - $rights[$account->uid][$node->nid] = $result; - return $result; - } - elseif (is_object($node) && $op == 'view' && $node->status) { - // If no modules implement hook_node_grants(), the default behaviour is to - // allow all users to view published nodes, so reflect that here. - $rights[$account->uid][$node->nid] = TRUE; - return TRUE; - } - } - - return FALSE; -} - -/** - * Implements hook_features_pipe_COMPONENT_alter(). - * - * Add variables to exported node types. - */ -function xmlsitemap_node_features_pipe_node_alter(&$pipe, $data, $export) { - if (!empty($data)) { - foreach ($data as $node_type) { - $pipe['variable'][] = "xmlsitemap_settings_node_{$node_type}"; - } - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.test deleted file mode 100644 index b74365f6f4..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_node/xmlsitemap_node.test +++ /dev/null @@ -1,228 +0,0 @@ - 'XML sitemap node', - 'description' => 'Functional tests for the XML sitemap node module.', - 'group' => 'XML sitemap', - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'xmlsitemap_node'; - $modules[] = 'comment'; - parent::setUp($modules); - - $this->admin_user = $this->drupalCreateUser(array( - 'administer nodes', - 'bypass node access', - 'administer content types', - 'administer xmlsitemap', - )); - $this->normal_user = $this->drupalCreateUser(array( - 'create page content', - 'edit any page content', - 'access content', - 'view own unpublished content', - )); - xmlsitemap_link_bundle_settings_save('node', 'page', array('status' => 1, 'priority' => 0.5)); - } - - /** - * Node Settings. - */ - public function testNodeSettings() { - $body_field = 'body[' . LANGUAGE_NONE . '][0][value]'; - - $node = $this->drupalCreateNode(array('status' => FALSE, 'uid' => $this->normal_user->uid)); - $this->cronRun(); - $this->assertSitemapLinkValues('node', $node->nid, array( - 'access' => 0, - 'status' => 1, - 'priority' => 0.5, - 'status_override' => 0, - 'priority_override' => 0, - )); - - $this->drupalLogin($this->normal_user); - $this->drupalGet('node/' . $node->nid . '/edit'); - $this->assertNoField('xmlsitemap[status]'); - $this->assertNoField('xmlsitemap[priority]'); - - $edit = array( - 'title' => 'Test node title', - $body_field => 'Test node body', - ); - $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); - $this->assertText('Basic page Test node title has been updated.'); - $this->cronRun(); - $this->assertSitemapLinkValues('node', $node->nid, array( - 'access' => 0, - 'status' => 1, - 'priority' => 0.5, - 'status_override' => 0, - 'priority_override' => 0, - )); - - $this->drupalLogin($this->admin_user); - $this->drupalGet('node/' . $node->nid . '/edit'); - $this->assertField('xmlsitemap[status]'); - $this->assertField('xmlsitemap[priority]'); - - $edit = array( - 'xmlsitemap[status]' => 0, - 'xmlsitemap[priority]' => 0.9, - 'status' => TRUE, - ); - $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); - $this->assertText('Basic page Test node title has been updated.'); - $this->cronRun(); - $this->assertSitemapLinkValues('node', $node->nid, array( - 'access' => 1, - 'status' => 0, - 'priority' => 0.9, - 'status_override' => 1, - 'priority_override' => 1, - )); - - $edit = array( - 'xmlsitemap[status]' => 'default', - 'xmlsitemap[priority]' => 'default', - 'status' => FALSE, - ); - $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); - $this->assertText('Basic page Test node title has been updated.'); - $this->cronRun(); - $this->assertSitemapLinkValues('node', $node->nid, array( - 'access' => 0, - 'status' => 1, - 'priority' => 0.5, - 'status_override' => 0, - 'priority_override' => 0, - )); - } - - /** - * Test the content type settings. - */ - public function testTypeSettings() { - $this->drupalLogin($this->admin_user); - - $node_old = $this->drupalCreateNode(); - $this->cronRun(); - $this->assertSitemapLinkValues('node', $node_old->nid, array('status' => 1, 'priority' => 0.5)); - - $edit = array( - 'xmlsitemap[status]' => 0, - 'xmlsitemap[priority]' => '0.0', - ); - $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); - $this->assertText('The content type Basic page has been updated.'); - - $node = $this->drupalCreateNode(); - $this->cronRun(); - $this->assertSitemapLinkValues('node', $node->nid, array('status' => 0, 'priority' => 0.0)); - $this->assertSitemapLinkValues('node', $node_old->nid, array('status' => 0, 'priority' => 0.0)); - - $edit = array( - 'type' => 'page2', - 'xmlsitemap[status]' => 1, - 'xmlsitemap[priority]' => '0.5', - ); - $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); - $this->assertText('Changed the content type of 2 posts from page to page2.'); - $this->assertText('The content type Basic page has been updated.'); - $this->cronRun(); - - $this->assertSitemapLinkValues('node', $node->nid, array( - 'subtype' => 'page2', - 'status' => 1, - 'priority' => 0.5, - )); - $this->assertSitemapLinkValues('node', $node_old->nid, array( - 'subtype' => 'page2', - 'status' => 1, - 'priority' => 0.5, - )); - $this->assertEqual(count(xmlsitemap_link_load_multiple(array('type' => 'node', 'subtype' => 'page'))), 0); - $this->assertEqual(count(xmlsitemap_link_load_multiple(array('type' => 'node', 'subtype' => 'page2'))), 2); - - $this->drupalPost('admin/structure/types/manage/page2/delete', array(), t('Delete')); - $this->assertText('The content type Basic page has been deleted.'); - $this->assertFalse(xmlsitemap_link_load_multiple(array('type' => 'node', 'subtype' => 'page2')), 'Nodes with deleted node type removed from {xmlsitemap}.'); - } - - /** - * Test the import of old nodes via cron. - */ - public function testCron() { - $limit = 5; - variable_set('xmlsitemap_batch_limit', $limit); - - $nodes = array(); - for ($i = 1; $i <= ($limit + 1); $i++) { - $node = $this->drupalCreateNode(); - array_push($nodes, $node); - // Need to delay by one second so the nodes don't all have the same - // timestamp. - sleep(1); - } - - // Clear all the node link data so we can emulate 'old' nodes. - db_delete('xmlsitemap') - ->condition('type', 'node') - ->execute(); - - // Run cron to import old nodes. - xmlsitemap_node_cron(); - - for ($i = 1; $i <= ($limit + 1); $i++) { - $node = array_shift($nodes); - if ($i <= $limit) { - // The first $limit nodes should be inserted. - $this->assertSitemapLinkValues('node', $node->nid, array( - 'access' => 1, - 'status' => 1, - 'lastmod' => $node->changed, - )); - } - else { - // Any beyond $limit should not be in the sitemap. - $this->assertNoSitemapLink(array('type' => 'node', 'id' => $node->nid)); - } - } - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/README.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/README.txt deleted file mode 100644 index f343aa5ce4..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/README.txt +++ /dev/null @@ -1,83 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Recommended modules -* Installation -* Configuration -* Maintainers - - -INTRODUCTION ------------- - -The XML sitemap taxonomy module, part of the XML sitemap -(https://www.drupal.org/project/xmlsitemap) package, adds taxonomy term links -to the sitemap. The XML sitemap module creates a sitemap that conforms to the -sitemaps.org specification. This helps search engines to more intelligently -crawl a website and keep their results up to date. - -* For a full description of the module visit -https://www.drupal.org/documentation/modules/xmlsitemap - -* To submit bug reports and feature suggestions, or to track changes visit -https://www.drupal.org/project/issues/xmlsitemap - - -REQUIREMENTS ------------- - -This module requires the following modules: - -XML sitemap - (https://www.drupal.org/project/xmlsitemap) - - -RECOMMENDED MODULES -------------------- - -* Ctools - (https://www.drupal.org/project/ctools) -* RobotsTxt - (https://www.drupal.org/project/robotstxt) -* Site Verification - (https://www.drupal.org/project/site_verify) -* Browscap - (https://www.drupal.org/project/browscap) -* Vertical Tabs - (https://www.drupal.org/project/vertical_tabs) - - -INSTALLATION ------------- - -This is a submodule of the XML sitemap module. Install the XML sitemap module as -you would normally install a contributed Drupal module. Visit -https://www.drupal.org/node/895232 for more information. - - -CONFIGURATION -------------- - -1. Install the XML sitemap module. -2. Enable the XML sitemap module. -3. To include taxonomy terms in the sitemap, enable the XML sitemap taxonomy - submodule. -4. Navigate to Administration > Structure > Taxonomy. -5. To include a whole vocabulary in the sitemap, click "edit vocabulary". - Select the XML sitemap field set. Under "Inclusion" change "Excluded" to - become "Included". Save. -6. To include a single vocabulary term in the sitemap, select edit vocabulary. - Select the vocabulary term to be included. Select the XML sitemap field set. - Under "Inclusion" change "Excluded" to become "Included". Save. -7. Once that is all complete, go to Configurations > Search and Metadata > XML - Sitemap. -8. Select the Rebuild Links tab in the upper right. -9. Select "Rebuild sitemap" even if the message says that you do not need to. -10. Now you're taken back to the configuration page which shows you the link to - your XML sitemap which you can click and confirm that pages have been added. - - -MAINTAINERS ------------ - -* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu -* Renato Gonçalves (RenatoG) - https://www.drupal.org/u/RenatoG -* Dave Reid - https://www.drupal.org/u/dave-reid -* Juampy NR (juampynr) - https://www.drupal.org/u/juampynr -* Tasya Rukmana (tadityar) - https://www.drupal.org/u/tadityar diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info deleted file mode 100644 index a3a52450a0..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info +++ /dev/null @@ -1,13 +0,0 @@ -name = XML sitemap taxonomy -description = Add taxonomy term links to the sitemap. -package = XML sitemap -core = 7.x -dependencies[] = xmlsitemap -dependencies[] = taxonomy -files[] = xmlsitemap_taxonomy.test - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install deleted file mode 100644 index 5c6ef5c21b..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install +++ /dev/null @@ -1,66 +0,0 @@ - $vocabulary) { - xmlsitemap_link_bundle_delete('taxonomy_term', $vocabulary->machine_name); - } -} - -/** - * Implements hook_update_last_removed(). - */ -function xmlsitemap_taxonomy_update_last_removed() { - return 6198; -} - -/** - * Cleanup variables. - */ -function xmlsitemap_taxonomy_update_6200() { - drupal_load('module', 'taxonomy'); - drupal_load('module', 'xmlsitemap'); - $vids = array_keys(taxonomy_get_vocabularies()); - foreach ($vids as $vid) { - $settings = array( - 'status' => variable_get('xmlsitemap_taxonomy_status_' . $vid, XMLSITEMAP_STATUS_DEFAULT), - 'priority' => variable_get('xmlsitemap_taxonomy_priority_' . $vid, XMLSITEMAP_PRIORITY_DEFAULT), - ); - variable_set('xmlsitemap_settings_taxonomy_term_' . $vid, $settings); - variable_del('xmlsitemap_taxonomy_status_' . $vid); - variable_del('xmlsitemap_taxonomy_priority_' . $vid); - variable_del('xmlsitemap_taxonomy_calculate_priority_' . $vid); - variable_del('xmlsitemap_taxonomy_include_empty_terms_' . $vid); - } - variable_del('xmlsitemap_taxonomy_include_empty_terms'); - variable_del('xmlsitemap_taxonomy_calculate_priority'); -} - -/** - * Empty update. - */ -function xmlsitemap_taxonomy_update_6201() { -} - -/** - * Change bundles on taxonomy terms from vid to $vocabulary->machine_name. - */ -function xmlsitemap_taxonomy_update_7200() { - drupal_load('module', 'taxonomy'); - drupal_load('module', 'xmlsitemap'); - - $vocabularies = taxonomy_get_vocabularies(); - foreach ($vocabularies as $vid => $vocabulary) { - xmlsitemap_link_bundle_rename('taxonomy_term', $vid, $vocabulary->machine_name); - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module deleted file mode 100644 index d97f9c3413..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module +++ /dev/null @@ -1,296 +0,0 @@ - 'xmlsitemap_taxonomy_xmlsitemap_process_taxonomy_term_links', - ); -} - -/** - * Implements hook_xmlsitemap_link_info_alter(). - */ -function xmlsitemap_taxonomy_xmlsitemap_link_info_alter(&$link_info) { - foreach (taxonomy_vocabulary_get_names() as $machine_name => $vocabulary) { - // Adjust the edit path to the *real* edit path. - $link_info['taxonomy_term']['bundles'][$machine_name]['admin']['path'] .= '/edit'; - $link_info['taxonomy_term']['bundles'][$machine_name]['admin']['real path'] .= '/edit'; - } -} - -/** - * Implements hook_cron(). - * - * Process old taxonomy terms not found in the {xmlsitemap} table. - */ -function xmlsitemap_taxonomy_cron() { - xmlsitemap_taxonomy_xmlsitemap_index_links(xmlsitemap_var('batch_limit')); -} - -/** - * Implements hook_xmlsitemap_index_links(). - */ -function xmlsitemap_taxonomy_xmlsitemap_index_links($limit) { - if ($bundles = xmlsitemap_get_link_type_enabled_bundles('taxonomy_term')) { - $tids = db_query_range("SELECT t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_vocabulary} tv USING (vid) LEFT JOIN {xmlsitemap} x ON x.type = 'taxonomy_term' AND t.tid = x.id WHERE x.id IS NULL AND tv.machine_name IN (:bundles) ORDER BY t.tid DESC", 0, $limit, array(':bundles' => $bundles))->fetchCol(); - xmlsitemap_taxonomy_xmlsitemap_process_taxonomy_term_links($tids); - } -} - -/** - * Process taxonomy term sitemap links. - * - * @param array $tids - * An array of taxonomy term IDs. - */ -function xmlsitemap_taxonomy_xmlsitemap_process_taxonomy_term_links(array $tids) { - $terms = taxonomy_term_load_multiple($tids); - foreach ($terms as $term) { - $link = xmlsitemap_taxonomy_create_link($term); - xmlsitemap_link_save($link, array($link['type'] => $term)); - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * @see taxonomy_form_vocabulary() - * @see xmlsitemap_add_link_bundle_settings() - */ -function xmlsitemap_taxonomy_form_taxonomy_form_vocabulary_alter(&$form, $form_state) { - if (in_array('taxonomy_vocabulary_confirm_delete_submit', $form['#submit'])) { - // If this is the delete form, do not add our form elements. - return; - } - - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_link_bundle_settings($form, $form_state, 'taxonomy_term', $form['#vocabulary']->machine_name); -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function xmlsitemap_taxonomy_form_taxonomy_form_term_alter(&$form, $form_state) { - if ($form['name']['#type'] == 'value') { - // If this is the delete form, do not add our form elements. - return; - } - - // Add the link options. - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_form_link_options($form, 'taxonomy_term', $form['#term']['vocabulary_machine_name'], $form['tid']['#value']); -} - -/** - * Implements hook_taxonomy_vocabulary_insert(). - */ -function xmlsitemap_taxonomy_vocabulary_insert(stdClass $vocabulary) { - if (isset($vocabulary->xmlsitemap)) { - xmlsitemap_link_bundle_settings_save('taxonomy_term', $vocabulary->machine_name, $vocabulary->xmlsitemap); - } -} - -/** - * Implements hook_taxonomy_vocabulary_update(). - */ -function xmlsitemap_taxonomy_vocabulary_update(stdClass $vocabulary) { - if (isset($vocabulary->xmlsitemap)) { - xmlsitemap_link_bundle_settings_save('taxonomy_term', $vocabulary->machine_name, $vocabulary->xmlsitemap); - } -} - -/** - * Implements hook_taxonomy_term_insert(). - */ -function xmlsitemap_taxonomy_term_insert(stdClass $term) { - $link = xmlsitemap_taxonomy_create_link($term); - xmlsitemap_link_save($link, array($link['type'] => $term)); -} - -/** - * Implements hook_taxonomy_term_update(). - */ -function xmlsitemap_taxonomy_term_update(stdClass $term) { - $link = xmlsitemap_taxonomy_create_link($term); - xmlsitemap_link_save($link, array($link['type'] => $term)); -} - -/** - * Implements hook_taxonomy_term_delete(). - */ -function xmlsitemap_taxonomy_term_delete(stdClass $term) { - xmlsitemap_link_delete('taxonomy_term', $term->tid); -} - -/** - * Implements hook_field_extra_fields(). - */ -function xmlsitemap_taxonomy_field_extra_fields() { - $extras = array(); - foreach (taxonomy_vocabulary_get_names() as $machine_name => $vocabulary) { - $extras['taxonomy_term'][$machine_name]['form']['xmlsitemap'] = array( - 'label' => t('XML sitemap'), - 'description' => t('XML sitemap module element'), - 'weight' => 30, - ); - } - return $extras; -} - -/** - * Create a sitemap link from a taxonomy term. - * - * @param object $term - * A taxonomy term object. - * - * @return array - * An array representing a sitemap link. - */ -function xmlsitemap_taxonomy_create_link(stdClass &$term) { - if (!isset($term->xmlsitemap)) { - $term->xmlsitemap = array(); - if ($term->tid && $link = xmlsitemap_link_load('taxonomy_term', $term->tid)) { - $term->xmlsitemap = $link; - } - } - - $settings = xmlsitemap_link_bundle_load('taxonomy_term', $term->vocabulary_machine_name); - $uri = entity_uri('taxonomy_term', $term); - - $term->xmlsitemap += array( - 'id' => $term->tid, - 'type' => 'taxonomy_term', - 'subtype' => $term->vocabulary_machine_name, - 'status' => $settings['status'], - 'status_default' => $settings['status'], - 'status_override' => 0, - 'priority' => $settings['priority'], - 'priority_default' => $settings['priority'], - 'priority_override' => 0, - ); - - // The following values must always be checked because they are volatile. - // @todo How can/should we check taxonomy term access? - $term->xmlsitemap['loc'] = $uri['path']; - $term->xmlsitemap['access'] = 1; - $term->xmlsitemap['language'] = isset($term->language) ? $term->language : LANGUAGE_NONE; - - return $term->xmlsitemap; -} - -/** - * Calculate the priority of a taxonomy term based on depth and weight. - * - * Function xmlsitemap_taxonomy_calculate_term_priority(stdClass $term) { - * // Calculate priority. - * // Min weight = -128 - * // Max weight = 127 - * // Max depth = ? - * } - */ - -/** - * Find the tree depth of a taxonomy term. - * - * @param object $term - * A taxonomy term object. - * - * @return array - * The tree depth of the term. - */ -function xmlsitemap_taxonomy_get_term_depth(stdClass $term) { - static $depths = array(); - - if (!isset($depths[$term->tid])) { - if ($parent = db_query("SELECT parent FROM {taxonomy_term_hierarchy} WHERE tid = %d", $term->tid)->fetchField()) { - // If the term has a parent, the term's depth is the parent's depth + 1. - if (!isset($depths[$parent])) { - $depths[$parent] = xmlsitemap_taxonomy_get_term_depth($parent); - } - $depths[$term->tid] = $depths[$parent] + 1; - } - else { - // Term has no parents, so depth is 0. - $depths[$term->tid] = 0; - } - } - - return $depths[$term->tid]; -} - -/** - * Find the number of nodes that are associated with a taxonomy term. - * - * @param obejct $term - * A taxonomy term object. - * - * @return int - * The number of nodes associated with the term. - * - * @codingStandardsIgnoreStart - */ -function xmlsitemap_taxonomy_get_node_count(stdClass $term) { - // @codingStandardsIgnoreEnd - // @todo Use db_rewrite_sql() w/ switch user. - return db_query_range("SELECT COUNT(ti.nid) FROM {taxonomy_index} ti LEFT JOIN {node n} USING (nid) WHERE ti.tid = :tid AND n.status = 1", 0, 1, array(':tid' => $term->tid))->fetchField(); -} - -/** - * Implements hook_entity_query_alter(). - * - * @todo Remove when https://www.drupal.org/node/1054162 is fixed. - */ -function xmlsitemap_taxonomy_entity_query_alter($query) { - $conditions = &$query->entityConditions; - - // Alter taxonomy term queries only. - if (isset($conditions['entity_type']) && $conditions['entity_type']['value'] == 'taxonomy_term' && isset($conditions['bundle'])) { - - // We can only support the operators that are explicit in values. - if (in_array($conditions['bundle']['operator'], array( - NULL, - '=', - '!=', - 'IN', - 'NOT IN', - ))) { - $vids = array(); - - // Convert vocabulary machine names to vocabulary IDs. - if (is_array($conditions['bundle']['value'])) { - foreach ($conditions['bundle']['value'] as $vocabulary_machine_name) { - $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary_machine_name); - $vids[] = $vocabulary->vid; - } - } - else { - $vocabulary = taxonomy_vocabulary_machine_name_load($conditions['bundle']['value']); - $vids = $vocabulary->vid; - } - - $query->propertyCondition('vid', $vids, $conditions['bundle']['operator']); - unset($conditions['bundle']); - } - } -} - -/** - * Implements hook_features_pipe_COMPONENT_alter(). - * - * Add variables to exported taxonomy vocabularies. - */ -function xmlsitemap_taxonomy_features_pipe_taxonomy_alter(&$pipe, $data, $export) { - if (!empty($data)) { - foreach ($data as $vocabulary_name) { - $pipe['variable'][] = "xmlsitemap_settings_taxonomy_term_{$vocabulary_name}"; - } - } -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.test deleted file mode 100644 index c84ccca332..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.test +++ /dev/null @@ -1,78 +0,0 @@ - 'XML sitemap taxonomy', - 'description' => 'Functional tests for the XML sitemap taxonomy module.', - 'group' => 'XML sitemap', - ); - } - - /** - * SetUp. - */ - public function setUp($modules = array()) { - $modules[] = 'xmlsitemap_taxonomy'; - $modules[] = 'taxonomy'; - parent::setUp($modules); - - $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'administer xmlsitemap')); - $this->normal_user = $this->drupalCreateUser(array('access content')); - } - - /** - * TaxonomySettings. - */ - public function testTaxonomySettings() { - $this->drupalLogin($this->admin_user); - - $edit = array( - 'name' => $this->randomName(), - 'machine_name' => drupal_strtolower($this->randomName()), - 'xmlsitemap[status]' => '1', - 'xmlsitemap[priority]' => '1.0', - ); - $this->drupalPost('admin/structure/taxonomy/add', $edit, 'Save'); - $this->assertText("Created new vocabulary {$edit['name']}."); - $vocabulary = taxonomy_vocabulary_machine_name_load($edit['machine_name']); - - $edit = array( - 'name' => $this->randomName(), - 'xmlsitemap[status]' => 'default', - 'xmlsitemap[priority]' => 'default', - ); - $this->drupalPost("admin/structure/taxonomy/{$vocabulary->machine_name}/add", $edit, 'Save'); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/README.txt b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/README.txt deleted file mode 100644 index 6ca54ee37e..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/README.txt +++ /dev/null @@ -1,82 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Recommended modules -* Installation -* Configuration -* Maintainers - - -INTRODUCTION ------------- - -The XML sitemap user module, part of the XML sitemap -(https://www.drupal.org/project/xmlsitemap) package, adds user profiles to the -site map. The XML sitemap module creates a sitemap that conforms to the -sitemaps.org specification. This helps search engines to more intelligently -crawl a website and keep their results up to date. - -* For a full description of the module visit - https://www.drupal.org/documentation/modules/xmlsitemap - -* To submit bug reports and feature suggestions, or to track changes visit - https://www.drupal.org/project/issues/xmlsitemap - -REQUIREMENTS ------------- - -This module requires the following module: - -* XML sitemap - https://www.drupal.org/project/xmlsitemap - - -RECOMMENDED MODULES -------------------- - -* Ctools - https://www.drupal.org/project/ctools -* RobotsTxt - https://www.drupal.org/project/robotstxt -* Site Verification - https://www.drupal.org/project/site_verify -* Browscap - https://www.drupal.org/project/browscap -* Vertical Tabs - https://www.drupal.org/project/vertical_tabs - - -INSTALLATION ------------- - -This is a submodule of the XML sitemap module. Install the XML sitemap module as -you would normally install a contributed Drupal module. Visit -https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- -1. Install the XML sitemap module. -2. Enable the XML sitemap module. -3. To include users in the sitemap, enable the XML sitemap user submodule. -4. To add individuals user to the site map navigate to Administration > People - and select edit on the user to be included in the sitemap. -5. Select the XML sitemap fieldset. -6. Under "Inclusion" change "Excluded" to become "Included". Save. -7. Once that is complete, navigate to Configurations > Search and Metadata > XML - Sitemap. -8. Select the Rebuild Links tab in the upper right. -9. Select "Rebuild sitemap" even if the message says that you do not need to. -10. Now you're taken back to the config page which shows you the link to your - XML sitemap which you can select and confirm that pages have been added. - - -TROUBLESHOOTING ---------------- - -In order to list user profiles in the site map, the anonymous user must have the -View user profiles permission. - - -MAINTAINERS ------------ -* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu -* Dave Reid - https://www.drupal.org/u/dave-reid -* Juampy NR (juampynr) - https://www.drupal.org/u/juampynr -* Tasya Rukmana (tadityar) - https://www.drupal.org/u/tadityar diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info deleted file mode 100644 index 95a08b8172..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info +++ /dev/null @@ -1,12 +0,0 @@ -name = XML sitemap user -description = Adds user profile links to the sitemap. -package = XML sitemap -dependencies[] = xmlsitemap -core = 7.x -files[] = xmlsitemap_user.test - -; Information added by Drupal.org packaging script on 2018-10-09 -version = "7.x-2.6" -core = "7.x" -project = "xmlsitemap" -datestamp = "1539120486" diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.install b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.install deleted file mode 100644 index f66fec0182..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.install +++ /dev/null @@ -1,43 +0,0 @@ - $t('XML sitemap user'), - 'value' => $t('Anonymous access to user profiles'), - 'description' => $t('In order to list user profile links in the sitemap, the anonymous user must have the View user profiles permission.', array('@perm-link' => url('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID, array('fragment' => 'module-user')))), - 'severity' => REQUIREMENT_ERROR, - ); - } - } - - return $requirements; -} - -/** - * Implements hook_uninstall(). - */ -function xmlsitemap_user_uninstall() { - drupal_load('module', 'user'); - drupal_load('module', 'xmlsitemap'); - xmlsitemap_link_bundle_delete('user', 'user'); -} - -/** - * Implements hook_update_last_removed(). - */ -function xmlsitemap_user_update_last_removed() { - return 6202; -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module deleted file mode 100644 index a68f6ec01b..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module +++ /dev/null @@ -1,168 +0,0 @@ - 'xmlsitemap_user_xmlsitemap_process_user_links', - ); -} - -/** - * Implements hook_cron(). - * - * Process old users not found in the {xmlsitemap} table. - */ -function xmlsitemap_user_cron() { - xmlsitemap_user_xmlsitemap_index_links(xmlsitemap_var('batch_limit')); -} - -/** - * Implements hook_xmlsitemap_index_links(). - */ -function xmlsitemap_user_xmlsitemap_index_links($limit) { - $uids = db_query_range("SELECT u.uid FROM {users} u LEFT JOIN {xmlsitemap} x ON x.type = 'user' AND u.uid = x.id WHERE x.id IS NULL AND u.uid > 0 ORDER BY u.uid DESC", 0, $limit)->fetchCol(); - xmlsitemap_user_xmlsitemap_process_user_links($uids); -} - -/** - * Process user sitemap links. - * - * @param array $uids - * An array of user IDs. - */ -function xmlsitemap_user_xmlsitemap_process_user_links(array $uids) { - $accounts = user_load_multiple($uids); - foreach ($accounts as $account) { - $link = xmlsitemap_user_create_link($account); - xmlsitemap_link_save($link, array($link['type'] => $account)); - } -} - -/** - * Implements hook_user_presave(). - */ -function xmlsitemap_user_user_presave(&$edit, $account, $category) { - if (!empty($account->uid)) { - $link = xmlsitemap_user_create_link($account); - if (isset($edit['xmlsitemap'])) { - $link = $edit['xmlsitemap'] + $link; - unset($edit['xmlsitemap']); - } - xmlsitemap_link_save($link, array($link['type'] => $account)); - } -} - -/** - * Implements hook_user_insert(). - */ -function xmlsitemap_user_user_insert(&$edit, $account, $category) { - $link = xmlsitemap_user_create_link($account); - xmlsitemap_link_save($link, array($link['type'] => $account)); -} - -/** - * Implements hook_user_update(). - */ -function xmlsitemap_user_user_update(&$edit, $account, $category) { - $link = xmlsitemap_user_create_link($account); - xmlsitemap_link_save($link, array($link['type'] => $account)); -} - -/** - * Implements hook_user_delete(). - */ -function xmlsitemap_user_user_delete($account) { - xmlsitemap_link_delete('user', $account->uid); -} - -/** - * Implements hook_field_extra_fields(). - */ -function xmlsitemap_user_field_extra_fields() { - $extras['user']['user']['form']['xmlsitemap'] = array( - 'label' => t('XML sitemap'), - 'description' => t('XML sitemap module element'), - 'weight' => 30, - ); - return $extras; -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * @see user_admin_settings() - * @see xmlsitemap_add_link_bundle_settings() - */ -function xmlsitemap_user_form_user_profile_form_alter(&$form, $form_state) { - // Add the link options. - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_form_link_options($form, 'user', 'user', $form['#user']->uid); -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * @see user_admin_settings() - * @see xmlsitemap_add_link_bundle_settings() - */ -function xmlsitemap_user_form_user_admin_settings_alter(&$form, $form_state) { - module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); - xmlsitemap_add_link_bundle_settings($form, $form_state, 'user', 'user'); - $form['email_title'] += array('#weight' => 10); - $form['email'] += array('#weight' => 10); -} - -/** - * Create a sitemap link from a user. - * - * The link will be saved as $account->xmlsitemap. - * - * @param object $account - * A user object. - */ -function xmlsitemap_user_create_link(stdClass &$account) { - if (!isset($account->xmlsitemap)) { - $account->xmlsitemap = array(); - if ($account->uid && $link = xmlsitemap_link_load('user', $account->uid)) { - $account->xmlsitemap = $link; - } - } - - $settings = xmlsitemap_link_bundle_load('user', 'user'); - $uri = entity_uri('user', $account); - - $account->xmlsitemap += array( - 'type' => 'user', - 'id' => $account->uid, - 'subtype' => 'user', - 'status' => $settings['status'], - 'status_default' => $settings['status'], - 'status_override' => 0, - 'priority' => $settings['priority'], - 'priority_default' => $settings['priority'], - 'priority_override' => 0, - ); - - // The following values must always be checked because they are volatile. - $account->xmlsitemap['loc'] = $uri['path']; - $account->xmlsitemap['access'] = $account->uid && $account->status; - $account->xmlsitemap['language'] = !empty($account->language) ? $account->language : LANGUAGE_NONE; - - return $account->xmlsitemap; -} - -/** - * Implements hook_variables(). - */ -function xmlsitemap_user_variables() { - $defaults = array(); - return $defaults; -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.test b/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.test deleted file mode 100644 index e84bc2b2e1..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xmlsitemap_user/xmlsitemap_user.test +++ /dev/null @@ -1,84 +0,0 @@ - 'XML sitemap user', - 'description' => 'Functional tests for the XML sitemap user module.', - 'group' => 'XML sitemap', - ); - } - - /** - * Setup. - */ - public function setUp($modules = array()) { - $modules[] = 'xmlsitemap_user'; - parent::setUp($modules); - - // Save the user settings before creating the users. - xmlsitemap_link_bundle_settings_save('user', 'user', array('status' => 1, 'priority' => 0.5)); - - // Create the users. - $this->admin_user = $this->drupalCreateUser(array( - 'administer users', - 'administer permissions', - 'administer xmlsitemap', - )); - - $this->normal_user = $this->drupalCreateUser(array('access content')); - - // Update the normal user to make its sitemap link visible. - $account = clone $this->normal_user; - user_save($account, array('access' => 1, 'login' => 1)); - } - - /** - * Blocked User(). - */ - public function testBlockedUser() { - $this->drupalLogin($this->admin_user); - $this->assertSitemapLinkVisible('user', $this->normal_user->uid); - - // Mark the user as blocked. - $edit = array( - 'status' => 0, - ); - - // This will pass when https://www.drupal.org/node/360925 is fixed. - $this->drupalPost('user/' . $this->normal_user->uid . '/edit', $edit, t('Save')); - $this->assertText('The changes have been saved.'); - $this->assertSitemapLinkNotVisible('user', $this->normal_user->uid); - } - -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.js b/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.js deleted file mode 100644 index 282665f972..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.js +++ /dev/null @@ -1,854 +0,0 @@ -/* - * - * TableSorter 2.0 - Client-side table sorting with ease! - * Version 2.0.3 - * @requires jQuery v1.2.3 - * - * Copyright (c) 2007 Christian Bach - * Examples and docs at: http://tablesorter.com - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - */ -/** - * - * @codingStandardsIgnoreFile Ignore because it's code from another project. - * - * @description Create a sortable table with multi-column sorting capabilitys - * - * @example $('table').tablesorter(); - * @desc Create a simple tablesorter interface. - * - * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] }); - * @desc Create a tablesorter interface and sort on the first and secound column in ascending order. - * - * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } }); - * @desc Create a tablesorter interface and disableing the first and secound column headers. - * - * @example $('table').tablesorter({ 0: {sorter:"integer"}, 1: {sorter:"currency"} }); - * @desc Create a tablesorter interface and set a column parser for the first and secound column. - * - * - * @param Object settings An object literal containing key/value pairs to provide optional settings. - * - * @option String cssHeader (optional) A string of the class name to be appended to sortable tr elements in the thead of the table. - * Default value: "header" - * - * @option String cssAsc (optional) A string of the class name to be appended to sortable tr elements in the thead on a ascending sort. - * Default value: "headerSortUp" - * - * @option String cssDesc (optional) A string of the class name to be appended to sortable tr elements in the thead on a descending sort. - * Default value: "headerSortDown" - * - * @option String sortInitialOrder (optional) A string of the inital sorting order can be asc or desc. - * Default value: "asc" - * - * @option String sortMultisortKey (optional) A string of the multi-column sort key. - * Default value: "shiftKey" - * - * @option String textExtraction (optional) A string of the text-extraction method to use. - * For complex html structures inside td cell set this option to "complex", - * on large tables the complex option can be slow. - * Default value: "simple" - * - * @option Object headers (optional) An array containing the forces sorting rules. - * This option let's you specify a default sorting rule. - * Default value: null - * - * @option Array sortList (optional) An array containing the forces sorting rules. - * This option let's you specify a default sorting rule. - * Default value: null - * - * @option Array sortForce (optional) An array containing forced sorting rules. - * This option let's you specify a default sorting rule, which is prepended to user-selected rules. - * Default value: null - * - * @option Array sortAppend (optional) An array containing forced sorting rules. - * This option let's you specify a default sorting rule, which is appended to user-selected rules. - * Default value: null - * - * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter should apply fixed widths to the table columns. - * This is usefull when using the pager companion plugin. - * This options requires the dimension jquery plugin. - * Default value: false - * - * @option Boolean cancelSelection (optional) Boolean flag indicating if tablesorter should cancel selection of the table headers text. - * Default value: true - * - * @option Boolean debug (optional) Boolean flag indicating if tablesorter should display debuging information usefull for development. - * - * @type jQuery - * - * @name tablesorter - * - * @cat Plugins/Tablesorter - * - * @author Christian Bach/christian.bach@polyester.se - */ - -(function($) { - $.extend({ - tablesorter: new function() { - - var parsers = [], widgets = []; - - this.defaults = { - cssHeader: "header", - cssAsc: "headerSortUp", - cssDesc: "headerSortDown", - sortInitialOrder: "asc", - sortMultiSortKey: "shiftKey", - sortForce: null, - sortAppend: null, - textExtraction: "simple", - parsers: {}, - widgets: [], - widgetZebra: {css: ["even","odd"]}, - headers: {}, - widthFixed: false, - cancelSelection: true, - sortList: [], - headerList: [], - dateFormat: "us", - decimal: '.', - debug: false - }; - - /* debuging utils */ - function benchmark(s,d) { - log(s + "," + (new Date().getTime() - d.getTime()) + "ms"); - } - - this.benchmark = benchmark; - - function log(s) { - if (typeof console != "undefined" && typeof console.debug != "undefined") { - console.log(s); - } else { - alert(s); - } - } - - /* parsers utils */ - function buildParserCache(table,$headers) { - - if(table.config.debug) { var parsersDebug = ""; } - - var rows = table.tBodies[0].rows; - - if(table.tBodies[0].rows[0]) { - - var list = [], cells = rows[0].cells, l = cells.length; - - for (var i=0;i < l; i++) { - var p = false; - - if($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter) ) { - - p = getParserById($($headers[i]).metadata().sorter); - - } else if((table.config.headers[i] && table.config.headers[i].sorter)) { - - p = getParserById(table.config.headers[i].sorter); - } - if(!p) { - p = detectParserForColumn(table,cells[i]); - } - - if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; } - - list.push(p); - } - } - - if(table.config.debug) { log(parsersDebug); } - - return list; - }; - - function detectParserForColumn(table,node) { - var l = parsers.length; - for(var i=1; i < l; i++) { - if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)) { - return parsers[i]; - } - } - // 0 is always the generic parser (text) - return parsers[0]; - } - - function getParserById(name) { - var l = parsers.length; - for(var i=0; i < l; i++) { - if(parsers[i].id.toLowerCase() == name.toLowerCase()) { - return parsers[i]; - } - } - return false; - } - - /* utils */ - function buildCache(table) { - - if(table.config.debug) { var cacheTime = new Date(); } - - - var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0, - totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0, - parsers = table.config.parsers, - cache = {row: [], normalized: []}; - - for (var i=0;i < totalRows; ++i) { - - /** Add the table data to main data array */ - var c = table.tBodies[0].rows[i], cols = []; - - cache.row.push($(c)); - - for(var j=0; j < totalCells; ++j) { - cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j])); - } - - cols.push(i); // add position for rowCache - cache.normalized.push(cols); - cols = null; - }; - - if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); } - - return cache; - }; - - function getElementText(config,node) { - - if(!node) return ""; - - var t = ""; - - if(config.textExtraction == "simple") { - if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) { - t = node.childNodes[0].innerHTML; - } else { - t = node.innerHTML; - } - } else { - if(typeof(config.textExtraction) == "function") { - t = config.textExtraction(node); - } else { - t = $(node).text(); - } - } - return t; - } - - function appendToTable(table,cache) { - - if(table.config.debug) {var appendTime = new Date()} - - var c = cache, - r = c.row, - n= c.normalized, - totalRows = n.length, - checkCell = (n[0].length-1), - tableBody = $(table.tBodies[0]), - rows = []; - - for (var i=0;i < totalRows; i++) { - rows.push(r[n[i][checkCell]]); - if(!table.config.appender) { - - var o = r[n[i][checkCell]]; - var l = o.length; - for(var j=0; j < l; j++) { - - tableBody[0].appendChild(o[j]); - - } - - //tableBody.append(r[n[i][checkCell]]); - } - } - - if(table.config.appender) { - - table.config.appender(table,rows); - } - - rows = null; - - if(table.config.debug) { benchmark("Rebuilt table:", appendTime); } - - //apply table widgets - applyWidget(table); - - // trigger sortend - setTimeout(function() { - $(table).trigger("sortEnd"); - },0); - - }; - - function buildHeaders(table) { - - if(table.config.debug) { var time = new Date(); } - - var meta = ($.metadata) ? true : false, tableHeadersRows = []; - - for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; }; - - $tableHeaders = $("thead th",table); - - $tableHeaders.each(function(index) { - - this.count = 0; - this.column = index; - this.order = formatSortingOrder(table.config.sortInitialOrder); - - if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true; - - if(!this.sortDisabled) { - $(this).addClass(table.config.cssHeader); - } - - // add cell to headerList - table.config.headerList[index]= this; - }); - - if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); } - - return $tableHeaders; - - }; - - function checkCellColSpan(table, rows, row) { - var arr = [], r = table.tHead.rows, c = r[row].cells; - - for(var i=0; i < c.length; i++) { - var cell = c[i]; - - if ( cell.colSpan > 1) { - arr = arr.concat(checkCellColSpan(table, headerArr,row++)); - } else { - if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) { - arr.push(cell); - } - //headerArr[row] = (i+row); - } - } - return arr; - }; - - function checkHeaderMetadata(cell) { - if(($.metadata) && ($(cell).metadata().sorter === false)) { return true; }; - return false; - } - - function checkHeaderOptions(table,i) { - if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; }; - return false; - } - - function applyWidget(table) { - var c = table.config.widgets; - var l = c.length; - for(var i=0; i < l; i++) { - - getWidgetById(c[i]).format(table); - } - - } - - function getWidgetById(name) { - var l = widgets.length; - for(var i=0; i < l; i++) { - if(widgets[i].id.toLowerCase() == name.toLowerCase() ) { - return widgets[i]; - } - } - }; - - function formatSortingOrder(v) { - - if(typeof(v) != "Number") { - i = (v.toLowerCase() == "desc") ? 1 : 0; - } else { - i = (v == (0 || 1)) ? v : 0; - } - return i; - } - - function isValueInArray(v, a) { - var l = a.length; - for(var i=0; i < l; i++) { - if(a[i][0] == v) { - return true; - } - } - return false; - } - - function setHeadersCss(table,$headers, list, css) { - // remove all header information - $headers.removeClass(css[0]).removeClass(css[1]); - - var h = []; - $headers.each(function(offset) { - if(!this.sortDisabled) { - h[this.column] = $(this); - } - }); - - var l = list.length; - for(var i=0; i < l; i++) { - h[list[i][0]].addClass(css[list[i][1]]); - } - } - - function fixColumnWidth(table,$headers) { - var c = table.config; - if(c.widthFixed) { - var colgroup = $(''); - $("tr:first td",table.tBodies[0]).each(function() { - colgroup.append($('').css('width',$(this).width())); - }); - $(table).prepend(colgroup); - }; - } - - function updateHeaderSortCount(table,sortList) { - var c = table.config, l = sortList.length; - for(var i=0; i < l; i++) { - var s = sortList[i], o = c.headerList[s[0]]; - o.count = s[1]; - o.count++; - } - } - - /* sorting methods */ - function multisort(table,sortList,cache) { - - if(table.config.debug) { var sortTime = new Date(); } - - var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length; - - for(var i=0; i < l; i++) { - - var c = sortList[i][0]; - var order = sortList[i][1]; - var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc"); - - var e = "e" + i; - - dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); "; - dynamicExp += "if(" + e + ") { return " + e + "; } "; - dynamicExp += "else { "; - } - - // if value is the same keep orignal order - var orgOrderCol = cache.normalized[0].length - 1; - dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];"; - - for(var i=0; i < l; i++) { - dynamicExp += "}; "; - } - - dynamicExp += "return 0; "; - dynamicExp += "}; "; - - eval(dynamicExp); - - cache.normalized.sort(sortWrapper); - - if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); } - - return cache; - }; - - function sortText(a,b) { - return ((a < b) ? -1 : ((a > b) ? 1 : 0)); - }; - - function sortTextDesc(a,b) { - return ((b < a) ? -1 : ((b > a) ? 1 : 0)); - }; - - function sortNumeric(a,b) { - return a-b; - }; - - function sortNumericDesc(a,b) { - return b-a; - }; - - function getCachedSortType(parsers,i) { - return parsers[i].type; - }; - - /* public methods */ - this.construct = function(settings) { - - return this.each(function() { - - if(!this.tHead || !this.tBodies) return; - - var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder; - - this.config = {}; - - config = $.extend(this.config, $.tablesorter.defaults, settings); - - // store common expression for speed - $this = $(this); - - // build headers - $headers = buildHeaders(this); - - // try to auto detect column type, and store in tables config - this.config.parsers = buildParserCache(this,$headers); - - - // build the cache for the tbody cells - cache = buildCache(this); - - // get the css class names, could be done else where. - var sortCSS = [config.cssDesc,config.cssAsc]; - - // fixate columns if the users supplies the fixedWidth option - fixColumnWidth(this); - - // apply event handling to headers - // this is to big, perhaps break it out? - $headers.click(function(e) { - - $this.trigger("sortStart"); - - var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0; - - if(!this.sortDisabled && totalRows > 0) { - - - // store exp, for speed - var $cell = $(this); - - // get current column index - var i = this.column; - - // get current column sort order - this.order = this.count++ % 2; - - // user only whants to sort on one column - if(!e[config.sortMultiSortKey]) { - - // flush the sort list - config.sortList = []; - - if(config.sortForce != null) { - var a = config.sortForce; - for(var j=0; j < a.length; j++) { - if(a[j][0] != i) { - config.sortList.push(a[j]); - } - } - } - - // add column to sort list - config.sortList.push([i,this.order]); - - // multi column sorting - } else { - // the user has clicked on an all ready sortet column. - if(isValueInArray(i,config.sortList)) { - - // revers the sorting direction for all tables. - for(var j=0; j < config.sortList.length; j++) { - var s = config.sortList[j], o = config.headerList[s[0]]; - if(s[0] == i) { - o.count = s[1]; - o.count++; - s[1] = o.count % 2; - } - } - } else { - // add column to sort list array - config.sortList.push([i,this.order]); - } - }; - setTimeout(function() { - //set css for headers - setHeadersCss($this[0],$headers,config.sortList,sortCSS); - appendToTable($this[0],multisort($this[0],config.sortList,cache)); - },1); - // stop normal event by returning false - return false; - } - // cancel selection - }).mousedown(function() { - if(config.cancelSelection) { - this.onselectstart = function() {return false}; - return false; - } - }); - - // apply easy methods that trigger binded events - $this.bind("update",function() { - - // rebuild parsers. - this.config.parsers = buildParserCache(this,$headers); - - // rebuild the cache map - cache = buildCache(this); - - }).bind("sorton",function(e,list) { - - $(this).trigger("sortStart"); - - config.sortList = list; - - // update and store the sortlist - var sortList = config.sortList; - - // update header count index - updateHeaderSortCount(this,sortList); - - //set css for headers - setHeadersCss(this,$headers,sortList,sortCSS); - - - // sort the table and append it to the dom - appendToTable(this,multisort(this,sortList,cache)); - - }).bind("appendCache",function() { - - appendToTable(this,cache); - - }).bind("applyWidgetId",function(e,id) { - - getWidgetById(id).format(this); - - }).bind("applyWidgets",function() { - // apply widgets - applyWidget(this); - }); - - if($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) { - config.sortList = $(this).metadata().sortlist; - } - // if user has supplied a sort list to constructor. - if(config.sortList.length > 0) { - $this.trigger("sorton",[config.sortList]); - } - - // apply widgets - applyWidget(this); - }); - }; - - this.addParser = function(parser) { - var l = parsers.length, a = true; - for(var i=0; i < l; i++) { - if(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) { - a = false; - } - } - if(a) { parsers.push(parser); }; - }; - - this.addWidget = function(widget) { - widgets.push(widget); - }; - - this.formatFloat = function(s) { - var i = parseFloat(s); - return (isNaN(i)) ? 0 : i; - }; - this.formatInt = function(s) { - var i = parseInt(s); - return (isNaN(i)) ? 0 : i; - }; - - this.isDigit = function(s,config) { - var DECIMAL = '\\' + config.decimal; - var exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/'; - return RegExp(exp).test($.trim(s)); - }; - - this.clearTableBody = function(table) { - if($.browser.msie) { - function empty() { - while ( this.firstChild ) this.removeChild( this.firstChild ); - } - empty.apply(table.tBodies[0]); - } else { - table.tBodies[0].innerHTML = ""; - } - }; - } - }); - - // extend plugin scope - $.fn.extend({ - tablesorter: $.tablesorter.construct - }); - - var ts = $.tablesorter; - - // add default parsers - ts.addParser({ - id: "text", - is: function(s) { - return true; - }, - format: function(s) { - return $.trim(s.toLowerCase()); - }, - type: "text" - }); - - ts.addParser({ - id: "digit", - is: function(s,table) { - var c = table.config; - return $.tablesorter.isDigit(s,c); - }, - format: function(s) { - return $.tablesorter.formatFloat(s); - }, - type: "numeric" - }); - - ts.addParser({ - id: "currency", - is: function(s) { - return /^[£$€?.]/.test(s); - }, - format: function(s) { - return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),"")); - }, - type: "numeric" - }); - - ts.addParser({ - id: "ipAddress", - is: function(s) { - return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s); - }, - format: function(s) { - var a = s.split("."), r = "", l = a.length; - for(var i = 0; i < l; i++) { - var item = a[i]; - if(item.length == 2) { - r += "0" + item; - } else { - r += item; - } - } - return $.tablesorter.formatFloat(r); - }, - type: "numeric" - }); - - ts.addParser({ - id: "url", - is: function(s) { - return /^(https?|ftp|file):\/\/$/.test(s); - }, - format: function(s) { - return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),'')); - }, - type: "text" - }); - - ts.addParser({ - id: "isoDate", - is: function(s) { - return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s); - }, - format: function(s) { - return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g),"/")).getTime() : "0"); - }, - type: "numeric" - }); - - ts.addParser({ - id: "percent", - is: function(s) { - return /\%$/.test($.trim(s)); - }, - format: function(s) { - return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),"")); - }, - type: "numeric" - }); - - ts.addParser({ - id: "usLongDate", - is: function(s) { - return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/)); - }, - format: function(s) { - return $.tablesorter.formatFloat(new Date(s).getTime()); - }, - type: "numeric" - }); - - ts.addParser({ - id: "shortDate", - is: function(s) { - return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s); - }, - format: function(s,table) { - var c = table.config; - s = s.replace(/\-/g,"/"); - if(c.dateFormat == "us") { - // reformat the string in ISO format - s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2"); - } else if(c.dateFormat == "uk") { - //reformat the string in ISO format - s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1"); - } else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") { - s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3"); - } - return $.tablesorter.formatFloat(new Date(s).getTime()); - }, - type: "numeric" - }); - - ts.addParser({ - id: "time", - is: function(s) { - return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s); - }, - format: function(s) { - return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime()); - }, - type: "numeric" - }); - - - ts.addParser({ - id: "metadata", - is: function(s) { - return false; - }, - format: function(s,table,cell) { - var c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName; - return $(cell).metadata()[p]; - }, - type: "numeric" - }); - - // add default widgets - ts.addWidget({ - id: "zebra", - format: function(table) { - if(table.config.debug) { var time = new Date(); } - $("tr:visible",table.tBodies[0]) - .filter(':even') - .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]) - .end().filter(':odd') - .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]); - if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); } - } - }); -})(jQuery); diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.min.js b/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.min.js deleted file mode 100644 index d79fd0c681..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/jquery.tablesorter.min.js +++ /dev/null @@ -1,2 +0,0 @@ -// @codingStandardsIgnoreFile Ignore because it's code from another project. -(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;ib)?1:0));};function sortTextDesc(a,b){return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i - - - - - - - - - - - Sitemap file - - - - - - - - - - sitemap - siteindex - - - - -

Sitemap file

- - - - - - - - -
- - - -
-

Number of sitemaps in this index:

-
- - - - - - - - - - - - -
Sitemap URLLast modification date
-
- - - -
-

Number of URLs in this sitemap:

-
- - - - - - - - - - - - - - -
URL locationLast modification dateChange frequencyPriority
-
- - - - - - - - - - - - - - - - - 0.5 - - - - - - - - - - - - - - - -
diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.css b/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.css deleted file mode 100644 index b0e409035c..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.css +++ /dev/null @@ -1,46 +0,0 @@ -body { - background-color: #fff; - font-family: Verdana,sans-serif; - font-size: 10pt; -} -h1 { - font-size: 1.25em; -} -table.tablesorter { - background-color: #cdcdcd; - margin: 10px 0pt 15px; - font-size: 8pt; - width: 100%; - text-align: left; -} -table.tablesorter thead tr th, -table.tablesorter tfoot tr th { - background-color: #e6eeee; - border: 1px solid #fff; - font-size: 8pt; - padding: 3px; -} -table.tablesorter thead tr .header { - cursor: pointer; -} -table.tablesorter tbody td { - color: #3d3d3d; - padding: 3px; - background-color: #fff; - vertical-align: top; -} -table.tablesorter tbody tr.odd td { - background-color: #efefef; -} -table.tablesorter thead tr .headerSortUp { - background: url(/misc/arrow-asc.png) no-repeat center right; -} -table.tablesorter thead tr .headerSortDown { - background: url(/misc/arrow-desc.png) no-repeat center right; -} -table.tablesorter thead tr .headerSortDown, -table.tablesorter thead tr .headerSortUp { - background-color: #5050d3; - color: #fff; - font-style: italic; -} diff --git a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.js b/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.js deleted file mode 100644 index a7d302757d..0000000000 --- a/source/webapp/sites/all/modules/contrib/xmlsitemap/xsl/xmlsitemap.xsl.js +++ /dev/null @@ -1,45 +0,0 @@ -(function($){ - -$.tablesorter.addParser({ - // set a unique id - id: 'changefreq', - is: function(s) { - return false; - }, - format: function(s) { - switch (s) { - case 'always': - return 0; - case 'hourly': - return 1; - case 'daily': - return 2; - case 'weekly': - return 3; - case 'monthly': - return 4; - case 'yearly': - return 5; - default: - return 6; - } - }, - type: 'numeric' -}); - -$(document).ready(function() { - // Set some location variables. - var h1 = $('h1'); - h1.text(h1.text() + ': ' + location); - document.title = h1.text(); - - $('table').tablesorter({ - sortList: [[0,0]], - headers: { - 2: { sorter: 'changefreq' } - }, - widgets: ['zebra'] - }); -}); - -})(jQuery); diff --git a/source/webapp/sites/all/modules/custom/checkbook_datafeeds/checkbook_datafeeds.module b/source/webapp/sites/all/modules/custom/checkbook_datafeeds/checkbook_datafeeds.module deleted file mode 100644 index 65662dbfc3..0000000000 --- a/source/webapp/sites/all/modules/custom/checkbook_datafeeds/checkbook_datafeeds.module +++ /dev/null @@ -1,2112 +0,0 @@ -. - */ - -module_load_include('php', 'checkbook_datafeeds', 'config/util/DatafeedsConfigUtil'); -module_load_include('inc', 'checkbook_datafeeds', 'includes/contracts/checkbook_datafeeds_contracts'); -module_load_include('inc', 'checkbook_datafeeds', 'includes/spending/checkbook_datafeeds_spending'); -module_load_include('inc', 'checkbook_datafeeds', 'includes/payroll/checkbook_datafeeds_payroll'); -module_load_include('inc', 'checkbook_datafeeds', 'includes/budget/checkbook_datafeeds_budget'); -module_load_include('inc', 'checkbook_datafeeds', 'includes/revenue/checkbook_datafeeds_revenue'); -module_load_include('inc', 'checkbook_datafeeds', 'includes/checkbook_datafeeds_tracking'); - -spl_autoload_register(function ($class) { - if (FALSE !== strpos($class, 'checkbook_datafeeds')) { - list(, $class) = explode('\\', $class); - $domain = substr($class, 0, strpos($class, 'Feed')); - if(strlen($domain) > 0 ) { - include_once 'includes/' .strtolower($domain) . '/' . $class . '.class.inc'; - }else { - include_once 'includes/' . $class . '.class.inc'; - } - } -}); - - -/** - * Implements hook_menu(). - */ -function checkbook_datafeeds_menu() -{ - $items = array(); - $items['data-feeds'] = array( - 'title' => 'Data Feeds', - 'page callback' => 'checkbook_datafeeds_data_feeds_page', - 'access callback' => TRUE, - 'type' => MENU_NORMAL_ITEM, - ); - $items['data-feeds/data-feeds'] = array( - 'title' => 'Data Feeds', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => 0, - ); - $items['data-feeds/api'] = array( - 'title' => 'API', - 'page callback' => 'checkbook_datafeeds_api_page', - 'access callback' => TRUE, - 'type' => MENU_LOCAL_TASK, - 'weight' => 1, - ); - $items['track-data-feed'] = array( - 'page callback' => 'checkbook_datafeeds_tracking_results_page', - 'access callback' => TRUE, - ); - $items['data-feeds/download'] = array( - 'title' => 'Checkbook Alerts', - 'page callback' => 'checkbook_datafeeds_download_zip_ajax', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['datafeeds/budget/department/%/%'] = array( - 'page callback' => '_budget_dept_options', - 'page arguments' => array(3, 4), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK - ); - $items['datafeeds/%/expcat/%/%/%'] = array( - 'page callback' => '_budget_expcat_options', - 'page arguments' => array(1, 3, 4, 5), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK - ); - - $items['datafeeds/spending/agency/%/%'] = array( - 'page callback' => '_agency_options', - 'page arguments' => array(3, 4), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK - ); - - $items['datafeeds/spending/agency/%/%'] = array( - 'page callback' => '_agency_options', - 'page arguments' => array(3, 4), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK - ); - - $items['data-feeds/%/budget_name/%/%/%'] = array( - 'page callback' => '_budget_name_options', - 'page arguments' => array(1, 3, 4, 5), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK - ); - - $items['data-feeds/%/budget_type/%/%/%'] = array( - 'page callback' => '_budget_type_options', - 'page arguments' => array(1, 3, 4, 5), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK - ); - - return $items; -} - -/** - * Implements hook_library(). - */ -function checkbook_datafeeds_library() -{ - $libraries['jquery_multiselect'] = array( - 'title' => 'jquery.multi-select.js', - 'website' => 'http://loudev.com/index.html', - 'version' => '0.3', - 'js' => array( - drupal_get_path('module', 'checkbook_datafeeds') . '/js/multi-select/js/jquery.multi-select.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'checkbook_datafeeds') . '/js/multi-select/css/multi-select.css' => array(), - ), - ); - return $libraries; -} - -/** - * Implements hook_theme(). - * @param $existing - * @param $type - * @param $theme - * @param $path - * @return array - */ -function checkbook_datafeeds_theme($existing, $type, $theme, $path) -{ - $hooks = array(); - $hooks['user_criteria'] = array( - 'variables' => array('usercriteria' => NULL), - ); - return $hooks; -} - -/** - * Callback function to display API documentation page. - * - * @return array - * Drupal renderable array for node 299 - * @see checkbook_datafeeds_menu() - * - */ -function checkbook_datafeeds_api_page() -{ - $node = node_load(299); - $node = node_view($node); - return $node; -} - - -/** - * Theme function for search criteria. - * - * @param array $variables - * Items to be themed - * - * @return string - * Themed label-value pairs - */ -function theme_user_criteria($variables) -{ - $output = ''; - foreach ($variables['usercriteria'] as $key => $value) { - if ($key !== 'Columns' && $key !== 'Record Count') { - $output .= '
' . $key . ': ' . $value . '
'; - } - } - return $output; -} - -/** - * Page callback for Data Feeds page. - * - * @return array - * Renderable array representing entire Data Feeds page. - * @see checkbook_datafeeds_menu() - * - */ -function checkbook_datafeeds_data_feeds_page() -{ - $page['instructions'] = array( - '#markup' => t('

Select the Data Feeds

Use this tool to design your own snapshots of NYC Financial Data

You can then save the resulting dataset as a file, or publish a dynamically updating XML feed of the data. This feed will enable you to build your own web applications and widgets for your website.

'), - '#prefix' => '
', - ); - $page['trackstatus'] = array( - '#markup' => '
', - ); - $page['tftitle'] = array( - '#markup' => '

Track Status of Data Feed

', - ); - $page['tracking'] = drupal_get_form('checkbook_datafeeds_tracking_form'); - $page['closediv'] = array( - '#markup' => '
', - ); - $page['data-feed-wizard'] = drupal_get_form('checkbook_datafeeds_data_feed_wizard'); - $page['rotator'] = array( - '#markup' => '
', - ); - return $page; -} - -/** - * Sets up steps for Data Feeds wizard using FAPI. - * - * @param array $form - * Data Feeds form array - * @param array $form_state - * Data Feeds form form_state array - * - * @return array - * Renderable array of right pane of Data Feeds wizard - * @see checkbook_datafeeds_menu() - * - */ -function checkbook_datafeeds_data_feed_wizard($form, &$form_state) -{ - switch ($form_state['step']) { - case 'budget': - return checkbook_datafeeds_budget($form, $form_state); - break; - - case 'budget_confirmation': - return checkbook_datafeeds_budget_confirmation($form, $form_state); - break; - - case 'contracts': - return checkbook_datafeeds_contracts($form, $form_state); - break; - - case 'contracts_confirmation': - return checkbook_datafeeds_contracts_confirmation($form, $form_state); - break; - - case 'payroll': - return checkbook_datafeeds_payroll($form, $form_state); - break; - - case 'payroll_confirmation': - return checkbook_datafeeds_payroll_confirmation($form, $form_state); - break; - - case 'revenue': - return checkbook_datafeeds_revenue($form, $form_state); - break; - - case 'revenue_confirmation': - return checkbook_datafeeds_revenue_confirmation($form, $form_state); - break; - - case 'spending': - $form = checkbook_datafeeds_spending($form, $form_state); - return $form; - break; - - case 'spending_confirmation': - $form = checkbook_datafeeds_spending_confirmation($form, $form_state); - return $form; - break; - - case 'queue_final': - return checkbook_datafeeds_queue_final($form, $form_state); - break; - } - - $form_state['step'] = 'type'; - - $form['type'] = array( - '#type' => 'radios', - '#title' => t('1. Select the Data Type:'), - '#prefix' => '
', - '#options' => array( - 'budget' => t('Budget'), - 'revenue' => t('Revenue'), - 'spending' => t('Spending'), - 'contracts' => t('Contracts'), - 'payroll' => t('Payroll'), - ), - '#default_value' => !empty($form_state['values']['type']) ? $form_state['values']['type'] : 'spending', - ); - $form['format'] = array( - '#type' => 'radios', - '#title' => t('2. Select the Format:'), - '#options' => array( - 'csv' => t('CSV'), - 'xml' => t('XML'), - ), - '#default_value' => !empty($form_state['values']['format']) ? $form_state['values']['format'] : 'csv', - ); - $form['type_next'] = array( - '#type' => 'submit', - '#value' => t('Next'), - '#name' => 'next', - '#suffix' => '
', - '#submit' => array('checkbook_datafeeds_type_next_submit'), - ); - $form['#attributes'] = array('class' => array('first-page', 'data-feeds-wizard')); - return $form; -} - -/** - * Submit handler for first step of form. - * - * @param array $form - * Data Feeds form array - * @param array $form_state - * Data Feeds form form_state array - */ -function checkbook_datafeeds_type_next_submit($form, &$form_state) -{ - $current_step = &$form_state['step']; - $form_state['step_information'][$current_step]['stored_values'] = $form_state['values']; - switch ($form_state['values']['type']) { - case 'budget': - $current_step = 'budget'; - if (!empty($form_state['step_information']['budget']['stored_values'])) { - $form_state['values'] = $form_state['step_information']['budget']['stored_values']; - } else { - $form_state['values'] = array(); - } - // Force rebuild with next step. - $form_state['rebuild'] = TRUE; - break; - - case 'contracts': - $current_step = 'contracts'; - if (!empty($form_state['step_information']['contracts']['stored_values'])) { - $form_state['values'] = $form_state['step_information']['contracts']['stored_values']; - } else { - $form_state['values'] = array(); - } - // Force rebuild with next step. - $form_state['rebuild'] = TRUE; - break; - - case 'payroll': - $current_step = 'payroll'; - if (!empty($form_state['step_information']['payroll']['stored_values'])) { - $form_state['values'] = $form_state['step_information']['payroll']['stored_values']; - } else { - $form_state['values'] = array(); - } - // Force rebuild with next step. - $form_state['rebuild'] = TRUE; - break; - - case 'revenue': - $current_step = 'revenue'; - if (!empty($form_state['step_information']['revenue']['stored_values'])) { - $form_state['values'] = $form_state['step_information']['revenue']['stored_values']; - } else { - $form_state['values'] = array(); - } - // Force rebuild with next step. - $form_state['rebuild'] = TRUE; - break; - - case 'spending': - $current_step = 'spending'; - if (!empty($form_state['step_information']['spending']['stored_values'])) { - $form_state['values'] = $form_state['step_information']['spending']['stored_values']; - } else { - $form_state['values'] = array(); - } - // Force rebuild with next step. - $form_state['rebuild'] = TRUE; - break; - } -} - -/** - * Sorts selected columns to match intended order for export - * @param array $selectedColumns - * @param array $intendedOrder - * @return array - */ -function checkbook_datafeeds_override_column_order(array $selectedColumns, array $intendedOrder) -{ - $ordered = []; - foreach ($intendedOrder as $key) { - if (in_array($key, $selectedColumns)) { - $ordered[$key] = $selectedColumns[$key]; - } - } - return $ordered; -} - - -/** - * Function to figure out where to pre-populate data from. - * This is in the case where the data source is switching from/to - * checkbook or checkbook_oge. In this case, the pre-population - * should not come from the form_state, instead, it should be treated - * as if it were the first time. The form state will contain the values - * of the data from the previous form data source should not be used. - * - * The $form_state["triggering_element"]["#value"] holds the value of the - * data_source if the radio button for switching was clicked. - * - * There are 3 scenarios based on the triggering element value: - * - * 1. There is no triggering element value, - * this is a first load - * 2. The triggering element is populated but the data_source has not changed, - * this is not a first load - * 3. The triggering element is populated AND the data_source has changed, - * this is considered a first load - * - * @param array $form_state - * Data Feeds wizard form_state array - * - * @param string $data_source - * Current data source (checkbook, checkbook_oge) - * - * @return bool - * Value describing if data should be loaded from the $form_state or - * treated like first time - */ -function checkbook_datafeeds_is_first_load($form_state, $data_source) -{ - $triggering_element_value = $form_state["triggering_element"]["#value"]; - $data_source_changed = $form_state["triggering_element"]["#ajax"]["parameters"]["data_source_changed"]; - - $first_load = true; - - // First time load == true if: - // The triggering element is empty OR, - // The data_source has changed - if (!$triggering_element_value || $data_source_changed) return $first_load; - - // The data_source has not changed, this not a first load - return !$first_load; -} - -/** - * @param $form_state - * @param $field_name - * @param $first_time_load - * @param string $default_val - * @return mixed|string - */ -function checkbook_datafeeds_filter_get_default_value($form_state, $field_name, $first_time_load, $default_val = '') -{ - if ($first_time_load) { - return $default_val; - } - return (isset($form_state['values'][$field_name]) || $form_state['values'][$field_name] === "0") ? $form_state['values'][$field_name] : $default_val; -} - - -/** - * Ajax callback to update department and expense_category fields based on year. - * - * @param array $form - * Data Feeds wizard form array - * @param array $form_state - * Data Feeds wizard form_state array - * - * @return array - * Array of ajax commands - */ -function checkbook_datafeeds_year_ajax($form, &$form_state) -{ - - $html = array($form['filter']['dept'], $form['filter']['expense_category']); - $html = drupal_render($html); - $commands[] = ajax_command_replace('#dynamic-fields', $html); - return array('#type' => 'ajax', '#commands' => $commands); -} - -//Reusable functions - -/** - * Get years from Data Controller and format into a FAPI select input #options array. - * - * @param string|null $yeartype - * All Years or Budget Fiscal Years - * @param $datasource - * @param $domain - * @return mixed - * Array of years formatted for FAPI select box #options - */ -function _year_options($yeartype = NULL, $datasource = Datasource::CITYWIDE, $domain = NULL) -{ - switch ($yeartype) { - case 'all-years': - try { - $fydata = CheckbookDateUtil::getFiscalYearOptionsRange($datasource); - $fyarray = array(); - foreach ($fydata as $row) { - $fyarray['FY' . $row['year_value']] = 'FY ' . $row['year_value']; - } - if($domain != Domain::$SPENDING && $datasource == DataSource::NYCHA) { - $fyarray['FY2010'] = 'FY 2010'; - } - //Remove this after Year Filter Separation for Spending Data-feeds - if($domain == Domain::$SPENDING){ - $fyarray['FY2010'] = 'FY 2010'; - $fyarray = array_merge(array('FY2021' => 'FY 2021'), $fyarray); - } - $results = array_merge(array('0' => 'All Years'), $fyarray); - return $results; - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } - break; - - case 'budget-fiscal-years': - $query = 'SELECT DISTINCT budget_fiscal_year, budget_fiscal_year_id FROM budget WHERE budget_fiscal_year > 2010 ORDER BY budget_fiscal_year_id DESC'; - $fy_data = _checkbook_project_execute_sql($query); - $years = array(); - foreach ($fy_data as $year) { - $years[$year['budget_fiscal_year']] = $year['budget_fiscal_year']; - } - return $years; - break; - - default: - try { - $fydata = CheckbookDateUtil::getFiscalYearOptionsRange($datasource); - $cydata = CheckbookDateUtil::getCalendarYearOptionsRange($datasource); - $fyarray = $cyarray = []; - foreach ($fydata as $row) { - $fyarray['FY ' . $row['year_value']] = 'FY ' . $row['year_value']; - } - foreach ($cydata as $row) { - $cyarray['CY ' . $row['year_value']] = 'CY ' . $row['year_value']; - } - $results = array_merge($cyarray, $fyarray); - return $results; - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } - break; - } -} - - -/** - * Get Agencies from Data Controller and format into a FAPI select input #options array. - * - * @param string $data_source - * @param bool $json_output - * @return mixed - * Agency names and codes - */ -function _agency_options($data_source = null, $json_output = false) { - try { - $dataController = data_controller_get_instance(); - switch($data_source){ - case 'checkbook_oge': - $data = $dataController->queryDataset("checkbook_oge:agency", array( - 'agency_code', - 'agency_name', - ), array("is_display" => "Y","is_oge_agency" => "Y"), 'agency_name'); - break; - case 'checkbook_nycha': - $data = $dataController->queryDataset("checkbook_nycha:agency", array( - 'agency_code', - 'agency_name', - ), array("is_display" => "Y"), 'agency_name'); - break; - case 'checkbook_oge_nycha': - $oge_data = $dataController->queryDataset("checkbook_oge:agency", array( - 'agency_code', - 'agency_name', - ), array("is_display" => "Y","is_oge_agency" => "Y"), 'agency_name'); - - $nycha_data = $dataController->queryDataset("checkbook_nycha:agency", array( - 'agency_code', - 'agency_name', - ), array("is_display" => "Y"), 'agency_name'); - $data = array_merge($nycha_data, $oge_data); - break; - default: - $data = $dataController->queryDataset("checkbook:agency", array( - 'agency_code', - 'agency_name', - ), array("is_display" => "Y"), 'agency_name'); - break; - } - return _checkbook_datafeeds_agency_options($data,$data_source, $json_output); - } - catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - -/** - * Get the agency options, for IE8, the text will be shortened to fit the width and a title attribute is there - * @param $data - * @param null $data_source - * @param bool $json_output - * @return mixed - */ -function _checkbook_datafeeds_agency_options($data,$data_source = null, $json_output = false) { - - //IE8 - handle drop down width issue - if($data_source == 'checkbook'){ - $menu_options = array('Citywide (All Agencies)' => 'Citywide (All Agencies)'); - $json_menu_options[] = array('label'=> 'Citywide (All Agencies)','value' => 'Citywide (All Agencies)', 'code' => ''); - $title = 'Citywide (All Agencies)'; - } - - $menu_options_attributes = array($title => array('title' => $title)); - - foreach ($data as $row) { - $option = $row['agency_name'] . ' [' . $row['agency_code'] . ']'; - //Menu options - $menu_options[$option] = (strlen($option) > 20) ? substr($option, 0, 20) . '...' : $option; - $json_menu_options[] = array('label'=> $menu_options[$option],'value' => $option, 'code' => $option); - //Menu option titles - $menu_options_attributes[$option] = array('title' => $option); - } - $results['options'] = $menu_options; - $results['options_attributes'] = $menu_options_attributes; - if ($json_output) { - drupal_json_output($json_menu_options); - }else { - return $results; - } -} - - -/** - * Get Sub Vendor Status in PIP from Data Controller and format into a FAPI select input #options array. - * - * @return mixed - * Sub Vendor Status In PIP ids and nammes - */ -function _sub_vendor_status_in_pip() -{ - $statuses[0] = 'Select Status'; - try { - $dataController = data_controller_get_instance(); - $data = $dataController->queryDataset('checkbook:subcontract_approval_status', - array('aprv_sta_id', 'aprv_sta_value'), - NULL, 'sort_order', 0, 10, NULL); - - $menu_options = array('0' => 'Select Status'); - $title = 'Select Status'; - $menu_options_attributes = array($title => array('title' => $title)); - - foreach ($data as $row) { - if ($row['aprv_sta_id'] != "7") { - $option = $row['aprv_sta_value'].'['.$row['aprv_sta_id'] .']'; - //Menu options - $menu_options[$row['aprv_sta_id']] = _ckbk_excerpt($option); - //Menu option titles - $menu_options_attributes[$row['aprv_sta_id']] = array('title' => $option); - } - } - $results['options'] = $menu_options; - $results['options_attributes'] = $menu_options_attributes; - return $results; - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - - -/** - * Get Fund Classes from Data Controller and format into a FAPI select input #options array. - * - * @return mixed - * Fund classes and fund class names - */ -function _fund_class_options() -{ - try { - $dataController = data_controller_get_instance(); - $data = $dataController->queryDataset('checkbook:fund_class', array( - 'fund_class_code', - 'fund_class_name', - ), NULL, 'fund_class_name'); - $results = array(); - foreach ($data as $row) { - if ($row['fund_class_name']) { - if (strtolower($row['fund_class_name']) == 'general fund') - $results[$row['fund_class_name'] . ' [' . $row['fund_class_code'] . ']'] = $row['fund_class_name'] . ' [' . $row['fund_class_code'] . ']'; - } - } - return array_unique($results); - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - -/** - * Get Revenue Categories from Data Controller and format into a FAPI select input #options array. - * - * @return mixed - * Revenue categories and revenue category names - */ -function _revenue_category_options() -{ - try { - $dataController = data_controller_get_instance(); - $data = $dataController->queryDataset('checkbook:revenue_category', array( - 'revenue_category_code', - 'revenue_category_name', - ), NULL, 'revenue_category_name'); - $results = array('All Revenue Categories' => 'All Revenue Categories'); - foreach ($data as $row) { - $results[$row['revenue_category_name'] . ' [' . $row['revenue_category_code'] . ']'] = $row['revenue_category_name'] . ' [' . $row['revenue_category_code'] . ']'; - } - return array_unique($results); - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - -/** - * Get Funding Sources from Data Controller and format into a FAPI select input #options array. - * - * @return mixed - * Funding source codes and funding source names - */ -function _funding_class_options() -{ - try { - $dataController = data_controller_get_instance(); - $data = $dataController->queryDataset('checkbook:ref_funding_class', array( - 'funding_class_code', - 'funding_class_name', - ), NULL, 'funding_class_name'); - $results = array('All Funding Classes' => 'All Funding Classes'); - foreach ($data as $row) { - $results[$row['funding_class_name'] . ' [' . $row['funding_class_code'] . ']'] = $row['funding_class_name'] . ' [' . $row['funding_class_code'] . ']'; - } - return array_unique($results); - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - -/** - * @param string $data_source - * @return array|void - */ -function _funding_source_options($data_source = Datasource::NYCHA) -{ - $options = ['Select Funding Source' => 'Select Funding Source']; - $menu_options_attributes = ['Select Funding Source' =>['title'=> 'Select Funding Source']]; - - switch ($data_source) { - case Datasource::NYCHA: - try { - $dataController = data_controller_get_instance(); - $data = $dataController->queryDataset('checkbook_nycha:funding_source', array( - 'funding_source_code', - 'funding_source_description', - ), NULL, 'funding_source_description'); - if ($data) { - foreach ($data as $row) { - $key = $row['funding_source_description'] . ' [' . $row['funding_source_code'] . ']'; - $options[$key] = _ckbk_excerpt($key); - $menu_options_attributes[$key] = ['title' => $key]; - } - } - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } - break; - default: - break; - } - return [ - 'options' => $options, - 'option_attributes' => $menu_options_attributes - ]; -} - -/** - * Get Expense Type from Data Controller and format into a FAPI select input options array. - * - * @param string $data_source - * @return mixed - * Spending category codes and display names - */ -function _expense_type_options($data_source = Datasource::CITYWIDE) -{ - try { - $dataController = data_controller_get_instance(); - - switch ($data_source) { - case Datasource::NYCHA: - $data = $dataController->queryDataset($data_source . ':spending_category', array( - 'spending_category_code', - 'display_spending_category_name', - ), null, 'spending_category_code'); - break; - default: - $data = $dataController->queryDataset($data_source . ':spending_category', array( - 'spending_category_code', - 'display_name', - 'spending_category_name', - ), null, 'display_order'); - } - - $results = _checkbook_datafeeds_expense_type_options($data, $data_source); - return $results; - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - -/** - * Get the expense type options, for IE8, the text will be shortened to fit the width and a title attribute is there - * @param $data - * @param null $data_source - * @return mixed - */ -function _checkbook_datafeeds_expense_type_options($data, $data_source = null) -{ - - //IE8 - handle drop down width issue - foreach ($data as $row) { - $option = ($row['spending_category_name'] ?? $row['display_spending_category_name']) . ' [' . $row['spending_category_code'] . ']'; - if ($row['spending_category_code'] == 'ts') { - $option = 'Total Spending [ts]'; - //Menu options - $menu_options[''] = 'Total Spending [ts]'; - //Menu option titles - $menu_options_attributes[$option] = array('title' => $option); - } else { - //$display_option = $row['spending_category_name'] ?? $row['display_spending_category_name']; - //Menu options - $menu_options[$option] = $option; - //Menu option titles - $menu_options_attributes[$option] = array('title' => $option); - } - } - $results['options'] = $menu_options; - $results['options_attributes'] = $menu_options_attributes; - return $results; -} - -/** - * Format pay frequencies into a FAPI select input #options array. - * - * @return array - * Pay frequencies - */ -function _pay_frequency_options() -{ - return array( - 'All Pay Frequencies' => 'Select Pay Frequency', - 'Bi-weekly' => 'Bi-weekly', - 'Monthly' => 'Monthly', - 'Supplemental' => 'Supplemental', - ); -} - -/** - * Get Contract Type from Data Controller and format into a FAPI select input #options array. - * - * @return mixed - * Agreement type codes and agreement type names - */ -function _contract_type_options() -{ - try { - $dataController = data_controller_get_instance(); - $data = $dataController->queryDataset('checkbook:agreement_type', array( - 'agreement_type_code', - 'agreement_type_name' - ), NULL, 'agreement_type_name'); - $results = _checkbook_datafeeds_contract_type_options($data); - return $results; - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - -/** - * Get the Contract Type options, for IE8, the text will be shortened to fit the width and a title attribute is there - * - * @param $data - * @return mixed - */ -function _checkbook_datafeeds_contract_type_options($data) -{ - - //IE8 - handle drop down width issue - $title = 'Select Contract Type'; - $menu_options['No Contract Type Selected'] = $title; - $menu_options_attributes = array($title => array('title' => $title)); - - foreach ($data as $row) { - $option = $row['agreement_type_name'] . ' [' . $row['agreement_type_code'] . ']'; - //Menu options - $menu_options[$option] = _ckbk_excerpt($option); - //Menu option titles - $menu_options_attributes[$option] = array('title' => $option); - } - $results['options'] = $menu_options; - $results['options_attributes'] = $menu_options_attributes; - return $results; -} - -/** - * Get Award Method from Data Controller and format into a FAPI select input #options array. - * - * @return mixed - * Award method codes and award method names - */ -function _award_method_options() -{ - try { - $dataController = data_controller_get_instance(); - $data = $dataController->queryDataset('checkbook:award_method', array( - 'award_method_code', - 'award_method_name', - ), NULL, 'award_method_name'); - $results = _checkbook_datafeeds_award_method_options($data); - return $results; - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } -} - -/** - * Get the Award Method options, for IE8, the text will be shortened to fit the width and a title attribute is there - * - * @param $data - * @return mixed - */ -function _checkbook_datafeeds_award_method_options($data) -{ - - //IE8 - handle drop down width issue - $title = 'Select Award Method'; - $menu_options['No Award Method Selected'] = $title; - $menu_options_attributes = array($title => array('title' => $title)); - - foreach ($data as $row) { - $option = $row['award_method_name'] . ' [' . $row['award_method_code'] . ']'; - //Menu options - $menu_options[$option] = _ckbk_excerpt($option); - //Menu option titles - $menu_options_attributes[$option] = array('title' => $option); - } - $results['options'] = $menu_options; - $results['options_attributes'] = $menu_options_attributes; - return $results; -} - -/** - * Get Department from Data Controller and format into a FAPI select input #options array. - * - * @param $year - * Year - * - * @param $agency - * Agency code - * @return mixed Department codes and department names filtered by agency, year - * Department codes and department names filtered by agency, year - */ -function _budget_dept_options($year, $agency) -{ - $agency = emptyToZero(urldecode($agency)); - if ($agency) { - $agencystring = " agency_code = '" . $agency . "' "; - $yearstring = " AND budget_fiscal_year = " . $year . " "; - $query = "SELECT DISTINCT department_name || ' [' || department_code || ']' department_name FROM budget WHERE" - . $agencystring . $yearstring . "ORDER BY department_name ASC"; - $results = _checkbook_project_execute_sql($query); - if (is_countable($results) && count($results) > 0) { - foreach ($results as $result) { - $options[$result['department_name']] = $result['department_name']; - } - } - $matches = array(); - foreach ($options as $key => $value) - $matches[] = htmlentities($value); - drupal_json_output($matches); - } -} - -/** - * Get Expenditure Category from Data Controller and format into a FAPI select input #options array. - * - * @param $domain - * @param $year - * Year - * @param $agency - * Agency code - * @param $dept - * Department code - * @param $dataSource - * @param $feeds - * @return mixed Expenditure object codes and expenditure object names, filtered by agency, department, year - * Expenditure object codes and expenditure object names, filtered by agency, department, year - */ -function _budget_expcat_options($domain, $year, $agency, $dept, $dataSource = Datasource::CITYWIDE, $feeds = true){ - switch ($dataSource){ - case Datasource::NYCHA : - $query = "SELECT DISTINCT expenditure_type_description || ' [' || expenditure_type_code || ']' AS expenditure_object_code, - expenditure_type_id, expenditure_type_description - FROM {$domain} ORDER BY expenditure_object_code ASC"; - $results = _checkbook_project_execute_sql_by_data_source($query, $dataSource); - $title = ($domain == Domain::$REVENUE) ? 'Select Revenue Expense Category' : 'Select Expense Category'; - $options[''] = $title; - $option_attributes = array($title => array('title' => $title)); - foreach ($results as $row) { - if($feeds) { - $text = $row['expenditure_object_code']; - $option_attributes[$text] = array('title' => $text); - $options[$text] = _ckbk_excerpt($text); - }else{ - $text = $row['expenditure_type_description']; - $option_attributes[$row['expenditure_type_id']] = array('title' => $text); - $options[$row['expenditure_type_id']] = _ckbk_excerpt($text); - } - } - return array('options' => $options, 'option_attributes' => $option_attributes); - break; - default: - $agency = emptyToZero(urldecode($agency)); - $dept = emptyToZero(urldecode($dept)); - if ($agency) { - $agencyString = " agency_code = '" . $agency . "' "; - $yearString = ($year) ? " AND budget_fiscal_year = " . ltrim($year, 'FY') . " " : ""; - $deptString = ($dept) ? " AND department_code = '" . $dept . "' " : ""; - - $query = "SELECT DISTINCT object_class_name || ' [' || object_class_code || ']' expenditure_object_code FROM {$domain} WHERE" - . $agencyString . $yearString . $deptString . "ORDER BY expenditure_object_code ASC"; - $results = _checkbook_project_execute_sql_by_data_source($query, $dataSource); - $options = array(); - if (is_countable($results) && count($results) > 0) { - foreach ($results as $result) { - $options[$result['expenditure_object_code']] = $result['expenditure_object_code']; - } - } - $matches = array(); - foreach ($options as $key => $value) { - $matches[] = htmlentities($value); - } - drupal_json_output($matches); - } - } -} - -/** - * Get Program Phase from Data Controller and format into a FAPI select input #options array. - * @param $dataSource - * @param $feeds - * @return array of Program Phase data - */ -function _budget_program_options($dataSource = Datasource::CITYWIDE, $feeds = true){ - switch ($dataSource){ - case Datasource::NYCHA : - $query = "SELECT DISTINCT program_phase_description || ' [' || program_phase_code || ']' AS program, - program_phase_description, program_phase_id - FROM ref_program_phase WHERE program_phase_description NOT iLIKE '%default%' ORDER BY program ASC"; - $data = _checkbook_project_execute_sql_by_data_source($query, $dataSource); - $title = 'Select Program'; - $options[''] = $title; - $option_attributes = array($title => array('title' => $title)); - foreach ($data as $row) { - if($feeds) { - $text = $row['program']; - $option_attributes[$text] = array('title' => $text); - $options[$text] = _ckbk_excerpt($text); - }else{ - $text = $row['program_phase_description']; - $option_attributes[$row['program_phase_id']] = array('title' => $text); - $options[$row['program_phase_id']] = _ckbk_excerpt($text); - } - } - return array('options' => $options, 'option_attributes' => $option_attributes); - break; - } -} - -/** - * Get Program Phase from Data Controller and format into a FAPI select input #options array. - * @param $dataSource - * @return array of Program Phase data - */ -function _budget_project_options($dataSource = Datasource::CITYWIDE, $feeds = true){ - switch ($dataSource){ - case Datasource::NYCHA : - $query = "SELECT gl_project_description || ' [' || gl_project_code || ']' AS project, - gl_project_description, gl_project_id FROM ref_gl_project - WHERE gl_project_description NOT iLIKE '%Default%' ORDER BY gl_project_description ASC"; - $data = _checkbook_project_execute_sql_by_data_source($query, $dataSource); - $title = 'Select Project'; - $options[''] = $title; - $option_attributes[''] = array('title' => $title); - foreach ($data as $row) { - if($feeds) { - $text = $row['project']; - $option_attributes[$text] = array('title' => $text); - $options[$text] = _ckbk_excerpt($text); - }else{ - $text = $row['gl_project_description']; - $option_attributes[$row['gl_project_id']] = array('title' => $text); - $options[$row['gl_project_id']] = _ckbk_excerpt($text); - } - } - return array('options' => $options, 'option_attributes' => $option_attributes); - break; - } -} - -/** - * Get Budget Type from Data Controller and format into a FAPI select input #options array. - * @param $domain - * @param $dataSource - * @param $budgetName - * @param $json - * @return array of Budget Type data - */ -function _budget_type_options($domain, $dataSource = Datasource::CITYWIDE, $budgetName = null, $json = false){ - $budgetName = str_replace("__", "/", $budgetName); - switch ($dataSource){ - case Datasource::NYCHA : - $where = "WHERE budget_type IS NOT NULL"; - $where .= (isset($budgetName) && !in_array($budgetName, array('Select Budget Name', '', 0, '0'), true)) ? " AND budget_name = '". $budgetName ."' ":""; - $query = "SELECT DISTINCT budget_type FROM {$domain} {$where} ORDER BY budget_type ASC"; - $data = _checkbook_project_execute_sql_by_data_source($query, $dataSource); - $title = 'Select Budget Type'; - $options[''] = $title; - $option_attributes = array($title => array('title' => $title)); - $matches = array(); - foreach ($data as $row) { - $text = $row['budget_type']; - $option_attributes[$text] = array('title' => $text); - $options[$text] = _ckbk_excerpt($text); - $matches[] = array('value'=> $text, 'text'=> $options[$text]); - } - if($json) { - drupal_json_output($matches); - }else{ - return array('options' => $options, 'option_attributes' => $option_attributes); - } - break; - } -} - -/** - * Get Budget Name from Data Controller and format into a FAPI select input #options array. - * @param $dataSource - * @param $budgetType - * @param $json - * @return array of Budget Name data - */ -function _budget_name_options($domain, $dataSource = Datasource::CITYWIDE, $budgetType = null, $json = false){ - $budgetType = str_replace("__", "/", $budgetType); - switch ($dataSource){ - case Datasource::NYCHA : - $where = "WHERE budget_name IS NOT NULL"; - $where .= (isset($budgetType) && !in_array($budgetType, array('Select Budget Type', '', 0, '0'), true)) ? " AND budget_type = '". $budgetType ."' ":""; - $query = "SELECT DISTINCT budget_name FROM {$domain} {$where} ORDER BY budget_name ASC"; - $data = _checkbook_project_execute_sql_by_data_source($query, $dataSource); - $title = 'Select Budget Name'; - $options[''] = $title; - $option_attributes = array($title => array('title' => $title)); - $matches = array(); - foreach ($data as $row) { - $text = $row['budget_name']; - $option_attributes[$text] = array('title' => $text); - $options[$text] = _ckbk_excerpt($text); - $matches[] = array('value'=> $text, 'text'=> $options[$text]); - } - if($json) { - drupal_json_output($matches); - }else{ - return array('options' => $options, 'option_attributes' => $option_attributes); - } - break; - } -} -/** - * Get Department from Data Controller and format into a FAPI select input #options array. - * - * @param $agency - * Agency code - * @param $sc - * Spending category - * @param $year - * Year - * @param $data_source - * optional parameter to specify the data source (i.e. checkbook, checkbook_oge) - * - * @return array - * Department codes and department names filtered by agency, spending category, year - */ -function _dept_options($agency, $sc, $year, $data_source = null) -{ - switch ($data_source) { - case Datasource::OGE: - $agency = emptyToZero($agency); - $sc = emptyToZero($sc); - if ($year && startsWith($year, 'F')) { - $year = ltrim($year, 'FY'); - $yearstring = "AND disbursement_line_item_details.fiscal_year = '" . $year . "' "; - } elseif ($year && startsWith($year, 'C')) { - $year = ltrim($year, 'CY'); - $yearstring = "AND disbursement_line_item_details.calendar_fiscal_year = '" . $year . "' "; - } - if ($agency) { - $agencystring = "AND disbursement_line_item_details.agency_code = '" . $agency . "' "; - } - if ($sc) { - $scstring = "AND ref_spending_category.spending_category_code = '" . $sc . "' "; - } - $query = "SELECT DISTINCT department_name || ' [' || department_code || ']' department_name FROM disbursement_line_item_details, ref_spending_category WHERE disbursement_line_item_details.spending_category_id = ref_spending_category.spending_category_id " . $agencystring . $yearstring . $scstring . "ORDER BY department_name ASC"; - $data = _checkbook_project_execute_sql_by_data_source($query, $data_source); - $results = _checkbook_datafeeds_dept_options($data, $data_source); - break; - default: - $agency = emptyToZero($agency); - $sc = emptyToZero($sc); - if ($year && startsWith($year, 'F')) { - $year = ltrim($year, 'FY'); - $yearstring = "AND disbursement_line_item_details.fiscal_year = '" . $year . "' "; - } elseif ($year && startsWith($year, 'C')) { - $year = ltrim($year, 'CY'); - $yearstring = "AND disbursement_line_item_details.calendar_fiscal_year = '" . $year . "' "; - } - if ($agency) { - $agencystring = "AND disbursement_line_item_details.agency_code = '" . $agency . "' "; - } - if ($sc) { - $scstring = "AND ref_spending_category.spending_category_code = '" . $sc . "' "; - } - $query = "SELECT DISTINCT department_name || ' [' || department_code || ']' department_name FROM disbursement_line_item_details, ref_spending_category WHERE disbursement_line_item_details.spending_category_id = ref_spending_category.spending_category_id " . $agencystring . $yearstring . $scstring . "ORDER BY department_name ASC"; - $data = _checkbook_project_execute_sql($query); - $results = _checkbook_datafeeds_dept_options($data, $data_source); - break; - } - return $results; -} - -/** - * Get the department options, for IE8, the text will be shortened to fit the width and a title attribute is there - * @param $data - * @param null $data_source - * @return mixed - */ -function _checkbook_datafeeds_dept_options($data, $data_source = null) -{ - - //IE8 - handle drop down width issue - $title = 'Select Department'; - $menu_options[''] = $title; - $menu_options_attributes = array($title => array('title' => $title)); - - foreach ($data as $row) { - $option = $row['department_name']; - //Menu options - $menu_options[$option] = _ckbk_excerpt($option); - //Menu option titles - $menu_options_attributes[$option] = array('title' => $option); - } - $results['options'] = $menu_options; - $results['options_attributes'] = $menu_options_attributes; - return $results; -} - -/** - * Get Expenditure Category from Data Controller and format into a FAPI select input #options array. - * - * @param $agency - * Agency code - * @param $dept - * Department code - * @param $sc - * Spending category code - * @param $year - * Year - * - * @param null $data_source - * @return array - * Expenditure object codes and expenditure object names, filtered by agency, department, spending category, year - */ -function _expcat_options($agency, $dept, $sc, $year, $data_source = null) -{ - switch ($data_source) { - case Datasource::OGE: - $agency = emptyToZero($agency); - $dept = emptyToZero($dept); - $sc = emptyToZero($sc); - if ($year && startsWith($year, 'F')) { - $year = ltrim($year, 'FY'); - $yearstring = "AND disbursement_line_item_details.fiscal_year = '" . $year . "' "; - } elseif ($year && startsWith($year, 'C')) { - $year = ltrim($year, 'CY'); - $yearstring = "AND disbursement_line_item_details.calendar_fiscal_year = '" . $year . "' "; - } - if ($agency) { - $agencystring = "AND disbursement_line_item_details.agency_code = '" . $agency . "' "; - } - if ($sc) { - $scstring = "AND ref_spending_category.spending_category_code = '" . $sc . "' "; - } - if ($dept) { - $deptstring = "AND disbursement_line_item_details.department_code = '" . $dept . "' "; - } - $query = "SELECT DISTINCT expenditure_object_name|| '[' || expenditure_object_code || ']' expenditure_object_code - FROM disbursement_line_item_details, ref_spending_category - WHERE disbursement_line_item_details.spending_category_id = ref_spending_category.spending_category_id " - . $yearstring . $agencystring . $scstring . $deptstring . "ORDER BY expenditure_object_code ASC"; - $data = _checkbook_project_execute_sql_by_data_source($query, Datasource::OGE); - break; - - default: - $agency = emptyToZero($agency); - $dept = emptyToZero($dept); - $sc = emptyToZero($sc); - if ($year && startsWith($year, 'F')) { - $year = ltrim($year, 'FY'); - $yearstring = "AND disbursement_line_item_details.fiscal_year = '" . $year . "' "; - } elseif ($year && startsWith($year, 'C')) { - $year = ltrim($year, 'CY'); - $yearstring = "AND disbursement_line_item_details.calendar_fiscal_year = '" . $year . "' "; - } - if ($agency) { - $agencystring = "AND disbursement_line_item_details.agency_code = '" . $agency . "' "; - } - if ($sc) { - $scstring = "AND ref_spending_category.spending_category_code = '" . $sc . "' "; - } - if ($dept) { - $deptstring = "AND disbursement_line_item_details.department_code = '" . $dept . "' "; - } - $query = "SELECT DISTINCT expenditure_object_name|| '[' || expenditure_object_code || ']' expenditure_object_code - FROM disbursement_line_item_details, ref_spending_category - WHERE disbursement_line_item_details.spending_category_id = ref_spending_category.spending_category_id " - . $yearstring . $agencystring . $scstring . $deptstring . "ORDER BY expenditure_object_code ASC"; - $data = _checkbook_project_execute_sql($query); - break; - } - $results = _checkbook_datafeeds_expcat_options($data, $data_source); - return $results; -} - - -/** - * Get the expense category options, for IE8, the text will be shortened to fit the width and a title attribute is there - * @param $data - * @param null $data_source - * @return mixed - */ -function _checkbook_datafeeds_expcat_options($data, $data_source = null){ - //IE8 - handle drop down width issue - $title = 'Select Expense Category'; - $menu_options[''] = $title; - $menu_options_attributes = array($title => array('title' => $title)); - - foreach ($data as $row) { - $option = $row['expenditure_object_code']; - //Menu options - $menu_options[$option] = _ckbk_excerpt($option); - //Menu option titles - $menu_options_attributes[$option] = array('title' => $option); - } - $results['options'] = $menu_options; - $results['options_attributes'] = $menu_options_attributes; - return $results; -} - -/** - * Get mwbe category name and id using mapping - * - * Total M/WBE 2,3,4,5,7,9,11 - * Asian American 4,5 - * Black American 2 - * Women 9 - * Hispanic American 3 - * Emerging ? - * Non-M/WBE 7 - * Individuals and Others 11 - * @return array - */ -function _mwbe_category_options() -{ - $minority_cat_map = MappingUtil::getMinorityCategoryMappings(); - $results = array('' => 'Select Category'); - foreach ($minority_cat_map as $category => $minority_types) { - $results[implode('~', $minority_types)] = $category; - } - return $results; -} - -/** - * Get the industry type name and id using the data controller - * @param string $data_source - * @return array|void - */ -function _industry_options($data_source = Datasource::CITYWIDE) -{ - $industries = ['Select Industry']; - - $industry_id_column = 'industry_type_id'; - $industry_name_column = 'industry_type_name'; - if (Datasource::NYCHA == $data_source) { - $industry_id_column = 'industry_type_code'; - $industry_name_column = 'display_industry_type_name'; - } - - try { - $dataController = data_controller_get_instance(); - $industry_types = $dataController->queryDataset($data_source.':industry_type', array($industry_id_column, $industry_name_column), NULL, $industry_name_column); - foreach ($industry_types as $industry_type) { - $industries[$industry_type[$industry_name_column] . ' [' . $industry_type[$industry_id_column] . ']'] = $industry_type[$industry_name_column] . ' [' . $industry_type[$industry_id_column] . ']'; - } - } catch (Exception $e) { - log_error("Error getting data from controller: \n" . $e->getMessage()); - return; - } - - return $industries; -} - -/** - * Submit handler for Download Data button. - * - * @param array $form - * Data Feeds wizard form array - * @param array $form_state - * Data Feeds wizard form_state array - */ -function checkbook_datafeeds_confirmation_download_submit($form, &$form_state) -{ - $data = $form_state['step_information']['confirmation']['response']; - global $conf; - $query_records_limit = $conf['check_book']['data_feeds']['query_records_limit'] ?? 10000; - - //Store request in db - $criteria = $form_state['step_information']['confirmation']['stored_values']['criteria']; - unset($criteria['global']['max_records']); - $responsetype = $form_state['step_information']['type']['stored_values']['format']; - $searchCriteria = new QueueCriteria($criteria, $responsetype); - $user_criteria = $form_state['step_information']['confirmation']['stored_values']['user_criteria']; - $searchCriteria->setUserCriteria($user_criteria); - try { - $checkBookApi = new CheckBookAPI($searchCriteria); - } catch (Exception $e) { - drupal_set_message('An error occurred processing your request. Please try again later.', 'error'); - log_error($e->getMessage()); - } - - $record_count = $checkBookApi->getRecordCount(); - if ($record_count <= $query_records_limit) { - LogHelper::log_notice("DataFeeds :: <=" . $query_records_limit); - if (isset($checkBookApi)) { - if ($checkBookApi->validateRequest()) { - try { - //Make sure e-mail address is passed to the call. - $details = $checkBookApi->queueImmediateRequest(); - } catch (Exception $e) { - log_error($e->getMessage()); - } - } else { - log_error($checkBookApi->getErrorResponse()); - } - } - - if ($form_state['step_information']['type']['stored_values']['format'] == 'xml') { - drupal_add_http_header('Content-Type', 'text/xml; utf-8'); - drupal_add_http_header('Content-Disposition', 'attachment; filename="nyc-data-feed.xml"'); - echo $data; - module_invoke_all('exit'); - exit; - } elseif ($form_state['step_information']['type']['stored_values']['format'] == 'csv') { - drupal_add_http_header('Content-Type', 'text/csv; utf-8'); - drupal_add_http_header('Content-Disposition', 'attachment; filename="nyc-data-feed.csv"'); - echo $data; - module_invoke_all('exit'); - exit; - } - } else { - LogHelper::log_notice("DataFeeds :: >" . $query_records_limit); - if (isset($checkBookApi)) { - if ($checkBookApi->validateRequest()) { - try { - // Output file - $filename = $form_state['step_information']['confirmation']['filename']; - if ($filename) { - $checkBookApi->outputFile($filename); - } - } catch (Exception $e) { - log_error($e->getMessage()); - } - } else { - log_error($checkBookApi->getErrorResponse()); - } - } else { - LogHelper::log_notice("DataFeeds :: >" . $query_records_limit . " :: \$checkBookApi not set"); - } - module_invoke_all('exit'); - exit; - } -} - -/** - * Submit handler for Confirm button; queues a data request. - * - * @param array $form - * Data Feeds wizard form array - * @param array $form_state - * Data Feeds wizard form_state array - */ -function checkbook_datafeeds_confirmation_queue_submit($form, &$form_state) -{ - - $response_type = $form_state['step_information']['type']['stored_values']['format']; - $email = $form_state['values']['email_address']; - $criteria = $form_state['step_information']['confirmation']['stored_values']['criteria']; - - //Update Criteria with overridden column order on export only - $domain = strtolower($criteria['global']['type_of_data']); - //Contracts Only - if ($domain == 'contracts') { - $data_source = Datasource::CITYWIDE; - $category = $criteria['value']['category']; - $status = $criteria['value']['status']; - $year = $criteria['value']['fiscal_year']; - $intended_order = _checkbook_datafeeds_contracts_override_column_options($response_type, $data_source, $status, $category, $year); - $criteria['responseColumns'] = checkbook_datafeeds_override_column_order($criteria['responseColumns'], $intended_order); - } - - unset($criteria['global']['max_records']); - $searchCriteria = new QueueCriteria($criteria, $response_type); - $user_criteria = $form_state['step_information']['confirmation']['stored_values']['user_criteria']; - $searchCriteria->setUserCriteria($user_criteria); - - - try { - $checkBookApi = new CheckBookAPI($searchCriteria); - } catch (Exception $e) { - drupal_set_message('An error occurred processing your request. Please try again later.', 'error'); - log_error($e->getMessage()); - } - if (isset($checkBookApi)) { - if ($checkBookApi->validateRequest()) { - try { - //Make sure e-mail address is passed to the call. - $details = $checkBookApi->queueRequest($email); - } catch (Exception $e) { - log_error($e->getMessage()); - } - } else { - log_error($checkBookApi->getErrorResponse()); - } - } - $current_step = &$form_state['step']; - $form_state['step_information']['queue']['stored_values'] = $form_state['values']; - if ($details) { - $form_state['step_information']['queue']['stored_values']['details'] = $details; - } - $current_step = 'queue_final'; - if (!empty($form_state['step_information'][$current_step]['stored_values'])) { - $form_state['values'] = $form_state['step_information'][$current_step]['stored_values']; - } else { - $form_state['values'] = array(); - } - $form_state['rebuild'] = TRUE; // Force rebuild with next step. -} - -/** - * Final confirmation page after queueing a request. - * - * @param array $form - * Data Feeds wizard form array - * @param array $form_state - * Data Feeds wizard form_state array - * - * @return array - * Renderable array confirming request has been queued - */ -function checkbook_datafeeds_queue_final($form, &$form_state) -{ - drupal_set_title('Thank You'); - $email = $form_state['step_information']['queue']['stored_values']['email_address']; - $token = $form_state['step_information']['queue']['stored_values']['details']['token']; - $status = $form_state['step_information']['queue']['stored_values']['details']['status']; - if ($email) { - $email_message = 'Thank You

Your request has been received.

You will receive a confirmation email for the request created at ' . $email . ' with the tracking number. You will also receive another email with the link to download the data feed once the request is completed.

Please note that due to a possible high number of requests, there may be a delay in notification.

You can track the status of your request by entering your tracking number: ' . $token . ' in the "Track Status of Data Feed" box on this page.

You will have 7 days to use this tracking number to return to your results.

'; - $form['text'] = array( - '#markup' => $email_message . checkbook_datafeeds_get_confirmation_search_criteria_message($form_state), - ); - if ($status == '2') { - $request = QueueUtil::getPendingEmailInfo($token); - global $conf; - $dir = variable_get('file_public_path', 'sites/default/files') - . '/' . $conf['check_book']['data_feeds']['output_file_dir']; - - $file = $dir . '/' . $request[0]['filename']; - $params = array( - "download_url" => $file, - "download_url_compressed" => $file . '.zip', - "expiration_date" => date('d-M-Y', $request[0]['end_time'] + 3600 * 24 * 7), - "contact_email" => $request[0]['contact_email'], - "tracking_num" => $request[0]['token'], - ); - LogHelper::log_debug($params); - $response = drupal_mail('checkbook_datafeeds', "download_notification", $request[0]['contact_email'], NULL, $params); - LogHelper::log_debug($response); - if ($response['result']) { - QueueUtil::updateJobRequestEmailStatus($request[0]['rid']); - } - } - } else { - $email_message = 'Thank You

Your request has been received.

You can track the status of your request by entering your tracking number ' . $token . ' in the "Track Status of Data Feed" box on this page.

Please note that due to a possible high number of requests, there may be delay in notification.

You will have 7 days to use this tracking number to return to your results.

'; - $form['text'] = array( - '#markup' => $email_message . checkbook_datafeeds_get_confirmation_search_criteria_message($form_state), - ); - } - return $form; -} - -/** - * Function will parse the form the get the search criteria text to show in the confirmation screens/email - * - * @param $form_state - * @return string - */ -function checkbook_datafeeds_get_confirmation_search_criteria_message($form_state) -{ - - $formatted_search_criteria = $form_state['step_information']['confirmation']['stored_values']['user_criteria']['Formatted']; - - $message = 'Below is the search criteria of your request for your reference:
'; - foreach ($formatted_search_criteria as $key => $value) { - $message .= "{$key}: {$value}
"; - } - return $message; -} - - -/** - * A function used in range parameters to replace empty values with NULL. - * - * @param string $value - * - * @return null - */ -function checknull($value) -{ - if ($value === '') { - $value = NULL; - } - return $value; -} - -/** - * Submit handler for Previous button on second step of wizard; returns the user to first page of wizard. - * - * @param array $form - * Data Feeds wizard form array - * @param array $form_state - * Data Feeds wizard form_state array - */ -function previous_submit($form, &$form_state) -{ - $current_step = &$form_state['step']; - $form_state['step_information'][$current_step]['stored_values'] = $form_state['values']; - $current_step = 'type'; - $form_state['values'] = $form_state['step_information'][$current_step]['stored_values']; - $form_state['rebuild'] = TRUE; -} - -/** - * Generates the end of a confirmation page based on number of results returned by API. - * - * @param $form - * Data Feeds wizard form array - * @param $form_state - * Data Feeds wizard form_state array - * @param $criteria - * Search criteria - * @param $responsetype - * Response type (csv or xml) - * @param $domain - * Domain - * - * @return array - * Renderable array of results from Data Controller request - */ -function checkbook_datafeeds_end_of_confirmation_form($form, &$form_state, $criteria, $responsetype, $domain) -{ - $searchCriteria = new SearchCriteria($criteria, $responsetype); - global $conf; - $query_records_limit = $conf['check_book']['data_feeds']['query_records_limit'] ?? 10000; - $max_record_limit = $conf['check_book']['data_feeds']['max_record_limit'] ?? 200000; - - try { - $checkBookApi = new CheckBookAPI($searchCriteria); - } catch (Exception $e) { - drupal_set_message('An error occurred processing your request. Please try again later.', 'error'); - log_error($e->getMessage()); - } - if (isset($checkBookApi)) { - if ($checkBookApi->validateRequest()) { - $recordcount = $checkBookApi->getRecordCount(); - } else { - drupal_set_message('An error occurred.', 'error'); - log_error($checkBookApi->getErrorResponse()); - } - } - if ($recordcount == 0) { - $form['count'] = array( - '#type' => 'fieldset', - ); - $form['count']['no_records'] = array( - '#markup' => 'There are no records for the search criteria.', - ); - $form['start_over'] = array( - '#type' => 'submit', - '#value' => t('Cancel'), - ); - } elseif ($recordcount > 0 && $recordcount < $max_record_limit) { - /** - * see docs - * http://wiki.reisys.com:8080/display/USASv2/Data+Feeds+Documentation - */ - if (isset($checkBookApi)) { - if ($checkBookApi->validateRequest()) { - if ($recordcount <= $query_records_limit) { - LogHelper::log_notice("DataFeeds :: <=" . $query_records_limit . " :: generatingData()"); - $form_state['step_information']['confirmation']['response'] = $checkBookApi->getData(); - } else { - LogHelper::log_notice("DataFeeds :: >" . $query_records_limit . " :: generatingFile()"); - $filename = $checkBookApi->generateFile(); - $form_state['step_information']['confirmation']['filename'] = $filename; - } - } else { // invalid request - $form_state['step_information']['confirmation']['response'] = $checkBookApi->getErrorResponse(); - } - } - $form['count'] = array( - '#markup' => '
There are ' . number_format($recordcount) . ' records for the selected filter criteria.
', - ); - $form['prev'] = array( - '#type' => 'submit', - '#value' => t('Previous'), - '#name' => 'prev', - '#submit' => array('checkbook_datafeeds_' . $domain . '_confirmation_previous_submit'), - '#limit_validation_errors' => array(), - ); - $form['download'] = array( - '#type' => 'submit', - '#value' => t('Download Data'), - '#submit' => array('checkbook_datafeeds_confirmation_download_submit'), - ); - $form['cancel'] = array( - '#type' => 'submit', - '#value' => t('Cancel'), - ); - } else { // > 200,000 - $form_state['step_information']['confirmation']['stored_values']['user_criteria']['Record Count'] = $recordcount; - $form['count'] = array( - '#type' => 'fieldset', - ); - $form['count']['count_message'] = array( - '#markup' => '

Please note this request has ' . number_format($recordcount) . ' transactions. It will be queued to be generated in the background.

If you decide to proceed, please confirm the transaction below. Upon confirmation, a tracking number will be generated for the user to track the status of the request.

', - ); - $form['email'] = array( - '#type' => 'fieldset', - ); - $form['email']['email_text'] = array( - '#markup' => '

You can also provide your e-mail address for notification when the data is ready to be downloaded. Please note, providing email address is optional.

', - ); - $form['email']['email_address'] = array( - '#type' => 'textfield', - '#title' => 'Enter E-mail:', - ); - $form['prev'] = array( - '#type' => 'submit', - '#value' => t('Previous'), - '#name' => 'prev', - '#submit' => array('checkbook_datafeeds_' . $domain . '_confirmation_previous_submit'), - '#limit_validation_errors' => array(), - ); - $form['confirm'] = array( - '#type' => 'submit', - '#value' => t('Confirm'), - '#validate' => array('checkbook_datafeeds_validate_queue'), - '#submit' => array('checkbook_datafeeds_confirmation_queue_submit'), - ); - $form['cancel'] = array( - '#type' => 'submit', - '#value' => t('Cancel'), - ); - } - return $form; -} - -/** - * Validates an email before adding to a queue request. - * - * @param array $form - * Data Feeds wizard form array - * @param array $form_state - * Data Feeds wizard form_state array - */ -function checkbook_datafeeds_validate_queue($form, &$form_state) -{ - if ($form_state['values']['email_address']) { - $valid = valid_email_address($form_state['values']['email_address']); - if (!$valid) { - form_set_error('email_address', 'E-mail address is not valid. Please enter a valid email address'); - } - } -} - -/** - * Convert bytes to human-readable amounts. - * - * @param int $bytes - * Number of bytes - * - * @return string - * Formatted human readable number of bytes - */ -function format_bytes($bytes) -{ - if ($bytes == 0) { - return '0 B'; - } elseif ($bytes < 1024) { - return $bytes . ' B'; - } elseif ($bytes < 1048576) { - return round($bytes / 1024, 2) . ' kB'; - } elseif ($bytes < 1073741824) { - return round($bytes / 1048576, 2) . ' MB'; - } elseif ($bytes < 1099511627776) { - return round($bytes / 1073741824, 2) . ' GB'; - } else { - return round($bytes / 1099511627776, 2) . ' TB'; - } -} - -/** - * Check whether a date is valid using RegEx - * - * @param string $date - * Date string - * - * @return bool - * TRUE if valid, FALSE if not - */ -function checkDateFormat($date) -{ - // Match the format of the date: - if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $date, $parts)) { - // Check whether the date is valid: - if (checkdate($parts[2], $parts[3], $parts[1])) { - return TRUE; - } else { - return FALSE; - } - } else { - return FALSE; - } -} - -/** - * Maintains the selected column order - * - * @param null $domain - * @param null $data_source - * @return array - * re-ordered columns - */ -function checkbook_datafeeds_format_columns($domain = null, $data_source = null) -{ - //Used to maintain the order of the columns - $hidden_selected_values = $_POST['hidden_multiple_value']; //get the values from the hidden field - if ($domain == Domain::$CONTRACTS && $data_source == Datasource::NYCHA) { - $year = $_POST['nycha_year']; - } else { - $year = $_POST['year']; - } - if ($year == 'ALL') { - if (strpos($hidden_selected_values, "|year|")) { - $hidden_selected_values = str_replace("|year|", "", $hidden_selected_values); - } - if (strpos($hidden_selected_values, "|Year|")) { - $hidden_selected_values = str_replace("|Year|", "", $hidden_selected_values); - } - } - - $cevent = $_POST['catastrophic_event']; - $year_value = explode('FY', $year); - if ($domain == Domain::$CONTRACTS && $data_source == Datasource::CITYWIDE) { - if ($cevent === '0' && ($year != '0' || $year_value[1] <= 2020)) { - - if (strpos($hidden_selected_values, "|MOCS Registered|")) { - $hidden_selected_values = str_replace("|MOCS Registered|", "", $hidden_selected_values); - } - if (strpos($hidden_selected_values, "|mocs_registered|")) { - $hidden_selected_values = str_replace("|mocs_registered|", "", $hidden_selected_values); - } - } - } - - if($domain == Domain::$SPENDING && $data_source == 'citywide'){ - $hidden_selected_values = checkbook_datafeeds_spending_reset_selected_columns($hidden_selected_values, $cevent, $year, $year_value); - } - - $array_selected_values = explode("|", $hidden_selected_values); //convert the values into array - $filter_array = array_filter($array_selected_values); //remove empty index - - $selected_columns = array(); - foreach ($filter_array as $column) { - $selected_columns[$column] = $column; - } - return $selected_columns; -} - -/* - * Function to hook into link to download the zip file for the data feeds from the server. - * Used to track number of users that have downloaded the file. - */ -/** - * @param $token - * @return null - */ -function checkbook_datafeeds_download_zip_ajax($token) -{ - QueueUtil::incrementDownloadCount($token); - return null; -} - -/** - * Output download links and expiration date message. - * - * @param array $results - * Result from tracking page request - * - * @return array - * Renderable array that outputs file paths and expiration dates - */ -function checkbook_datafeeds_file_download_page($results) -{ - global $conf; - $datestamp = strtotime($results['file_generated_time'] . ' + 1 week'); - $expiration = date('F j, Y g:ia', $datestamp); - $output = array(); - $output['status-fieldset'] = array( - '#type' => 'fieldset', - ); - $filesize = filesize($results['file_path']); - $file_name = $conf['check_book']['data_feeds']['site_url'] . '/' . $results['file_path']; - $output['status-fieldset']['uncompressed'] = array( - '#markup' => 'Status:
The file is ready for download: ' . $file_name . ' (' . format_bytes($filesize) . ')', - '#prefix' => '

', - '#suffix' => '

', - ); - $output['status-fieldset']['available_date'] = array( - '#markup' => 'Your files will be available until ' . $expiration, - '#prefix' => '

', - '#suffix' => '

', - ); - return $output; -} - -/** - * Implementation of hook_mail(). - * @param $key - * @param $message - * @param $params - */ -function checkbook_datafeeds_mail($key, &$message, $params) -{ - switch ($key) { - case "download_notification": - checkbook_datafeeds_download_notification($key, $message, $params); - break; - case "confirmation_notification": - checkbook_datafeeds_confirmation_notification($key, $message, $params); - break; - } -} - -/** - * Function to implement the hook_mail function for data feeds download email notification - * @param $key - * @param $message - * @param $params - */ -function checkbook_datafeeds_download_notification($key, &$message, $params) -{ - global $conf; - $user_criteria = $params['user_criteria']; - $search_criteria = ""; - foreach ($user_criteria['Formatted'] as $key => $value) { - $search_criteria .= "{$key}: {$value} \t\r\n"; - } - $variables['@tracking_num'] = $params['tracking_num']; - $variables['@expiration_date'] = $params['expiration_date']; - $variables['@download_link'] = $conf['check_book']['data_feeds']['site_url'] . "/" . "track-data-feed?code=" . $params['tracking_num']; - $variables['@search_criteria'] = $search_criteria; - - $message['subject'] = "Your requested file is ready for download"; - $message['body'][] = t(" -Your data feed is ready to download. Please click the following link to download the results: \n -@download_link \n -The file is available to download until @expiration_date \n -You had provided your email address at Checkbook NYC for notification when the data feed with the tracking number @tracking_num was ready to be downloaded. \n -Below is the search criteria of the request for your reference: -@search_criteria", $variables); - -} - -/** - * Function to implement the hook_mail function for data feeds confirmation email notification - * @param $key - * @param $message - * @param $params - */ -function checkbook_datafeeds_confirmation_notification($key, &$message, $params) -{ - $user_criteria = $params['user_criteria']; - $search_criteria = ""; - foreach ($user_criteria['Formatted'] as $key => $value) { - $search_criteria .= "{$key}: {$value} \t\r\n"; - } - $email = $params['email']; - if (filter_var($email, FILTER_VALIDATE_EMAIL)) { - - $tracking_number = $params['tracking_number']; - - $body = "Thank You \n\nYour request has been received. \n\n"; - $body .= "Here is the tracking number: {$tracking_number} for the request. You can track the status of your request by entering your tracking number in the \"Track Status of Data Feed\" box on Data feeds page. \n\n"; - - global $conf; - if (isset($conf['check_book']['data_feeds']['site_url'])) { - $download_link = $conf['check_book']['data_feeds']['site_url'] . "/" . "track-data-feed?code=" . $tracking_number; - $body .= "Or just use this direct url: \n{$download_link} \n\n"; - } - $body .= "You will have 7 days to use this tracking number to return to your results. \n\n"; - $body .= "You will receive another email at {$email} when requested data feed is ready. \n\n"; - $body .= "Please note that due to a possible high number of requests, there may be a delay in notification. \n\n"; - $body .= "Below is the search criteria of the request for your reference: \n{$search_criteria} \n"; - - $message['subject'] = "Your data feeds request is submitted"; - $message['body'][] = $body; - } -} - -/** - * Gets the created date for records within a domain to display at the top of Data Feeds page. - * - * @param string $domain - * Domain - * - * @return string - * Formatted date from domain's created_date column - */ -function _checkbook_datafeeds_get_updated_date($domain) -{ - switch ($domain) { - case 'spending': - $query = ('SELECT MAX(COALESCE(created_date)) FROM {disbursement}'); - break; - - case 'contracts': - $query = ('SELECT MAX(COALESCE(created_date)) FROM {history_agreement}'); - break; - - case 'payroll': - $query = ('SELECT MAX(COALESCE(created_date)) FROM {payroll}'); - break; - case 'budget': - $query = ('SELECT MAX(COALESCE(updated_date, created_date)) FROM {budget}'); - break; - case 'revenue': - $query = ('SELECT MAX(COALESCE(last_modified_date)) FROM {revenue_details}'); - break; - } - $results = _checkbook_project_execute_sql($query); - $max = $results[0]['max']; - $date = date('F j, Y h:ia', strtotime($max)); - return $date; -} diff --git a/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.info b/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.info deleted file mode 100644 index 5c23e75c92..0000000000 --- a/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.info +++ /dev/null @@ -1,30 +0,0 @@ - -; This file is part of the Checkbook NYC financial transparency software. -; -; Copyright (C) 2012, 2013 New York City -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU Affero General Public License as -; published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. -; -; You should have received a copy of the GNU Affero General Public License -; along with this program. If not, see . -; Copyright 2009-2011 United States Government. -; -name = "Checkbook ETL Status Mailing" -description = "Module to email ETL Status every morning" -php = 7.2 -package = NYC Checkbook -core = 7.x -dependencies[] = checkbook_mail_system - -files[] = includes/CheckbookEtlStatus.class.php -files[] = includes/AbstractEtlStatus.class.php -files[] = includes/ProdEtlStatus.class.php -files[] = includes/UatEtlStatus.class.php diff --git a/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.install b/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.install deleted file mode 100644 index ecd8adf599..0000000000 --- a/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.install +++ /dev/null @@ -1,19 +0,0 @@ - 'DefaultMailSystem')); - if (!isset($current['checkbook_etl_status'])){ - $addition = array('checkbook_etl_status' => 'CheckbookMailSystem'); - variable_set('mail_system', array_merge($current, $addition)); - } - } -} - -function checkbook_etl_status_disable() { - $mail_system = variable_get('mail_system', array('default-system' => 'DefaultMailSystem')); - if (isset($mail_system['checkbook_etl_status'])){ - unset($mail_system['checkbook_etl_status']); - variable_set('mail_system', $mail_system); - } -} diff --git a/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.module b/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.module deleted file mode 100644 index 403e17a6f1..0000000000 --- a/source/webapp/sites/all/modules/custom/checkbook_etl_notification/checkbook_etl_status.module +++ /dev/null @@ -1,78 +0,0 @@ -run_cron(); -} - -/** - * Implements hook_mail(). - * - * @param $key - * @param $message - * @param $params - * @throws \MongoDB\Exception\InvalidArgumentException - * @throws \MongoDB\Exception\UnsupportedException - */ -function checkbook_etl_status_mail($key, &$message, $params) -{ - $CES = new CheckbookEtlStatus(); - $CES->gatherData($message); - - $message['body'] = array_merge($message['body'], $params); -} - -/** - * Implements hook_mail_alter(). - * - * Adds priority headers to messages passing condition. - * @param $message - * @throws Exception - */ -function checkbook_etl_status_mail_alter(&$message) -{ - // Apply this hook only for `checkbook_etl_status` module - if ('checkbook_etl_status' !== $message['module']) { - return; - } - if (stripos($message['subject'], 'Fail')) { - $message['headers']['X-Priority'] = '1 (Highest)'; - $message['headers']['X-MSMail-Priority'] = 'High'; - $message['headers']['Importance'] = 'High'; - } - $message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes'; - $message['body'] = theme('etl_status_email', $message['body']); - if (defined('CHECKBOOK_DEV')) { - echo($message['body']); - $message['send'] = false; - } -} - -/** - * Implements hook_theme() - * @param $existing - * @param $type - * @param $theme - * @param $path - * @return array - */ -function checkbook_etl_status_theme($existing, $type, $theme, $path) -{ - if ($type == 'module') { - return array( - 'etl_status_email' => array( - 'variables' => array( - 'uat_status' => NULL, - 'prod_status' => NULL, - ), - 'template' => 'etl-status.email', - 'path' => drupal_get_path('module', 'checkbook_etl_status') . '/theme', - ), - ); - } -} - diff --git a/source/webapp/sites/all/modules/custom/checkbook_faceted_search/smart_search_filter.tpl.php b/source/webapp/sites/all/modules/custom/checkbook_faceted_search/smart_search_filter.tpl.php deleted file mode 100644 index ea4b5cddcd..0000000000 --- a/source/webapp/sites/all/modules/custom/checkbook_faceted_search/smart_search_filter.tpl.php +++ /dev/null @@ -1,242 +0,0 @@ -. - */ - -/** - * @file - * Template file to output the "Narrow Down Your Search" sidebar for Smart Search - * - * Available variables: - * $facets - * $active_contracts - * $theme_hook_suggestions - * $zebra - * $id - * $directory - * $classes_array - * $attributes_array - * $title_attributes_array - * $content_attributes_array - * $title_prefix - * $title_suffix - * $user - * $db_is_active - * $is_admin - * $logged_in - * $is_front - * $render_array - * $facets_render - */ -?> - -
-
Narrow Down Your Search:
- $facet) { - - // skipping children (sub facets) - if ($facet->child??false){ - continue; - } - - $selected_facet_results['contract_status'] = is_array($selected_facet_results['contract_status']) ? $selected_facet_results['contract_status'] : []; - if(in_array('registered', $selected_facet_results['contract_status']) && strtolower($facet_name) == 'facet_year_array'){ - continue; - } - if(!in_array('registered', $selected_facet_results['contract_status']) && strtolower($facet_name) == 'registered_fiscal_year'){ - continue; - } - - // Donot display future year in the fiscal year facet - $current_year = CheckbookDateUtil::getMaxDatasourceFiscalYear(Datasource::smartSearchDataSource()); - if(strtolower($facet_name) == 'facet_year_array'){ - foreach($facet->results as $fvalue => $fcount) { - if ($fvalue > $current_year) { - unset($facet->results[$fvalue]); - } - } - } - - $span=''; - $display_facet = 'none'; - - // keep domain facet always open - if ($facet->selected || in_array($facet_name,['domain'])) { - $span = 'open'; - $display_facet = 'block'; - if($solr_datasource == Datasource::SOLR_NYCHA){ - foreach($facet->results as $facet_value => $count){ - if(strtolower($facet_value) == 'budget' || strtolower($facet_value) == 'revenue'){ - unset($facet->results[$facet_value]); - } - } - } - } - - echo '
'; - echo '
By ' . htmlentities($facet->title) . '
'; - echo '
'; - - if ($facet->autocomplete && sizeof($facet->results)>9) { - $autocomplete_id = "autocomplete_" . $facet_name; - $disabled = ''; - - // Autocomplete's result(s) displays and allows to select options that are already selected - // thereby counting an option twice. Hence, removing duplicates - $facet->selected = array_unique($facet->selected?:[]); - - //NYCCHKBK-9957 : Disable autocomplete search box if 5 or more options are selected - $no_of_selected_options = count($facet->selected ?: []); - if($no_of_selected_options >= 5) $disabled = " DISABLED=true"; - - echo '
- -
'; - } - - echo '
'; - echo '
    '; - $index = 0; - $lowercase_selected = []; - if($facet->selected){ - foreach($facet->selected as $facet_val){ - $lowercase_selected[strtolower($facet_val)] = strtolower($facet_val); - } - } - - foreach($facet->results as $facet_value => $count) { - - $facet_result_title = $facet_value; - if (is_array($count)) { - list($facet_result_title, $count) = $count; - } - - $id = 'facet_'.$facet_name.$index; - $active=''; - echo << - '; - echo ''; - - if (($checked) && ($children = $facet->sub->$facet_value??false)){ - $sub_index=0; - foreach($children as $child){ - $sub_facet = $facets_render[$child]; - if (!$sub_facet) { - continue; - } - - $sub_facet_name = $child; - echo '
      '; - echo '
      By '.htmlentities($sub_facet->title).'
      '; - //Set Active and Registered Contracts Counts - if($sub_facet_name == 'contract_status'){ - unset($sub_facet->results['registered']); - unset($sub_facet->results['active']); - if($registered_contracts > 0 ) { - $sub_facet->results['registered'] = $registered_contracts; - } - if($active_contracts > 0) { - $sub_facet->results['active'] = $active_contracts; - } - } - - foreach($sub_facet->results as $sub_facet_value => $sub_count){ - - $facet_result_title = $sub_facet_value; - if (is_array($sub_count)) { - list($facet_result_title, $sub_count) = $sub_count; - } - - $id = 'facet_'.$sub_facet_name.$sub_index; - $active=''; - echo '
    • '; - echo "'; - - echo '
    • '; - $sub_index++; - } - echo '
    '; - } - } - - $index++; - } - - echo '
'; - - echo '
'; -} -?> -
diff --git a/source/webapp/sites/all/themes/checkbook3/templates/html.tpl.php b/source/webapp/sites/all/themes/checkbook3/templates/html.tpl.php deleted file mode 100644 index e1886cf5e5..0000000000 --- a/source/webapp/sites/all/themes/checkbook3/templates/html.tpl.php +++ /dev/null @@ -1,26 +0,0 @@ - -> - - - Checkbook NYC - - - - - - -> -
-'; ?> - - - - - -'; ?> -
- -