diff --git a/composer.json b/composer.json index ce80ed346e32fdb1721ecf27c6ff1c908825c002..377d379cc20a00faddadf1704782d6b69222205e 100644 --- a/composer.json +++ b/composer.json @@ -105,7 +105,6 @@ "drupal/field_group": "1.0-rc6", "drupal/field_permissions": "1.0-beta1", "drupal/file_browser": "1.1", - "drupal/flexslider": "2.0-alpha2", "drupal/focal_point": "1.0-beta6", "drupal/geocoder_autocomplete": "1.0", "drupal/geolocation": "1.10", diff --git a/composer.lock b/composer.lock index 1db7128db87f6b534a459e49f8aabf3ec8f37460..1a7fe73dd3442f2d4b618e63e1ca62af395dfe97 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "19661f5585fdcbb220585ac641e5c874", + "content-hash": "89b4ef6f0837bccbb92d29d747661c46", "packages": [ { "name": "alchemy/zippy", @@ -4031,74 +4031,6 @@ "source": "http://cgit.drupalcode.org/file_browser" } }, - { - "name": "drupal/flexslider", - "version": "2.0.0-alpha2", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/flexslider", - "reference": "8.x-2.0-alpha2" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/flexslider-8.x-2.0-alpha2.zip", - "reference": "8.x-2.0-alpha2", - "shasum": "4f33c8752e389fddd14264e5cc289776405c74c1" - }, - "require": { - "drupal/core": "*", - "drupal/libraries": "*" - }, - "require-dev": { - "drupal/flexslider_fields": "*", - "drupal/flexslider_views": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, - "drupal": { - "version": "8.x-2.0-alpha2", - "datestamp": "1492020545", - "security-coverage": { - "status": "not-covered", - "message": "Project has not opted into security advisory coverage!" - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "ClassicCut", - "homepage": "https://www.drupal.org/user/2703101" - }, - { - "name": "amaria", - "homepage": "https://www.drupal.org/user/66428" - }, - { - "name": "minorOffense", - "homepage": "https://www.drupal.org/user/129088" - }, - { - "name": "ryanwebpage", - "homepage": "https://www.drupal.org/user/737596" - }, - { - "name": "spotzero", - "homepage": "https://www.drupal.org/user/657848" - } - ], - "description": "Integrate the FlexSlider 2 library with Drupal", - "homepage": "https://www.drupal.org/project/flexslider", - "support": { - "source": "http://cgit.drupalcode.org/flexslider" - } - }, { "name": "drupal/focal_point", "version": "1.0.0-beta6", @@ -4646,67 +4578,6 @@ "source": "http://cgit.drupalcode.org/layout_plugin" } }, - { - "name": "drupal/libraries", - "version": "3.0.0-alpha1", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/libraries", - "reference": "8.x-3.0-alpha1" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/libraries-8.x-3.0-alpha1.zip", - "reference": "8.x-3.0-alpha1", - "shasum": "bb07036b1eaeea7d736fc7e72416238830cd8d67" - }, - "require": { - "drupal/core": "~8.0" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-3.x": "3.x-dev" - }, - "drupal": { - "version": "8.x-3.0-alpha1", - "datestamp": "1517046484", - "security-coverage": { - "status": "not-covered", - "message": "Alpha releases are not covered by Drupal security advisories." - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "Pol", - "homepage": "https://www.drupal.org/user/47194" - }, - { - "name": "rjacobs", - "homepage": "https://www.drupal.org/user/422459" - }, - { - "name": "sun", - "homepage": "https://www.drupal.org/user/54136" - }, - { - "name": "tstoeckler", - "homepage": "https://www.drupal.org/user/107158" - } - ], - "description": "Allows version-dependent and shared usage of external libraries in Drupal.", - "homepage": "http://drupal.org/project/libraries", - "support": { - "source": "http://cgit.drupalcode.org/libraries", - "issues": "http://drupal.org/project/issues/libraries", - "irc": "irc://irc.freenode.org/drupal-contribute" - } - }, { "name": "drupal/link_attributes", "version": "1.0.0", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 5b690a4907627ad4c1fc8f5c33c4243417ee680c..1d0075297de365f30a3733fe4ca9e2ebc83efbb3 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -4152,76 +4152,6 @@ "source": "http://cgit.drupalcode.org/file_browser" } }, - { - "name": "drupal/flexslider", - "version": "2.0.0-alpha2", - "version_normalized": "2.0.0.0-alpha2", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/flexslider", - "reference": "8.x-2.0-alpha2" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/flexslider-8.x-2.0-alpha2.zip", - "reference": "8.x-2.0-alpha2", - "shasum": "4f33c8752e389fddd14264e5cc289776405c74c1" - }, - "require": { - "drupal/core": "*", - "drupal/libraries": "*" - }, - "require-dev": { - "drupal/flexslider_fields": "*", - "drupal/flexslider_views": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, - "drupal": { - "version": "8.x-2.0-alpha2", - "datestamp": "1492020545", - "security-coverage": { - "status": "not-covered", - "message": "Project has not opted into security advisory coverage!" - } - } - }, - "installation-source": "dist", - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "ClassicCut", - "homepage": "https://www.drupal.org/user/2703101" - }, - { - "name": "amaria", - "homepage": "https://www.drupal.org/user/66428" - }, - { - "name": "minorOffense", - "homepage": "https://www.drupal.org/user/129088" - }, - { - "name": "ryanwebpage", - "homepage": "https://www.drupal.org/user/737596" - }, - { - "name": "spotzero", - "homepage": "https://www.drupal.org/user/657848" - } - ], - "description": "Integrate the FlexSlider 2 library with Drupal", - "homepage": "https://www.drupal.org/project/flexslider", - "support": { - "source": "http://cgit.drupalcode.org/flexslider" - } - }, { "name": "drupal/focal_point", "version": "1.0.0-beta6", @@ -4789,69 +4719,6 @@ "source": "http://cgit.drupalcode.org/layout_plugin" } }, - { - "name": "drupal/libraries", - "version": "3.0.0-alpha1", - "version_normalized": "3.0.0.0-alpha1", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/libraries", - "reference": "8.x-3.0-alpha1" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/libraries-8.x-3.0-alpha1.zip", - "reference": "8.x-3.0-alpha1", - "shasum": "bb07036b1eaeea7d736fc7e72416238830cd8d67" - }, - "require": { - "drupal/core": "~8.0" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-3.x": "3.x-dev" - }, - "drupal": { - "version": "8.x-3.0-alpha1", - "datestamp": "1517046484", - "security-coverage": { - "status": "not-covered", - "message": "Alpha releases are not covered by Drupal security advisories." - } - } - }, - "installation-source": "dist", - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "Pol", - "homepage": "https://www.drupal.org/user/47194" - }, - { - "name": "rjacobs", - "homepage": "https://www.drupal.org/user/422459" - }, - { - "name": "sun", - "homepage": "https://www.drupal.org/user/54136" - }, - { - "name": "tstoeckler", - "homepage": "https://www.drupal.org/user/107158" - } - ], - "description": "Allows version-dependent and shared usage of external libraries in Drupal.", - "homepage": "http://drupal.org/project/libraries", - "support": { - "source": "http://cgit.drupalcode.org/libraries", - "issues": "http://drupal.org/project/issues/libraries", - "irc": "irc://irc.freenode.org/drupal-contribute" - } - }, { "name": "drupal/link_attributes", "version": "1.0.0", diff --git a/web/modules/flexslider/.gitignore b/web/modules/flexslider/.gitignore deleted file mode 100644 index e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store diff --git a/web/modules/flexslider/LICENSE.txt b/web/modules/flexslider/LICENSE.txt deleted file mode 100644 index d159169d1050894d3ea3b98e1c965c4058208fe1..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/web/modules/flexslider/README.md b/web/modules/flexslider/README.md deleted file mode 100644 index e5d8548c7bba83c557f63de9feff60c43e36fa75..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/README.md +++ /dev/null @@ -1,191 +0,0 @@ -About -===== -Integrates the FlexSlider library into Drupal. - -Current Options ---------------- -Allows you to use FlexSlider in a few different ways - -- As a library to be used with any other theme or module by calling -flexslider_add() (N.B. This returns an array to be used as #attached on your -own render array). -- Integrates with Fields (flexslider_fields) -- Adds a Views display mode (flexslider_views) - -About FlexSlider ----------------- - -Library available at https://github.com/woothemes/FlexSlider - -- Simple, semantic markup -- Supported in all major browsers -- Horizontal/vertical slide and fade animations -- Multiple slider support, Callback API, and more -- Hardware accelerated touch swipe support -- Custom navigation options -- Use any html elements in the slides -- Built for beginners and pros, alike -- Free to use under the GPLv2+ license - -Installation -============ - -Dependencies ------------- - -- [Libraries API 2.x](http://drupal.org/project/libraries) -- [FlexSlider Library](https://github.com/woothemes/FlexSlider) - -Tasks ------ - -1. Download the FlexSlider library from -https://github.com/woothemes/FlexSlider -(To use Composer instead, see instructions in the Composer section below) -2. Unzip the file and rename the folder to "flexslider" (pay attention to the -case of the letters) -3. Put the folder in one of the following places relative to drupal root. - - libraries - - profiles/PROFILE-NAME/libraries - - sites/all/libraries - - sites/SITE-NAME/libraries -4. The following files are required (last file is required for javascript -debugging) - - jquery.flexslider-min.js - - flexslider.css - - jquery.flexslider.js -5. Ensure you have a valid path similar to this one for all files - - Ex: libraries/flexslider/jquery.flexslider-min.js - -That's it! - - -Composer ----------- -Composer may be used to download the library as follows... - -1. Add the following to composer.json _require_ section - ` - "woothemes/flexslider": "~2.0" - ` - -2. Add the following to composer.json _installer-paths_ section -(if not already added) - ` - "libraries/{$name}": ["type:drupal-library"] - ` - -3. Add the following to composer.json _repositories_ section -(your version may differ) - - - { - "type": "package", - "package": { - "name": "woothemes/flexslider", - "version": "2.6.3", - "type": "drupal-library", - "source": { - "url": "https://github.com/woothemes/FlexSlider.git", - "type": "git", - "reference": "2.6.3" - } - } - } - -4. Open a command line terminal and navigate to the same directory as your -composer.json file and run - ` - composer update - ` - - -Drush Make ----------- - -You can also use Drush Make to download the library automatically. Simply -copy/paste the 'flexslider.make.example' to 'flexslider.make' or copy the -contents of the make file into your own make file. - -Usage -====== - -Option Sets ------------ - -No matter how you want to use FlexSlider (with fields or views) you need to -define "option sets" to tell FlexSlider how you want it to display. An option -set defines all the settings for displaying the slider. Things like slide -direction, speed, starting slide, etc... You can define as many option sets as -you like and on top of that they're all exportable! Which means you can carry -configuration of your Flex Slider instances from one site to the next or -create features. - -Go to admin/config/media/flexslider - -From there you can edit the default option set and define new ones. These will -be listed as options in the various forms where you setup FlexSlider to -display. -NOTE: under advanced options, you can set a namespace prefix for the optionset. -This will allow you to build custom CSS for each optionset. Start by copying -the flexslider_img.css from the assets subfolder to your theme. Build new -custom CSS for each prefix in your optionsets. - -Carousels ---------- - -Carousels can be created with Flexslider2 by setting an Item Width for images -and a Margin Width in the optionset. Use the flexslider_thumbnail image style -and set your item width to fit the desired number of images into the div space -available. -NOTE: the margin width setting should correspond IN PIXELS to the margin widths -set by your img CSS in your theme. This will allow Flexslider to properly -calculate the "total width" of the image+margins so that horizontal scrolling -behaves properly. - -Flexslider Views ----------------- - -Flex Slider Views allows you to build views which display their results in -Flex Slider. Similarly to how you can output fields as an "HTML List" or -"Table", you can now select "Flex Slider" as an option. - -Create or edit a view and ensure it can load a content type which contain -image fields. Set your display fields to include an image field. In the field -settings, DO NOT SET THE FORMATTER TO FLEXSLIDER. This will attempt to put Flex -Sliders inside other Flex Sliders and will just get messy. Ensure you don't -include any wrapper markup, labels or container markup for the field value -itself. Save your field. - -Next, go to "Format" in the main Views windows. Click and select "Flex Slider", -then select your option set. Save your view and you should see your results -displayed in Flex Slider. - -Debugging ---------- - -You can toggle the development version of the library in the administrative -settings page. This will load the unminified version of the library. Uncheck -this when moving to a production site to load the smaller minified version. - -### Image Width/Height Attributes - -If your images aren't resizing, ensure the width and height attributes are -removed. The module will attempt to remove them automatically on any image -matching the pattern - - ul.slides > li > img - - -Export API -========== - -You can export your FlexSlider option presets using D8 Configuration Management -by going to admin/config/development/configuration/single/export and choosing -FlexSlider optionset as the Configuration type. - -External Links -============== - -- [Wiki Documentation for FlexSlider 2] -(https://github.com/woothemes/FlexSlider/wiki/FlexSlider-Properties) diff --git a/web/modules/flexslider/assets/css/flexslider_img.css b/web/modules/flexslider/assets/css/flexslider_img.css deleted file mode 100644 index 797dc7ec0ad2e63e461b3433fa3e52ae8b05c360..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/assets/css/flexslider_img.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Avoid scroll bar issues when the slider is next to the edge of the page */ -.flexslider .flex-direction-nav a, -.flexslider .flex-direction-nav a { - display: none; -} -.flexslider:hover .flex-direction-nav a, -.flexslider:hover .flex-direction-nav a { - display: block; -} diff --git a/web/modules/flexslider/assets/images/flexslider-sample-1.JPG b/web/modules/flexslider/assets/images/flexslider-sample-1.JPG deleted file mode 100644 index f9fbaaca9a69ac427954ab30c90ab694c5b75033..0000000000000000000000000000000000000000 Binary files a/web/modules/flexslider/assets/images/flexslider-sample-1.JPG and /dev/null differ diff --git a/web/modules/flexslider/assets/images/flexslider-sample-2.JPG b/web/modules/flexslider/assets/images/flexslider-sample-2.JPG deleted file mode 100644 index 3a8d3e56bd5a378999db90b6b409405c5f8556fe..0000000000000000000000000000000000000000 Binary files a/web/modules/flexslider/assets/images/flexslider-sample-2.JPG and /dev/null differ diff --git a/web/modules/flexslider/assets/images/flexslider-sample-3.JPG b/web/modules/flexslider/assets/images/flexslider-sample-3.JPG deleted file mode 100644 index 66f89de1351a4bd7a76e1a67d8cee4526245d21e..0000000000000000000000000000000000000000 Binary files a/web/modules/flexslider/assets/images/flexslider-sample-3.JPG and /dev/null differ diff --git a/web/modules/flexslider/assets/images/flexslider-sample-4.JPG b/web/modules/flexslider/assets/images/flexslider-sample-4.JPG deleted file mode 100644 index 5eb7b1cd7dccfee831e251a5c8781e1accb84bf7..0000000000000000000000000000000000000000 Binary files a/web/modules/flexslider/assets/images/flexslider-sample-4.JPG and /dev/null differ diff --git a/web/modules/flexslider/assets/js/flexslider.load.js b/web/modules/flexslider/assets/js/flexslider.load.js deleted file mode 100644 index 9202302dcf47dd6bca5c4aec4e9fba4f1ea4e61c..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/assets/js/flexslider.load.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file - * Loads the FlexSlider library. - */ - -(function ($) { - - 'use strict'; - - Drupal.behaviors.flexslider = { - attach: function (context, settings) { - var sliders = []; - var id; - if ($.type(settings.flexslider) !== 'undefined' && $.type(settings.flexslider.instances) !== 'undefined') { - - for (id in settings.flexslider.instances) { - - if (settings.flexslider.instances.hasOwnProperty(id)) { - if ($.type(settings.flexslider.optionsets) !== 'undefined' && settings.flexslider.instances[id] in settings.flexslider.optionsets) { - if (settings.flexslider.optionsets[settings.flexslider.instances[id]].asNavFor !== '') { - // We have to initialize all the sliders which are "asNavFor" first. - _flexslider_init(id, settings.flexslider.optionsets[settings.flexslider.instances[id]], context); - } - else { - // Everyone else is second. - sliders[id] = settings.flexslider.optionsets[settings.flexslider.instances[id]]; - } - } - } - } - } - // Slider set. - for (id in sliders) { - if (sliders.hasOwnProperty(id)) { - _flexslider_init(id, settings.flexslider.optionsets[settings.flexslider.instances[id]], context); - } - } - } - }; - - /** - * Initialize the flexslider instance. - * - * @param {string} id - * Id selector of the flexslider object. - * @param {object} optionset - * The optionset to apply to the flexslider object. - * @param {object} context - * The DOM context. - * @private - */ - function _flexslider_init(id, optionset, context) { - $('#' + id, context).once('flexslider').each(function () { - // Remove width/height attributes. - // @todo load the css path from the settings - $(this).find('ul.slides > li > *').removeAttr('width').removeAttr('height'); - - if (optionset) { - // Add events that developers can use to interact. - $(this).flexslider($.extend(optionset, { - start: function (slider) { - slider.trigger('start', [slider]); - }, - before: function (slider) { - slider.trigger('before', [slider]); - }, - after: function (slider) { - slider.trigger('after', [slider]); - }, - end: function (slider) { - slider.trigger('end', [slider]); - }, - added: function (slider) { - slider.trigger('added', [slider]); - }, - removed: function (slider) { - slider.trigger('removed', [slider]); - }, - init: function (slider) { - slider.trigger('init', [slider]); - } - })); - } - else { - $(this).flexslider(); - } - }); - } - -}(jQuery)); diff --git a/web/modules/flexslider/config/install/flexslider.optionset.default.yml b/web/modules/flexslider/config/install/flexslider.optionset.default.yml deleted file mode 100644 index 733688213e6efea7ca804f5510bec49e9486f392..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/config/install/flexslider.optionset.default.yml +++ /dev/null @@ -1,43 +0,0 @@ -id: 'default' -label: 'Default' -options: - animation: 'fade' - animationSpeed: 600 - direction: 'horizontal' - slideshow: TRUE - easing: 'swing' - smoothHeight: FALSE - reverse: FALSE - slideshowSpeed: 7000 - animationLoop: TRUE - randomize: FALSE - startAt: 0 - itemWidth: 0 - itemMargin: 0 - minItems: 0 - maxItems: 0 - move: 0 - directionNav: TRUE - controlNav: '1' - thumbCaptions: FALSE - thumbCaptionsBoth: FALSE - keyboard: TRUE - multipleKeyboard: FALSE - mousewheel: FALSE - touch: TRUE - prevText: 'Previous' - nextText: 'Next' - namespace: 'flex-' - selector: '.slides > li' - sync: '' - asNavFor: '' - initDelay: 0 - useCSS: TRUE - video: FALSE - pausePlay: FALSE - pauseText: 'Pause' - playText: 'Play' - pauseOnAction: TRUE - pauseOnHover: FALSE - controlsContainer: '.flex-control-nav-container' - manualControls: '' diff --git a/web/modules/flexslider/config/install/flexslider.settings.yml b/web/modules/flexslider/config/install/flexslider.settings.yml deleted file mode 100644 index 0782016f48f324a66ca9fc8931596a4b1b396d2b..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/config/install/flexslider.settings.yml +++ /dev/null @@ -1,2 +0,0 @@ -flexslider_version: '2.0' -flexslider_debug: false diff --git a/web/modules/flexslider/config/install/image.style.flexslider_full.yml b/web/modules/flexslider/config/install/image.style.flexslider_full.yml deleted file mode 100644 index 3b157583fb95a023a611d75d25a10ff22cc536e6..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/config/install/image.style.flexslider_full.yml +++ /dev/null @@ -1,13 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: flexslider_full -label: 'Flexslider Full' -effects: - 7c3142f8-ebf5-4cb3-9815-2140c9ef8466: - uuid: 7c3142f8-ebf5-4cb3-9815-2140c9ef8466 - id: image_scale_and_crop - weight: 1 - data: - width: 800 - height: 500 diff --git a/web/modules/flexslider/config/install/image.style.flexslider_thumbnail.yml b/web/modules/flexslider/config/install/image.style.flexslider_thumbnail.yml deleted file mode 100644 index 1eee735da6aa5767765d4fdaaf6add5e9179270e..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/config/install/image.style.flexslider_thumbnail.yml +++ /dev/null @@ -1,13 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: flexslider_thumbnail -label: 'Flexslider Thumbnail' -effects: - b4778d08-beca-43b7-8403-3d87e42991f6: - uuid: b4778d08-beca-43b7-8403-3d87e42991f6 - id: image_scale_and_crop - weight: 1 - data: - width: 160 - height: 100 diff --git a/web/modules/flexslider/config/schema/flexslider.schema.yml b/web/modules/flexslider/config/schema/flexslider.schema.yml deleted file mode 100644 index af24d5308a827f774ea199bb9f93ff07a0c8dfc1..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/config/schema/flexslider.schema.yml +++ /dev/null @@ -1,146 +0,0 @@ -flexslider.settings: - type: config_object - label: 'FlexSlider settings' - mapping: - flexslider_version: - type: string - flexslider_debug: - type: boolean - -flexslider.optionset.*: - type: config_entity - label: 'FlexSlider optionset' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - options: - type: mapping - label: 'Options' - mapping: - # General options - animation: - type: string - label: 'Animation' - animationSpeed: - type: integer - label: 'Animation' - direction: - type: string - label: 'Slide Direction' - slideshow: - type: boolean - label: 'Slideshow' - easing: - type: string - label: 'Easing' - smoothHeight: - type: boolean - label: 'Smooth Height' - reverse: - type: boolean - label: Reverse - slideshowSpeed: - type: integer - label: 'Animation' - animationLoop: - type: boolean - label: 'Loop Slideshow' - randomize: - type: boolean - label: 'Randomize Slide Order' - startAt: - type: integer - label: 'Starting Slide' - itemWidth: - type: integer - label: 'Item Width' - itemMargin: - type: integer - label: 'Item Margin' - minItems: - type: integer - label: 'Minimum Items' - maxItems: - type: integer - label: 'Maximum Items' - move: - type: integer - label: 'Move' - # Navigation options - directionNav: - type: boolean - label: 'Next/Previous Controls' - controlNav: - type: string - label: 'Paging Controls' - thumbCaptions: - type: boolean - label: 'Thumbnail Captions' - thumbCaptionsBoth: - type: boolean - label: 'Thumbnail and Normal Captions' - keyboard: - type: boolean - label: 'Keyboard Navigation' - multipleKeyboard: - type: boolean - label: 'Multiple Keyboard' - mousewheel: - type: boolean - label: 'Mousewheel Navigation' - touch: - type: boolean - label: 'Touch' - prevText: - type: string - label: 'Previous Link Text' - nextText: - type: string - label: 'Next Link Text' - # Advanced options - namespace: - type: string - label: 'Namespace' - selector: - type: string - label: 'Selector' - sync: - type: string - label: 'Snych' - asNavFor: - type: string - label: 'Use as navigation' - initDelay: - type: integer - label: 'Initialize Delay' - useCSS: - type: boolean - label: 'Use CSS' - video: - type: boolean - label: 'Video' - pausePlay: - type: boolean - label: 'Add Pause/Play Indicator' - pauseText: - type: string - label: 'Pause State Text' - playText: - type: string - label: 'Play State Text' - pauseOnAction: - type: boolean - label: 'Pause On Controls' - pauseOnHover: - type: boolean - label: 'Pause On Hover' - controlsContainer: - type: string - label: 'Controls container' - manualControls: - type: string - label: 'Manual controls' diff --git a/web/modules/flexslider/flexslider-logo.png b/web/modules/flexslider/flexslider-logo.png deleted file mode 100644 index 4e9c8291565111258c4ab247ec64c1357ad963da..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider-logo.png +++ /dev/null @@ -1,109 +0,0 @@ -�PNG - -��� IHDR��=�������\���/iCCPICC Profile��c``2ptqre``��+) -rwR���R`������ �`�`��\\����y�y� |�����2U� �+�������'300����%@q�9@�HR6���. - r����!�+ v���.z��H}:���b'A�2 vIj�^���ʢ��#ǔ��T������bϼ������Ē��Z��@�! -A!�ahii� �"��q����(v!��(����cd2f` �G�1G���)���I/���15C}�}s�ïPo�W���� pHYs����g��R��@�IDATx�� |U�} ��H�����ccvc;q�ı��M��}��k_��t�7��tھv^�I�M�NҼi�N�Iی�8��-^Xe�`a1��,,�!�w.� ؒ��=�ߓ���9�������Ŝ{���c.&[� @��Ν�}}�� @�� @��uucb|sc)C�6� АB� @�������!}fO���< @��*W���%����U�v@� pI�� @�� @�� @�$=�a��� @�� @��Io @�� @�� @�*$=�bu�� @�� @����� @�� @�� @���B@ң*�Q' @�� @�� @��I� @�� @�� @�*$=�bu�� @�� @����� @�� @�� @���B@ң*�Q' @�� @�� @��I� @�� @�� @�*$=�bu�� @�� @����� @�� @�� @���B@ң*�Q' @�� @�� @��I� @�� @�� @�*��:A�� L��?�c�T�� @��(��翼-6?��!h���@@ңA(��؆�Xx}[���> @���hm�wY @�zLoU=c�' @�� @�� @��$=jz�u�� @�� @��T���G���� @�� @�� @����������y @�� @�� P=��3�zB�� @�� @��jZ@ң��_� @�� @�� @�@�HzT�X� @�� @���iI��~�'@�� @�� @���# �Q=c�' @�� @�� @��$=jz�u�� @�� @��T���G���� @�� @�� @����������y @�� @�� P=��3�zB�� @�� @��jZ@ң��_� @�� @�� @�@�HzT�X� @�� @���iI��~�'@�� @�� @���# �Q=c�' @�� @�� @��$=jz�u�� @�� @��T���G���� @�� @�� @����������y @�� @�� P=��3�zB�� @�� @��jZ@ң��_� @�� @�� @�@�HzT�X� @�� @���iI��~�'@�� @�� @���# �Q=c�' @�� @�� @��$=jz�u�� @�� @��T���G���� @�� @�� @����������y @�� @�� P=��3�zB�� @�� @��jZ@ң��_� @�� @�� @�@�HzT�X� @�� @���iI��~�'@�� @�� @���# �Q=c�' @�� @�� @��$=jz�u�� @�� @��T���G���� @�� @�� @����������y @�� @�� P=��3�zB�� @�� @��jZ@ң��_� @�� @�� @�@�HzT�X� @�� @���iI��~�'@�� @�� @���# �Q=c�' @�� @�� @��$=jz�u�� @�� @��T���G���� @�� @�� @����������y @�� @�� P=��3�zB�� @�� @��jZ@ң��_� @�� @�� @�@�HzT�X� @�� @���iI��~�'@�� @�� @���# �Q=c�' @�� @�� @��$=jz�u�� @�� @��T���G���� @�� @�� @����������y @�� @�� P=��3�zB�� @�� @��jZ@ң��_� @�� @�� @�@�4TOW����;7m���2x5{��X�|EDR��z��x���5�FKc�xQ�?\� �,YR���H�� @��)���O<�Dib/������x���.M�K�jwww�[��D��쬙��[n���*X@ң�O�C\�`���������5{� �����[ �|���z�x�O @�� pM����8w��5�sBe�#���)�Nt��UV��@Z��JKR= @�� @�� @�@I$=Jʯq @�� @�� @ -I��$�C�� @�� @���T@ң��'@�� @�� @�����HKR= @�� @�� @�@IJں� d%p1���e�p���YrB�����k�WM'��8W��� @���.P���c�Ԟy]]�>��[�RzL] t)��]��������b -�kj*fse�VS �yܸqea/ @��������4�(j�>�q��) -�����$=��q�� @�� @���I��*� @�� @�� @��� Hz�� @�� @�� P1�3T%@�� @�� @�����N�1 @�� @�� @�b*&R�(��ĉc|s�]���&�?� Uxtbkk�����g/�;R���4�{����&@�� @���jhll,Y�J��y�ر%�o)nhH����������[�&Pv��M+�. -�����??�'?��������� @�� @����r_�?p�����j���$�����ޟ�����_�j����@%�ު�GO� @�� @�� @��eI��^ @�� @�� @���, �Qɣ'v @�� @�� @ಀ��e -/ @�� @�� @���J�����; @�� @�� pY@��2� @�� @�� @�@%HzT�艝� @�� @���, �q�� @�� @�� @��$=*y��N�� @�� @��\���L� @�� @�� P���<zb'@�� @�� @��.Hz\���� @�� @���dI�J=� @�� @�� @���$=.SxA�� @�� @��T���G%��� @�� @�� @������)� @�� @�� @��*Y@ң�GO� @�� @�� @��eI��^ @�� @�� @���, �Qɣ'v @�� @�� @ಀ��e -/ @�� @�� @���Jh����N`(�q���رc�:�&N�1u�������,�� @�� @����3&�$?Cm/^�а�,��� -����A���M��{�}��?��r�� @�� @�@��kl�}��g��5 -:L�"�ս"�"h @�� @�� @��$=jy���� @�� @��T���G �� @�� @�� @���Z������w @�� @�� PE�U4��B�� @�� @��jY@ң�G_� @�� @�� @�@ HzT�`� - @�� @���eI�Z}}'@�� @�� @��U$ �QE��+ @�� @�� @���x���d0f̘�[L�4)V,_Q�8�੧�����,�xK�c�xc{�u��-���� @�� @�� @��gϞ�Ç��k�&_��;�9�������[�Z8u�T���J^�g��u��3�� -(�B.\Ȫ격�����b�݊�_�ZB#@�� @�� P����J�����fӸ��7o^�����q�������j8C�� @�� @���+ 鑯�r @�� @�� @�@Y Hz��p�� @�� @���W@�#_9� @�� @�� @������(�� @�� @�� ��@C��*7v�ؤ�YU_����EYĒE���I��=�Y���� @�� @�� -(�'=ZZZ -�Q�n��ة�@����5ϒ� @�� @�� ��@�����im���[.��<��x_L�:%ݷk -��]�#�>��� @�� @���\`̘1ea��U{˱���o�@�� @�� @������G� @�� @�� @����$= -7T @�� @�� P�e0B @�� @�� @�� -h(�����x1�"����}mJ @�� @�� @���"�w�c��ٱb��ZqJ����w_��]��|Pת�q @�� @���+���kV�ηx^��]i��ռM�6-V�\�w�zt�ػo_^���ȫ5�J"�陒�k�� @�� @���ac���Ü�P�477G�'�mLZӣ�<E @�� @�� @������(�� @�� @�� P���Gx� @�� @�� @���# �Q>c! @�� @�� @��I��%@�� @�� @���G@ң|�B$ @�� @�� @�@��)J�� @�� @������G���H @�� @�� @��� -(�( @�@� -�:�%6�y-���4�"����K߹6���M˴�7b���bq[c��TZ^ŏ<��#����k��F~ ^��l�|�B&�����Uw� � -����5��]랉C�"���\o�^��X�>���f�N @��(�@�^�Ic @���J��:===�vF��Dž�«N��\_ -ޥLkH�+�@�Yy�HR#��b⤱�s�k���������E�苖�ę}���;�8�cV�'%3�S- @�,LoU� @�@�uui���n|Ů- ��5^�{���:U,iM���ro��ظ�䐇��@���Bgf�-�{EL�I93_ @���p)���� @�� ��@2՚�1%��#+tj��8pvd��Y�������k�)&D(�� @ ?I��ܔ"@�� @�@�uSb�����6[H���c�cG��' Uۍsb͒�Qq2 @�@� Hz�ߘ��� @���ږ��9��ѽ7:���^��8�7�(��Xr�Ҙ�Q��%@��(���G�D�� @����f,[3�*:�Bǟ����q�c�6EV+yLZ�6nh��xDo' @���\�U]��� @�� �+�\�-k����@�R���d]�X�(˕S� [� @���Hz�b/ @���J��uAܙ����;b����7�9��Q\ͱ��%��C4ŭZ @����$=����� @��e&0e��XВ]P6uĩ�ϫ�S{6ǁ�r1m����My�� @�@� -Hz����� @��oh�[��5[����R�9w$6�ؕM���Z��[� @��%��(�� @�� ��@Ӭ���< -��H����U���Ş���J-�z��h�� @��*H����{���1&��lC��T� @�� @ E� �WŒ�_���)����vo�s�_����z�l��=�1���1�BES @��F*0y��X�l٠�\��u�6��Άd�`��a�9D�� @�����֬�#_z62����;��=����{'cs��Lڮo[+�2��I�TJ���*����3gΐ}�7wސ�Lo5$� @��(c��i�f͂�<�7Y@�lf�[���m�&�S.�� <,�� @����p�W��'x @��jY��=yjaNV˚�ƶ�;����}];��h6+y�_�:�| -.�j�� P\�{��� @�@��#�U�� V�@�@&���������p����}g2�|�j�Ɩ�{;P�ƙ��Ry� @�@���G��.> @���"��/�Y���@e��clLt�[�wJvMT�{���)ɻ1��5V�us<��3I�t��9��yWQ��ܹ9�f�hI{�]97|u @������e6 �!@�������o���]6�۸�R<ރ���Ic͍G�ٽ��}��莎���}w/�L� -8{ 6g�µ+bҨ��� @�@% -dz�Z� b&@���Z����~#Pd�����-^2Zޣ�kGl=vnd��uV_���|&�4�[��$n�� @��( �Q��&d @���U�)n����(��7m������ƞ�:bOw5���ƙq��o��W @���j������7 @��jK�in�q[{F}� �I������������1!��UI�� P���;6"#@�� @���Z�'�9M�u���=�;�ҝ��@ǖ85��GyΤ���I>��� @����pX�C� @���R�.ޱ2������g�l���}�;bۉ�j�h�X�x��&@���fI�j]}#@�� @�6�c��y����hl�y2���D���)���*c�ڥ��m����N�� P^��5�!@�� @�@*�3�Ɗ��,k~j��8P��'vl����t��J�n�#�[��*� @��jI@ң�F[_ @���)��+W��L���m�vD�S����w�?o��'�_� @��*F@ңb�J� @�����X�v�h������yߙ��{�Y��}ÎH�!��X�vq4\Ֆ_ @��jM��`��x�����'><do'M�c���Mlm����!�:@�� @���,�;o<��=�z؝/l�cs�3G^��}��g���̙���٣�c��:���������!w�.�n,�c#Pm��6��sI����صkW^�/]��e��c^)D�� @�0���kb��G�@�Ɇ�ظqO|��1��Lz�Ŧ:�� ��,�s-�1�] P��Ν��>�H^�lkk�;ͫ�B�Y`Dץ��� @�� @����b���#�!�^��G�]+���@��x.�_�cb��c�Ȓ.#��) @���- �Q��'z @���L`�ܸ떶��;ʳwl���gָT[����3��<�Zm�0�9�� P���;�zF�� @����ZoX���_�/�_�b�s����Tl�tp���jl�=�ϰ_~zJ @���S@ң:�U� @�� 0�@C�t�ʘ4ȑBw��;;���ؖM��Jm�f��A۳�� @�v$=jw���� @���Zhh�ի�e��=�ƙ7�<pjOl<�� -�p����훴�J�� ��{�� @��5&�<ci,������Gcӎ�Wh����_���t^6�Y�-��Z @��U& �Qe�; @����ܕwD˚w����|sU�S{6ǁޑD3�s�g��f���S @��jI@ң�F[_ @�� pY`R�q��˿���?vl����b�]�U{���X|��hM�V� @��T���G���� @�� @`TuS�ZFUfD'w<�)�^�cҍkb�$cG4N"@��Ԩ���x�&@�� @�@N�}�ژ�\��b��i� @��J) �QJ}m @�� @��M�t�m����)��1�qiTBn&�N��� @ I�<�!@�� @�x�u �k�V[�0?�ޒŲ��N�yu̟�N]j!@���n��{|��� @�@��~�P��7.��+�/-�gǔ���l� �b��b��2cn�1�,�RfA �� @�\$=�ud�E��(wٗ�@�p]�wD����9��X5��:�7�]G�Ȼ�&��X�vq�O�U6X!@��H$=� @���8�x�H}T�M�1>�v���jwرu�8����Ƿ!g��s���W�W�o[�+!_TB#M @��\-�c��~#@��x�@O8�����k��rw}` -���g-���OĶ������c����Ơu @������{�*W� @�������KǤe� -�_sG�vY�q���A��N @���a\C�� @��jS`R�^{cɺ>gŚh7/A��5L���dI�J=� @�� @ #����qǼ��j�����byE,�>t!@��(���G��L�� @����h_�:�71����s��"6�) @���j����� @���&0!fL�O��kUT?efL�)�ZL� @��#�rr� @�� P���Ħ��E#��|>�;r�h�i�� @��$=�oL��� @��)����/F�R��pǺ8їB�� @���II��v�&@�� @���Ƕm���ß����X�����FW� @���j�����? @���R��kgl<�=�R)�~zwl�w*� -UE�� P+��2��I�� @��� ���u{Gtf�'u��>�Ͳu @��T���G5��> @�� @ O���l���^�c�X{c˺�3�1; @��. �1��� @���9��;��p�z��Ɲ'knt�� @ I���$@�� @��5��yJy�0�6�/�X����� ��T� ^�� @��%h(I�%@�� @��(���Gqv�����c���r h�8l�]ÞQ������b��WFk�B�. @�@�HzT�P �� @�@m -�\q_���T��/R�{�m�m'z��Z����[��}�f�QX @���Z������W @�@^-1��)*f������w������p�a�zC��������f�F -����������xr&�.��� @ I�<�!@��Ԓ���o��m.ki����bߦ q*�.��xW���d<��t�5�߰1f|��h�K�Ue @���jp�XM��/ @������2�U�����C�Ŏ��TC�r��hO>iNY�<����7[��y�C�2 @�@U HzT�p� @��F(�{,6l=:GxZ�X�pҷNn������O����Ύ��3 @��jJ@ң��[g @�� ��]�6Ew���xխ�|E� mKbikpݺ1����WxI�� PdI�"�k�� @���8s�#v���F4�Y'��#����g?��wwl\�3I�� @��\-��+ҫ���� @���I�ܑX����{�+���Ά�Xy[��� -�{zo�ۓ�셄�, @�@yHz��8��� @��E荝�:�'��$OsL�����baKʍ&�u��>X�#}X5 @��*X`��� -�� @�� @�-��tĞt�rs�>��-m]��1��-�ޙ�o����-�'qRL @��%��(�f @�� PT��b�)7�+V.�}��0?V.��r�Iu��cݎ���J?L5 @��G`Dצ� E+ @�� ����ض���M��)�V��k=�qE�mK����+v���{����eY�8UC���hI��>� @�� @��];7ā��h�+M�v�W��+V/�jOZ��~�#,k���z @���+ �Q�c'r @��\[���xv��k�7�3��5�GY&wzCےXڞ��'b��CyD� @�@5 HzT�h� @���8�=�#���W�/�3W�MS�h��e1)��C�=�5�;7� � @��T���G�� @�� P�'vl��i/�Sb��Y��6������c��6m���B�n @�@�HzT��! @��5(0е;���N��3��4���Ir��e��%�� -OǦ�{b ���I�� P�)\��}H�� @���8���N��ŲYR��1��-�Xݣ����t�LJq��� @��$=*i��J�� @�����eCO{!�$=�l͢�%�A�0?V.�8ȁ�w~C�ly��!�@���0I� -0� @�� @`8��Ν�q�g�S�:6i��۔W�a�-Y3�=%σ=ѱnG���I��(F�� PI��8k�� @��E芍����N��X�hJ��^��5���1����Ǻ�]�ԭV @������(�a @��F/ph���}�k�X���Hk%��kh[K۳X�#���u��e�s��� P���8��D�� @�@� ��[��?�S���cq[�+y:6�W,�I�)tg�x��8[h5� @��T���GE� @�� 0����ذ��0'�{hb��}n��GW��=V��>�2#=��h<���H�v @�@HzT�� �� @���oÆ�b�鷯�"<�qy'�_[.��ꋞ��b{g�O¤�� @�� -��(�P @��(�@ϑm���?��Zn�s�\�c��b���"��="���.�{o @�j$=�f(u�� @�R��\��f�x ��w"�u�|5��Ջ#��<�o��Xy��A���3��t ���A�� P� ��C���������5sf,^�x�cv @�� 0�����D���J�㼮9��'E�R5�5����@�5O��IM�<s�b����=�IymY�2��!�+"m[�<f��D������sG���Y��_�� @��� -�>}:^>rd�:/^������r;r'��?~�Cq��\�C�8@�� @`���[c��aN(�C�s��/���Uq^#p���">�r�����6�ή��3cՒiC7\�#��l��qt]6Qw�������<�R@� @��*Z���;��ٓWJu�V^�*D�� @�@ �b��KK�4�X_�G��#���'2�X���hͤ��U�ж8��g��Gw�fw�.$g @��T�@�W��C! @�� P�@P��ɂ�=0Է������sW,�I��R��w��}���]� @��%(���h��&p���ص�D�|�T9~:�9��>=�.Ĺh[M��FsSC�N3�O�Y�'���g��m�6�����)� @�*N��{Ngѕ��j��,*οΆ�Xy[{<��S-�/����/��%��(YI�"N��w]��<��}�ڲ'���]c�榱��eC�oj�릵$ז��ˉq���qü�QW���Jw� @�@i$=J�Ռ�56�رc�lebkk��b��ɂ�C�9@��rk\���Dl�v8��>z�C�0�^]������� -���{��Jh�u�q�M3b�-�cŭ�����0W���F/p�P�{�s��FPb�m��r�� �W���Ş,Vl��ضn[��gi�֬��8�B�N��:��/��q<^�Vbc���n���������עc����%D/lO�/gƝI�r�7�|[�+ �mI�o[xUE������� -Y ��<�'��>�~_�8��)�^9��G��F��o��V^�sᥧ@��z @��zc��[���3�ZIJ�尒�`}k�ūo���=�M�{�Ɲ��ť^�}���Wi�b�=w�ҵe.�1p��hF���� �_���_�K͈{�!�Zq}46�zg�N%PU��w��C��>��B��X��� P�����������R�0:Fwr���_�}�疷M��z�m�t�N����E�k��؟�B�KV.I���� �c��ٽ�����n�]���&�:���eZn��G�k�/>�B2%j&Q��.��}ױK?�����}����tiz��N��AI�t]&@�@-t���������%c�Mo��Y8Z��w��E�+Y,&@��� -8�?��ݕI�-�� ����=n[�<f��D��bgj/�c�3�b���DP��k.�[���w�翼-Μ=_x�y�p��\��?v�?=�=���[��%�%��T���D@ңJR7 @`x����x���_�vi���.��� ��_�wߵ0��;WDk�5��#�T���x����w����jI{���Ʋ�7��dZ�L���~ˑ�o�'13��Jw%��}�o�ǁ��IH��,��_%ɏ'��#?�=w�-��W6 P�R��8��L���8�,���`��?=W6 �+���g�����?�s;^�r�� @��@� q8��<"�\VQO64�-�e��M��s�#������jr7����o����Ce����S�?�p|�o�En��5I�Zq�%@�@� ��t����RJ��C�O��Z��?l��䃴���N� ��YǢ�mI,�0����]�,&eUyR�� ��?� -Wv�'Nv��~���Ϗ�,���֓����R=��C�@� P��5;�:N������L7���=�{�*��_�������x��]�3h%@�@fg�����*ZbŊ�E�i� �����6�6�y��+��ܚl?�[�3rS�V��������`l�y�RB'(X@ң`B @�@� �����?�d|��]�ڈ��}���<]�^��N"@����8�mCF�vG�ݲ<fd7KT�2a����%�f�;wDǡ��5��ذ�`���nL�Pq��;�w��7����L������GM([��䩎�J��Z�q�lcI`_~->�{En -Ԟ@_���x�'��7/��7d9AT6a_]kC,^}[d��9�uc���˫�k��ǟ���'�B_�>�ӟ<���~=�Л�j���� ����G�p� @�@� �����ؾ�X��GD���o��#q��\�!@����8�5����c�ř&��{�Z'̏�7N�@Z�����vF�L��V��s��ƭ�S�l\�x��}��d�WO|T�� ��F( �1B(� @�@���_��M�.�@Gan������U�T -��S ({���֕(���$�C�7EgF-7�[[��c`���1�>#�\��{c��Pu9��s�� 5Ւ�x�����5>���'T�@�\�V����T��_��%ST�7Y,����j�>e)P��e^}]zue����N�4�XSn�~�7�:k�k$T���~ڹC��ь���o��Kg�n��m�e�o�,�]�_��ʝըbG�ԁw�����R��jb˸�W�_��g�?�����s����bʤ�u�� ~�>ǒ�kl @���S�D���%�k���z��;�a���c;��.��~�\z�K��X�^}j�`:�w��y]>�in<𡹗��� m����㵥�1R�\R�?��8�z����Y6/~����MW'=/�z�-��YO��7�0:/���$}�����;6˴aAa*L�����ȋM!(�����}2����-Y4=�yǍq���QW?&�?�;�l~)����/��9n��=n�7��]� @�f��:�/�;���g����=Q7�ӓ�������$!����b���W��?�)~�{�(J{!@�����(��v @ ��H'�^Ϥ�*�}(��sWܵ���N�7kJܱ|~|�ݷ����c��t�'��u�ǟ{:~�?������/ @���4�$Ɏ��BU]����.~�����|b���{ͥ)����7�ܝ�뇟�w���,����2#S1T�� �+`��H���䦵*�:��~����%�qe��o��%�4�y�+�����#�ŗ1��� @��!�{r87�T�O�.�ev�Mm�իw�3&~�{��=kn��@��}濯���56 P-��2��A����������z�����G�7%SL]k�5}R�H�m�:-�����x���>ݒW� - @��*H�����^M=�%7Čf��?�o��T�h�����/=�s4E�K���Z@ң��Gp 0�@n/w u8����ů����{�c�ۻ�~[�%w륽���ǯ<�v��#@��Ԭ@oo_|�K�2�Ӹ��,�[���?��X}��Lbzs���\[������~'@��) �Q��&hԶ��d/<T�/�'Ol������s�� -�e���9}�ʌ��G����Nw͐���< @�@� ���8u�\&�z�ճy՛[��g�X�dv^�GS��뽑[��F���A@ңFQ Pc���c��ئNj���;kr^��=�b�П�"�YĩN @�@��ֳ��#;2�c��d���y���P��߽+n�yf^�GS(��{��tI�JA� @�z�8y_7uB�ڿ_����w���ξ����#�B��� @���/�)���dWv�9~:���R�6������{c��k�+�w#I�ܓ.�;PH� @������(�a�T�d��ر��HO���Ư��1��5�:�������&!Tn��ɝ�6 @�����X�7��#,��Y��]���_���Ģ���N{b��� -*E���H@ң�C( pm��oؗLp�� -9cV�Gn ���-�T����ʏ��>����9 @���Ar7�l�����ܙ[$�7>��8r<�)Z����/��{�j4L��@�IDATy�[gn4�ؾ�h��ZvO��&� @���|$=�S��J"���l����ݑ{�c�������ykly�HAu���sɓ��6 @����l�r0�2���[a妏���?�;ό>�o�������Ƽ���7w��s7����z�Z18N�� -��(TPy(����N����Y{�N�_���cRksAm|����G1�܇��{��)m @���N����O���_K��v��n˄q���g���p�?�<�a#@���, �Qɣ'vԘ��od�������c?}��4���_|.��f?�ՕAnߕ�'W��5 @�.&�5c��7[u�z�R⣐i�&�6%��:tio;�k���U(���GѨ5D��� -������ol��~�1a|cA!~���=_P�.Ň�|�T�� PN�����ϗ$�����x8^;ݓw�S&����r���֡{s��'S��;����on�� @ mI��E�G��� x�+��o�iF����da�|��]����������o��}`(�\��0 @��fpm9��9~����)\�ݦM�K�g�6������~�m��� @��h$=F��\(�@�a�۲[f����q� yW�K6��_==�+�: --��7�0/t��+O���D���-�1�ݼ���8�zo>�/��=鑛�u���֥�2�r��2� @��h$=F��\(�@����{s���{�ql������\������g���LV'�`���z @���j(�맗����_��dZ�|����W������ʶ�?u�^ @���������,jW���3�u��E3��~��А£� >�ٯǓ��W!��Lϧ�8�%@��T�@9]?�9p2��'������7{J|�X� -���ݩԣ P -I�R�k��F-�ӓ��+�=��S?��h����������O?�v��꒾.�����q @�@�rv��������h�����}o_M�������捸�I��F"��7>#��9 @ %���z�2��W-����_��B�Χ�M�]Ym�_Kz�|@��T���2Kz��v�>����Dž�3�-w���\�Oѫʔ��U���# �1�C P>=�����^,I���w;��u�����b�G�"�r=����,@ @���L�\����<�w�[�u¸�˾Q� 5oH���*Q��g+��b&@����3&��'���!�ɢ��w��4�^KJ<�Wn/ @� -���)w�����X�dv��Ϝ˻�Ǥu��F��$@��E�G�5E���4���+J�*�C�w�����tEm��)���H @��� -4���S]ݘ���#va��=��{�+y��`�ټ�? @��H$=F��(�@Z���u4�̙99>���FK -S�����z� @��U'PN7��' ����{"��\!�W�x1rk��5��z�1(O������WN9(������{f�K��jwޱϟ3%~���EZ��ț -�[<o -ϯ @����(��GCC]���7�X>� �=/u��=���:�(���)�7,�I���' �Qyc&bԤ@{[K*�������q��;�n�7-~)I|4��p����IY% @��� -(��Ʊ�����c�ms -�{�3~�I�)�\ ��Z�Ga PJI�R�k��F,0��1&������}��|���q�o>qт���=���Z۬��!1 @��*F`��I%�5w�/%דK�*(���N�o|���zoA�\Yص�^ @�@� HzTڈ���5,������O�ٓ10��c����ɝyc�) J���o��I�R��� @����(�����~���[�(�������G��s -��ͅgO/mB�������F���Ҍ&R� @�@�̛=%U��[�������ż����%s07ԗ�ԜK]����� @`��S��i��7��~��qӍ�#-2�y�^<��ɯŹ�}�/dgn;�T��J \� P{�&w�=����v��M��al]����c��8X�dv���siʬB(�vlI�w��n�������Gooo��p>.��p�I���I���$�U�Ly6��!ƍ��c\cc��a�Z*�%@��#�3s��SO�97���8ib˸����7��3���:����ӏDžd������"�ƗvL�#@�������s @���,��$&".��`Ơ�?����K�����];���\�l^|���%Y$} ���@.dKS` zϞ��N�';;��kg������Ͽ����h����N�iӦ��ɭ1��eX��J @���tn�iF<��t*�F-�'6%Ox��dK!ۆ�i�'Ӵ�>�p����"�1({���~�H��o���N�}O��+�?���ݗ?�W�]�]+��������N=13TP�i�n^X��C�]K��Ν�������#q��t���7�{{�T��D���}��-�6cz̞5+��M -e���W(��n�Y��GnJ�_����5�N�R����TAӳ^�~i2}���T���ו<zb'@�@ -�Y$=r�_zlg4&S��߹"o�{�1z/����uy�1��+n�M�Ǝ��s��;��=�_�����o42�����q�`�'���I��c���cv��(� -1�l��{^K��:��O(g��+�5����=g�Tl{�8�¬"��M���k�=�+�ƵXU_�LWߘ��xl�mj����'?��<aBLhN���'�*m���$��5͍��.�4�S���߉��c��c��M��s7���߉ �9�b)���~���B�i�����̞�x�?�}w��x|ݞ��_<��S�u�c�k��#l @������UE:��*D�k�_�cGf�����ѐ,���Z���}o_=�.�_|as�u���;�a��:�[}g�b�/��]ed��N�-�������<�����t�����TZ<�����f%}=q�tw�#�RH�ֽ4�u�����>�[&^�*����:yR�6U�G����1�碀� ��룱yBL�<9�N��L�89&��ZOj��~�Ζ �bŭ�c��Co=�Ҟ��tV�&yjwQn�Y�xfL�T�+���UC�����OWt�K��)��ǭ7ψm;�f֩��ҶhL�&���oͻ��oI����ؔ,2�Ֆ�����9YU_}��늝۶ƞ��ݷ��8�bG�=�ܼ4n[8�(S_����Gy��]r[u�bi�ueg�o\��������KOI%�M�m�3b����6-���N��ߕ���_���������tt�~���<�-f̚s�̌IU����^���2�<I��}9y����b�e�qC͈��H���+PE �Yd �����us�I�\���I�&O||�ݷ������3Mz���o�ܚ�k ��C;�Ė���:�̎�&��Mq�c��5qC[S��'e"�$ -;������yb{�]p}̛�^U �2�F �������FcK[\��.�����`�1l�+��B��:!^y����{�mʄ|����=��:�.?��S�'<�Xfj�ј9���S�7%�9.�"@���aV�67�Ϟ2�����?�+��n�7-&O�����#|O� ��;UaϞ��=�H&<���?;�=�mޓ�TJW��%�*�9}"vo��<�`<�n[�ܙ͗�UH�KU,��ݙ��x6���ñi�8�єz�JX��D�/ -x��Z�~=��4���h �\|�'��&ט6 P���>��'@�@� -|��o+J�s[>�̞�ۚ:9�;��k���X[�I��n�;�6?�nx1�|2��v}1��q�T߈�8�@�tw��u���|���u�+|�[����荣{�ƣ_�rl�}$������w.�ܓYl���2�j��:���:�r�hM�M�/y��F���A@ңFQ P��G�sORc��_=OmܗWS��o���7���| ��F���*���� ?;�VK��QI������bӾrZ�����$P��]�����營�=�N�k��"PD��8��#y����y�L�-ߦrO8��dj�,��/�':G����o����,B������4n�� @���$ �QI�%V�,PW7&~�{�1c.����ŋ��OǺ���������+#��;�ʿ�_,�I��܉8�������ⱇ���U~�����Ƕ -�|��;Q\e+�{:vn�z|���q쌿Ae;N+�@w��x"ٰ����{�~[,��-u�������L��������ϒ������0\��ic�����;�1 PQ�5\�%@���+rJ�{��+we�z ����?{26?h�m|��o�@.c��`�Ը�>�F:p�@<��֪��j�>^�����x|lj+wyM�������'���0��͜V�='v�#��U~���FqLr7͏|�Q��]5/|�x���<g��b�z����sr���֓�ޑ���:_���9 P�U��q%!�}߹"��Z�8����]z���'b�G�Y�����i ���y�9alC]�Ŀ�;rO���$�<������]��3c���7A�����t|>����s��ƿ� �s�W��3�?�x��U�̝��4�[�k���?Dn����c����%�����#~�_�u�{�8�7�߽8��z" Ku @�@�4�O("!@�����?�C��G��Ɣ����%���?�h���]�J�l۹�x���<�Χ;u�~���?g�`M������T�GO-)Էŝ�^�ܾRK���Y $k�l{��8t㊸k���*+h�V�@wly챈{j�o�w���]��ܓ����\�4}U������p�����r�C� @�����ݫ��6� @���7�o�����}`�%>r�2���~9N� ص�D�y�3�\�/~�S�ů��W�ӃO]peܣy}���6��h�*��}��g�����w�gm��u��o?T�@�ގ��Ƿũt��Ue�3�"Г$>��5�w�.�����{bb˸�� ��g~���P�k��d#@�@ ��\Ã���&�ܻ8�?]�y�w�%r?Yo7�p]���ߕu3Y��=�b��=Ϡ[b�}wG{c��#@`x����C���w�=�O�Qix,G�[�t�jG<�%Q���L�<>~��������������L�?zo�O+����wE� @����qT�D��y �Z�b~^e˵�ܙ��~�����˷��Q���b�[vW��Xv�bvS��P���@wl��C�����GJ%н?����g)�L���ſ��wF}���[�=��-o�������T���G��� @�@n�����cŭ��cf�����-�wj��j �u�n����$������Ͽ##,�Kޑ�_}��;�����oz,68Sp=* P��vwġtg�8�eKfLJ���jH|�?��wƚe�*nL��F#���h9���^���������\Zc��"���%�'ߓ�%�������vŎ�����/Ip��ώY3g�ԩ�1!Iv$S}�e���=g�̙����q�����M#��Xt��������Y}���T��X5�5��O�L��=6��w/�A��+Ә��Ub|sc�����ة�rSZ���H���F(?I�� @�@��ɂ�?�o����_�Q`m�/��Y�s�MMc��xE��{�ߛy��S��M7���ZG�EO]CC4�N���>k~,N"�;w*^>�?��=�y�?�yO�4�%[��C��Dl{_,�! =Qqw�D��9-N��cN��c쏁I?��� �����$��$����[������O�7~�O������,M�ܢ�?�c��Ⅶ�*�h���-�t�ŵG��E�<����re,���J��x�܅��[H#I��?p{|���&O$��8�r��p���)�b��[����ˤ��I1ѲK?g;Ŏ����(��W��Z�|����Ehi_�&�����B�����K����q�¹�p�\��no�%o�5gS�@2���w<+���4�/��:vJ��-�W�K� -���ї��I�(<�ZW�8~$��8]`r孭�gﮗ㦵յn�P}nn������O|��ع��p��ͱ�]�?���D�T���͠��2��j,�5@�Z���z9rd��&N�c��$)��Ғ�]�N�!� Pa���̛��'ce��I��|��[o�Q�1�K`�d�%Oc,Zswܔܡ��6�mn�y���:�-�}��5�0��w��Y�ĒE��Y�Ӯ�)����LJ��o~�{�����'_}-��{���?v~�����{"c���Z���,� -��?��0"��'u������I�{��ՙ-~Y�d��B��ec���E�c66�v���~虎��~��~�~���b^'f�'b�g�r�Ǘ*W��L�)c���*�BYXH�3��P*�V���)Ȑ�������-�ʕ���ņ�m�X�ŕ�����89~5U���8?��i-�̓�v���������H���~7n$�"�L���ƿ��{�!��[��]~��@� x�Rk���~9>�8���>�{wlܸqY�ډ��l -��OO�_��/�7��$����a�d誏�/=�p�˗wߜ+:��Y��Z�;��eM1�́�oM�E����x��3����1q�����w�qw���z1��1�5䢹�p��o�U�?������|\8��M�� 2���x|~0��O�b�Z��UF�$�����P��cv2�8�A|<�V��j����\j�N������?{,~�ئ����w�ӿ�g��ܷ6�ݿ���Wy� @��fff��__�@x�����/k_;Ȳ��G��#7HL����l����`����p���eg������������kg�����ɏr�_�H��V�uͽ��KMq荷��m��x2�ni�����5Ds���[����b916z*>���1~�����fF���������Ҧ�8��\{l{��X�h����v^���g��9�m^�ֵ���u�_�o�y��O����#11Y���7�����/~5/��aS���)h� pM�;�����S`M~���o�������G��?}s�EQW�P��ȯ���֮�<lU�ʅ�H�%Ζ�{cGgn�}:b����߾�߮cО���u+��#�$������y��2���#)O��C��S��G�/Xo�(�Ό@k�P��P�=4�xN���bbast�Qd�0m���♟o���W�_�]L늛�G�����g����\��<�+���jI����Tmc%@�����h��o�����vݼ����~gF'�{<�/ִ5�/�n�g�m�M�I���x���ڪ�+�,c�#�|��x���b~��_�\j�,2�jȵvŎ}]�ȕ�q샣qf*���Z#�dž_�����<�-�@�k0��9�;��B���'碣����xժ���_�s�-�?v&��_U|8�9�7����� n���f����۱XQ�G��5+��J͖�� @� PX����So����'����x���o踹0y����)�|�"0W�}A�}�C�ZJJI��/��_��Ӳ$8ŨM����xlwl;?�7�O03�t�4W�y�UĨ[���ЅW��X��oN^�:B���@}~��7ݼ]��:}x*��[>����u�{=�����Qw>�s3~�{ @��O���>������bժU�>���?�Ea�I��+�eӺ(� -W����g�E)Ϝ��s��ɛ�^���ͅп�?�*?}DS�hl�/$ڼ:z�ڢw}{l��ϫݿ.Z�!��0w9.'�Jf. -��L|hxd���|���8�� ��{��Da�g���8��;����wdC���81v,�i!�.^ɯ��_j�[����O9U�>Ό^��g'�{n9����k�<����\�h,<�\��7�k]K��e��e[�9�������| @���Z���9�7mZt��nƥK�}�pgÖ�[��`��͐���! P����y��U� �]�"��䯰��M2��Ȓ@]s<����=}4�p�T$�{�G㜍��D�S��u|?��MV�7ă-�b8��%f�g���s~yE�س&߸X����E��jL`M{{��˨��F��U���! @ ;s�/F���dg`2!@ �־�x陝ђJ�o��O�O'/� �E��ظ5�u��'#?�� @�@�4=2]� @����������~έ댦R�؟��LԵ�ǁ�{�=�,�?���;�S<���-дfm�/{��v�K8�b�p @�4M����M��T������PY���6��{c��]�59'>��^q�GQ5�� �5�%{�'�AY1"@��jK@ӣ��m� @����SWL��l P+�}�쾁�F;'>>�Rla �*�pCn���;K-�� @����4=R'v� @ ���]���H�@: �����T�Ϗ ���TBJ [�Wbʹ���Ȇ������OH�A��dQ��.�95�Gcd�+7Y����%оeol�H�w��dg��N�����#�{ �e'� @����XL�} @�@��<- g5�S��H�T8���m?,��%�1O�>3���jQ ?��|-�ۘ @���������<�$���%/}�D�e|���J�@� ݱg���(?��|�M��n�(����Er�� @����hz���A @����Rz��ȟ�)�^+:; P��;"��=f���d�H��/_NxX�IXT8 @ yM��ME$@���ȵƚ4�⏩8��[q^�#���I ����#ɷ=&�}iʼ�V�6Ӛ�/�Hv�����X]��FM��T���GK� @���c}WZ��Nş_{=��0�Um�cF_K�[��'����)��WKu1��&Nř���"�����5��H^���ME$@��RX۹&�ȅ�3q���ġ����"���"P��[�f"�O� �0�p���O�|��=�Ӛu�w{�c @���Lhzd�� @���"�ܹ>R����0�^���[��鋚?p�%�j�z�?��)_~y������>����j�I7ź5i]q�t�� @���,��Q��7v Pi͝��W?����ώ��������������@�4�DO¯�N~yѺ�s�T�H&�8�~>�|�u�6ៗ��� ��t @���$��6$=���?g�����x���q~b�n{����h� � �N��~ST܉P5 �v(���X*�i�ꎦT"J��HV�!�p� @����ں5r#G"�Y����H�9������n����{�g�-��{mĩ���S�_P�{G|}�?��}&���µ���������w����]�%io @�� - x�B�C��$$����|�����=��#�oޢ�)�o��7Dg{�Kh�A�aYȭ�ʿ{�T�$��L\�<Vd.��'=���8;�:�痾SV�\�hY�!:�����,����h|��g1:����c���iCln���g @ ��ٮ�� @���E�v�OF'�"�"Y�]�3q����ۭȦ� �ա�>�Ȅ@nM��_�q&�>��B�U��}L䛵���*��g��Do���K������驸t�b\�p!�'��J���o�_eY�'�� @���������0��\om�wG���T�� �=}�9�H���'��@ct�k�3�ɽS����������r��ا��s�Q�5��Q���|a���z�q6�or\�~=f�g������7'P, @�@���� -N���%�5�X��C\H�����7@��}sHlٺ):��O�V�HK`u�|����=Ң�6����83q�m�#ۣ��� } @��*��2�U�%@���"�{�m]ʆ���� '�7_�_��O�ٹ��+oF�N��mkXs�=�};sq,�-��d�M����صMˣB� @��+/����H��$$�й=��H(Z�a毎�LJߎW����`�tL{7x��@` ��(��BK�M�"����h-%�} @��e��(�C @��� t<�76%pE"�ę�#�Ư_�C�OƴK?VD�A�I ��+*��ȝ��~I �zv�P�i����X9M���v$ @ �����|�lk�\��=�|\9o��xo��i��������UTXD�� -�m���� @��T���GE�M� @����۟�gwm��� -�~>F�ߋW^�S��t�G�M��N����������,�Q @���Z����*#��־���gvEG��e{v<>��o���X�T�0 T�@����rV��dz���"v�) @ k�Y��| @�����Z���_��=-%�)���ů���r&��,_`�R\v�����Y����V��./�� @�� -hz$�) �������qp�`tT�����ګ�b��Y9��A`����ڰ��mI���v�K�)�\�Q�J8> ����G�b @���h��O��xr��h���ff�⏿y+�^�$����@��M%�ʹ�p�_�-�}���?�^��:�-�?��z-�A��������s_��?���� -r��ï��^z*�<s���I��*�WLM�����C18�m��Z> ���T��?�����E���.P�����mf�\|��p��z�F�~"����x��A/Ne�BҪp���Ч��Ji��ؼ��������ي��@M� -,�� @�����:zch_�67g�����䩘���WG�Oý�����ۛ����^�����U"P��Ξ��ܿ)�;��Q%U5 @�.�w�� P� ͱa������D��:'O���l6��=9|8Noz>���.�G`��=b�=���O�DI痩x��9֯k��ή�Z�6�[�ב�I��H[@�#ma� @�����5wD���mw�l���7@����L�p$6�����8�$Y)��.'�jӺu��:��"�1�1?��=�h��9X��;c������F���C@��@&@��jO�f$��Q������ g31�����t�?��1�T��d'�j�u*���g��x��eb�.m��hiiZڦ�n5;s5���pr����_pU`QU�1 PM��TMc!@����2��d2FW���2|�xh�6W{$^mkS`:Ƨ��Ү�-{�&�듮��ݿ�oc���?��OƯ�<ɝ�����b��'V��B��dO�S���DF @�@Fr����?�b���y2�o�,�6S��WLp���DZ�&pe<Ɠ{�9?�\�m5S��I�;�0W|���ص���C�y��q���{nf @�@5 -hzTcU���H] .� �_~!~�ss������ב�����jA`� �a_k����nU���1nxt0Z���ƕ�c -G���M�J�� @���䢫0��W����X��vgΟ�dW!�0���&0��%�@lZk���(�� \9��ع�-�|������) @�4=*�HR$@��*A�.:zb�����M�O{5;�f.��C�Y��sS�&�������MY��tn� �ru��8=�pP� @�����x��G��T�@���?/��d�OuZ�����Qig�|�%0}�T\M8���� G�v:bף] 7������U�f��ȴ��G��#9 @�br�b��?�I��26z�������fc䳱�v���-�ݙj��ؠ�Z�FOҧ�E�+���= P���G�dv @��,U�9��=���}q��^��Gqd�&���ا1���8-���z��b9��7�6-gǻ�s潣1y�-<H���M�ꩥ� @���h�Ǟy2�y�o�>"��E��_���v�ظ>�<���{ ��m�_%8��'}eӽF�q @�@y4=��� @�@- 4䧺zbc�#��ד�*"���9w,N&}�G~�����3��h��w $~��#�I��'�* �=M���DF @�@ -���I��>{9.�V!�!HU`2><<���6DOs�aE�M���m1ؙ��|�q��a����)e� @��4=j��K���O�1�l�L��I�$�x�Ș��ߋ�r�ܼ1��I �Ŗ��&NM Ǒ�גJR @�@&4=2YI @���(�����Қ���eL�=4�I|^�|�-�y���/X�l���_â�~b?�~M�꯱ @��YX�J"� P�ӧ��N�2�\��趂y*��tÎ���Z�5OZT< @ [�٪�l @���jȭ���ߴ[�b�F �����7�D�xD~�G�K&OQ�.������~o��[ԼdB @���hzd�8R#@���M�.<����O�&����NL��h�g{�[�<%]a�wE�+BY���E��T�������FF��dN���j6٤� '�����������JS���*��:i�8���ٕ|b5O�TD @ ��(�$ @��������$_|ͭ�5���3HE�M��7_}'Ɠ���-���;c����T|��@s�`lL�\;�އ1�F�b @���(��QF|�&@�����O�Ǖ4B�s��D�k -��Ūs�;�j���x���j�����Sx�}�9^��1�{S -����c)��� P>M���;2 ���t�ݛ1|j8����ģ�p�ӥ�����u]�%�} pK`az,>��+�Ή�[w���g�����Tj��T ��hlk�����cQ�R�O��dM����UD> @��2����'�}k��رx糴�.^F�s�㳱d�h��2��j��������8s5���n�u<{zo}�3�h��H�X�,j>�Bd! @���h(�A�@��s�X�p�ӻ��-��E�X��H�¸��YX���^�C���S?�v��@�6�=��G�&>�κZ�>. (��\���$�Iv긻�%~��m��cwE�`Ju�1��yMz�������o�Ǻ5�R*�� @�� - -��U�L¡$-���/��R�a�#@���, -,Lġ�ގ�5<n�z��Q�p0vt��sƇ�wdn%������ܲ��X������щS+�������}��G��ϟ -Ͼ��8�ڑ��{�]aQ�-/��eG�#�C���)����qh�$�YoP�li$F���S`�b���;7<n�?r�8z�<K�/\�����Jr�;�G�gr�y�T1=q>>z�����_�?���Ѿyoy'|�+U�bc_��ؔ� -j��� @�@�G��I��$ 0;|�PL,q����S{�o{WlZ��+'��O�ݸ��Wl TK���v%.]���btt"����&V�9Ov-us�HU�{��h9s(�io.j���_�Y!S����nM�ꮯ� @�����=|��(v�����G�g{wEwk�O�&N�w���%�d��SSl���z�u.A)���y�u]��k31=u%&.O�_�ʼn��M��x�Mq`��n4�[��I�Q�@CW��?�?�͢��D��K�+� @���/�y����I���C�ڹx��1��cόƟ?-]�cp�C�՚[n�E��?G���EN�Ύ��I6�d��6���1�ba!Ѱ��k�����~A;=��#/��u�&�B�d�߮�_��__�����k������Mzu���.��\O�?0iL&TrnEXn��8� -o�uMk���|�5���r����9����#%�QX��\~Q��ڵ-Q�� @�@�4=�\��'@����>o�y$��<���Ļ�[��'����KxW�\L�?��8������m�����w?/���~c���Q;mƊ�k ����s�W��9�X���=��{��t��h��]]�Ƒ���?s8��y�E����XM�av @�T�o��8I_@1;5���ߢ>ڻzbcOo<�vM47���X���W.gO�����+��@��x�+×y�Z�r쟫�W��������b� &;���M���7?~-�$~��7����MvNx� @��K�~�T6$@���%�09o��x� ��g>&��ܼݺ?��M�cU�> -���/���O�333S����z��+Rn��� �qΏ� -hژ��jwU\�Q�R,I�1wo�3�FJ����5_L�} @�@%hzTB��H��jX`n�x��+w%��g͍�-+���g��R�\�@~��p=U�� -���z8�Fbx*��Y�<iQ� @����p=��8; - �����x�L �e���.M�k��N��r��z��{�E ���s� �!��H:ú����tb�J��HI@�#%Xa @����.�;f��q�ν��[�K?�D ��@[=�B��Z�QwȺ@]��Ji��¢�Y� @��?��% �-����bsK�r*G6��]�����vLU/���H<������U��bW������4-�7��W9�� @��U$��QE�4 P}����gbcS��l�#j��[��6$@`�-1�ā8�w[4/u�Ȳ@c_<�)�w -�\�|:˃� @�{M��-|E��dR�5{�����Gnc<�lZ���d�%E`E:6 ��������;V�AVL���G�=��}���\*�%@��$+�鑬�h @�@*�1�����Q�J�L������äV����*T 1~v�xzhs�b�B�&�b�b�@G1{,}[��/�ʖ @�@Y4=���� @���c�S/��MmKߥR�l�Ͻ�x�{�V��w��[�bh߁xq���nn�Xv�!��@��P�O6�w�,j��/ @���4����7ϰ��%r����\�.���/���{ @���t�oh���8����1��A��}Ӯ�����lY���U"�k�G}$�:McU%%5�% ��ஞ�pdtI[��7���*n7[ @����v�ZLNN.�W��1yy�� -;4|��W��X��;?V__��qG9 @��i -4wo�_ꍏ�}7F&�������m��i҉M��s��xh��ٺ��j��k\��o0��G��L�75����KLWD @�;��/��>���b��&�b�lK��dG��=v<����g��'br>;��I�����nk�f{��G{gO�?��;\)�=��jV�1ݵ9N�i$�o5߰��Z -�B @���hz�n( PF���m������>�#'�TԔW���w�<�+�[=%+�)�Е*�k��]�c���X�����J���Sh�|8�Fbx*�C�\�|S<����t�$@��J�v��v'@��� ����o{4��i|��H\���E�w���@N�|Q����s��}��ĪևrMmё_Wp}��v��hm��L��ڸ�h��{$>���D_�ʮ����������=> @���!�/�l�A @�@"���2��m�+����#qjl"�{�O�>:z����ѕ�u�k�U����X]lA�ꢰZD"��ץ�w���IDAT�FKZ��+����_.0�E.�*V56Fscs���-m-���MM��P��hEԯ���ϭ^�L����2�Ѻ-v���G�mu�������D��=n��- Pf����*����m��h���[����X�;s&Ύ���J�{�kʿ+�7zz�lO��5�?�~��Ϛ�F���_~��]ʱ���C=�c�_r�w�T��}�?}w� @��4=����C���.А_���m{���kW�ҥKqq|<.^�SWg��>�Z�c͚u�߹��'@�� @��+ ���A��dG���5�z��o�Z���٘���陯�k_��_ׯ_����?j�����)L]R��1W��Ս����4GssS��5D�&5��L @�� @�� - hz��� @��Y���\c�n벚�� @�� @���%xC��lB�� @�� @��d_@�#�5�! @�� @�� �M�% ل� @�� @��Ⱦ��G�k$C @�� @�� @` �K@� @�� @�� �}M���H� @�� @�� @��4=��d @�� @�� @ ��ٯ� @�� @�� @���%hz,�& @�� @�� @�@�4=�_# @�� @�� @��K��X�M @�� @�� @����hzd�F2$@�� @�� @��� а�m���ŋq���E�y�}�����<���}7�e���/���+6���Xf=������~����j @�� @��jD`vv6&._^��^'�o_'-��zwCò_�_1���ڵkq�����~����s�څ��1��|3�ڛ�O������X�J���^ӣҋ( @�� @��)LNNơC�R>Jy�?�����7��>��q�ȑ�P|h�[of @�� @�� @ ��,�� @�� @�� @����4=�7� @�� @�� �AM�EJ @�� @�� @�@��śك� @�� @��Ƞ@��ׯg�)ٔn�H6`Ƣ�~�u�2� @�� @��Ԃ@C�y���|J�e-�DK4^ւ]�Z 5���S�� � @�� @���]`rr���������hkk��q�ХK�n}��ϙkzdFF" @�� @���x�,��<˹%U��ka�Iy�'s�[�>$ @�� @�� @���Z���Ū3 @�� @���BM�*,�! @�� @�� @���Z���Ū3 @�� @���B��5=��R���! @�� @�� @�������O�(��#����������faaa%s�uu�륭���� @�� @���% �_�>��疴mR�X��T�%����X�v��Q�ƾȭ�-+���E -�hXV6v*I�M�r�$$; @�� @�� P������ÏT��}p�֭��-Kޒ��jȅ� @�� @��X���Dz��H�� @�� @��dI@�#KՐ @�� @�� �lM�e�ّ� @�� @��Ȓ��G��! @�� @�� @`��˦�# @�� @�� �%M�,UC. @�� @�� @���4=�MgG @�� @�� @ K YJF.��ꫯ���;�kkm����{~���V�^}�}=@�� @�� @������f]dU�����?^V�={�Ć��e�k' @�� @��+%Px���o���í�Z{��]־v"�e������F�� @�� @��% ܈%�ogY���je�E�� @�� @��%��Q�� @�� @�� @���� -hzd�2�"@�� @�� @�����(��� @�� @�� @�@V4=�Zy @�� @�� @��E hz�ec @�� @�� @ ��Y��� @�� @�� @����4=��1 @�� @�� �UM��VF^ @�� @�� @�@Q�Eq٘� @�� @��Ȫ��GV+#/ @�� @�� @�(M���lL�� @�� @��dU@�#��� @�� @�� P���GQ\6&@�� @�� @���*����ȋ� @�� @��(J@ӣ(. @�� @�� @��Y���je�E�� @�� @��%��Q�� @�� @�� @���� -hzd�2�"@�� @�� @���h(jk���W����Gz������^���U٣���q��������[���-�yժU��7 @�� @�����X���Y����(ܒ�ؽkW���%6�� -�gϞ�t�I'���=��ۛtX� @�� @�Jfff��_/��������8P�1��W�o�}뭷�u��o�Û;oܸ���v"P���\]c#@�� @�� p�r�`�P�/��Ǽ��p�J����$�鑤�X @�� @�� @�@�4=�F�� @�� @�� @�@��Ij�E�� @�� @���M@ӣl�L�� @�� @��$)�鑤�X @�� @�� @�@�4=�F��i -܈i�_V�K�.-k�J�ibb���_V��//k?; @�� @�@m -\�~��>;;[sc�v�Z͍ـ �K��\v\�&�M澚���k>�^��C��:�n�� @��X1���{n~~a�F������SYy�r���\NoǮmWz�v���� @�� @��T���GՔ�@ @�� @�� @�@mhz�v���� @�� @��T���GՔ�@ @�� @�� @�@mhz�v���� @�� @��T�@CՌ�@�@���3�7����侼7�lC�e�W�;mٲ%����2���������,�uP @���L�\.---eI�ƍ��Qj��1��GcSc4��a/���{l͚5����*R@ӣ"�&�{ ������н6�x�[6oI�� @�� @����hnn����A���k���s�=w��l@�@���*�P @�� @�� @ �(� @�� @�� @����4=J7�� @�� @��Ȁ��G� @�� @�� @�tM�� E @�� @�� @��2 �鑁"H�� @�� @��(]@ӣtC @�� @�� @���hzd�R @�� @�� @��J��(�P @�� @�� @ �(� @�� @�� @����4=J7�� @�� @��Ȁ��G� @�� @�� @�tM�� E @�� @�� @��2 �鑁"H�� @�� @��(]@ӣtC @�� @�� @���hzd�R @�� @�� @��J��(�P @�� @�� @ �(� @�� @�� @����4=J7�� @�� @��Ȁ��G� @�� @�� @�tM�� E @�� @�� @��2 �鑁"H�� @�� @��(]@ӣtC @�� @�� @���hzd�R @�� @�� @��J��(�P @�� @�� @ �(� @�� @�� @����4=J7�� @�� @��Ȁ��G� @�� @�� @�tM�� E @�� @�� @��2 �鑁"H�� @�� @��(]@ӣtC @�� @�� @���hzd�R @�� @�� @��J��(�P @�� @�� @ �(� @�� @�� @����4=J7�� @�� @��Ȁ��G� @�� @�� @�tM�� E @�� @�� @��2 �鑁"H�� @�� @��(]@ӣtC @�� @�� @���hzd�R @�� @�� @��J��(�P @�� @�� @ �(� @�� @�� @����4=J7�� @�� @��Ȁ��G� @�� @�� @�tM�� E @�� @�� @��2 �鑁"H�� @�� @��(]@ӣtC @�� @�� @���hzd�R @�� @�� @��J��(�P @�� @�� @ �(� @�� @�� @����4=J7�� @�� @��Ȁ��G� @�� @�� @�tM�� E @�� @�� @��2 �鑁"H�� @�� @��(]���" @�@�|u�z�߿9V�Ð? @��5,p��D ��� @�����- � P��_�����~P��N�� @�� P ����* @�� @�� �N @�� @�� @�*4=���A�� @�� @��hz8 @�� @�� @��������2 @�� @�� ��� @�� @�� @���B@ӣ*�h @�� @�� @����s�� @�� @��� -M��(�A @�� @�� @���� @�� @�� @�*4=���A�� @�� @��hz8 @�� @�� @��������2 @�� @�� ��� @�� @�� @���B��*Fa�q�֖�x`ms�+> @���/�n�����gOdG����g�c������IEND�B`� \ No newline at end of file diff --git a/web/modules/flexslider/flexslider.api.php b/web/modules/flexslider/flexslider.api.php deleted file mode 100644 index dd32dd9ae0214440a5378ee65299122b5be1413b..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.api.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/** - * @file - * API documentation for FlexSlider. - * - * By design, FlexSlider should be entirely configurable from the web interface. - * However some implementations may require to access the FlexSlider library - * directly by using flexslider_add(). This will return an attached array that - * you may add to a render array. - * - * Here are some sample uses of flexslider_add(). - */ - -/** - * Attach flexslider to an element using the specified option set. - * - * This call will look for an HTML element with id attribute of "my_image_list" - * and return the JS settings to initialize FlexSlider on it using the option - * set named "default". - */ -$attached = flexslider_add('my_image_list', 'default'); - -/** - * Attach flexslider to an element using the library defaults. - * - * You also have the option of skipping the option set parameter if you want - * to run with the library defaults. - */ -$attached = flexslider_add('my_image_list'); - -/** - * Attach the flexslider library. - * - * Finally, you can simply attach the library. - * This method would assume you would take care of - * initializing a FlexSlider instance in your theme or custom javascript - * file. - * - * Ex: $('#slider').flexslider(); - */ -$attached = flexslider_add(); diff --git a/web/modules/flexslider/flexslider.info.yml b/web/modules/flexslider/flexslider.info.yml deleted file mode 100644 index e8228c16e2143aad873ef791795111c9baf84f5c..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: FlexSlider -description: 'Integrate the FlexSlider 2 library with Drupal' -# core: 8.x -package: FlexSlider -dependencies: - - image - - libraries -type: module -configure: entity.flexslider.collection - -# Information added by Drupal.org packaging script on 2017-02-14 -version: '8.x-2.0-alpha2' -core: '8.x' -project: 'flexslider' -datestamp: 1487036906 diff --git a/web/modules/flexslider/flexslider.install b/web/modules/flexslider/flexslider.install deleted file mode 100644 index 293c40cb406be22fd23b5cc017909fe7d9c510fa..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.install +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * @file - * Installation actions for FlexSlider. - */ - -/** - * Implements hook_uninstall(). - * - * Deletes all content and configuration installed by this module. - */ -function flexslider_uninstall() { - // Delete all of the configuration installed by this module. - $dir = drupal_get_path('module', 'flexslider') . '/config/install'; - $files = file_scan_directory($dir, '/.*/'); - foreach ($files as $file) { - \Drupal::configFactory()->getEditable($file->name)->delete(); - } - \Drupal::logger('flexslider')->info(t('Deleted flexslider configuration'), array()); -} - -/** - * Implements hook_requirements(). - */ -function flexslider_requirements($phase) { - $requirements = array(); - - // Check to see if the flexslider library is available. - if ($phase == 'runtime') { - $library = libraries_detect('flexslider'); - if ($library && !empty($library['installed'])) { - if ($library['version']) { - $description = t('Version %i installed', array('%i' => $library['version'])); - } - else { - $description = t('Unable to detect version.'); - } - $requirements['flexslider'] = array( - 'title' => t('FlexSlider'), - 'description' => $description, - 'severity' => REQUIREMENT_OK, - ); - } - else { - $requirements['flexslider'] = array( - 'title' => t('FlexSlider'), - 'description' => t('FlexSlider library not found. Please consult the README.md for installation instructions.'), - 'severity' => REQUIREMENT_ERROR, - ); - } - } - return $requirements; -} diff --git a/web/modules/flexslider/flexslider.libraries.yml b/web/modules/flexslider/flexslider.libraries.yml deleted file mode 100644 index 8ab4ecf95b597efcb64eaccc27df6e6865cdf67b..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.libraries.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Library definitions for flexslider module. -# The path to the actual FlexSlider library assets are defined in -# hook_library_alter_info. - -flexslider: - remote: http://flexslider.woothemes.com - license: - name: GNU-GPL-2.0-or-later - url: https://github.com/woothemes/FlexSlider/blob/master/LICENSE.md - gpl-compatible: true - js: - jquery.flexslider-min.js: { minified: true } - css: - component: - flexslider.css: {} - -integration: - js: - assets/js/flexslider.load.js: {} - css: - theme: - assets/css/flexslider_img.css: {} - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings - - core/jquery.once - - flexslider/flexslider diff --git a/web/modules/flexslider/flexslider.links.action.yml b/web/modules/flexslider/flexslider.links.action.yml deleted file mode 100644 index 0253a9116be5c7eaba73399aa29b0a69c01fd025..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.flexslider.add_form: - route_name: 'entity.flexslider.add_form' - title: 'Add optionset' - appears_on: - - entity.flexslider.collection diff --git a/web/modules/flexslider/flexslider.links.menu.yml b/web/modules/flexslider/flexslider.links.menu.yml deleted file mode 100644 index ae00c927ac4478ce9c0520f9d112447e2c6e35a9..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.links.menu.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Flexslider optionset menu items definition -entity.flexslider.collection: - title: 'FlexSlider' - description: 'Configure optionsets and advanced settings.' - route_name: entity.flexslider.collection - parent: system.admin_config_media - weight: 99 diff --git a/web/modules/flexslider/flexslider.links.task.yml b/web/modules/flexslider/flexslider.links.task.yml deleted file mode 100644 index 8e141991f106817b2099147bafda99a3349f858c..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.links.task.yml +++ /dev/null @@ -1,10 +0,0 @@ -entity.flexslider.collection: - title: 'List' - route_name: entity.flexslider.collection - base_route: entity.flexslider.collection - -flexslider.form_settings: - title: 'Advanced settings' - route_name: flexslider.form_settings - base_route: entity.flexslider.collection - weight: 2 diff --git a/web/modules/flexslider/flexslider.make.example b/web/modules/flexslider/flexslider.make.example deleted file mode 100644 index 2f99548a94c468854eccd8f54b2bbdb80984b79a..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.make.example +++ /dev/null @@ -1,9 +0,0 @@ -; FlexSlider - -api = 2 -core = 8.x - -libraries[flexslider][download][type] = "get" -libraries[flexslider][download][url] = "https://github.com/woothemes/FlexSlider/zipball/master" -libraries[flexslider][directory_name] = "flexslider" -libraries[flexslider][type] = "library" diff --git a/web/modules/flexslider/flexslider.module b/web/modules/flexslider/flexslider.module deleted file mode 100644 index ae046278b97e6e050cb1df1ca4f527c429f163cd..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.module +++ /dev/null @@ -1,278 +0,0 @@ -<?php - -/** - * @file - * A light-weight, customizable image gallery plugin for Drupal based on jQuery. - */ - -use Drupal\Core\Url; -use Drupal\flexslider\Entity\Flexslider; - -define("FLEXSLIDER_VERSION", \Drupal::config('flexslider.settings')->get('flexslider_version')); -define("FLEXSLIDER_DEBUG", \Drupal::config('flexslider.settings')->get('flexslider_debug')); - -/** - * Implements hook_libraries_info(). - */ -function flexslider_libraries_info() { - $libraries['flexslider'] = array( - 'name' => 'FlexSlider', - 'vendor url' => 'http://www.woothemes.com/flexslider/', - 'download url' => 'https://github.com/woothemes/FlexSlider', - 'version arguments' => array( - 'file' => 'jquery.flexslider-min.js', - // e.g. jQuery FlexSlider v2.1. - 'pattern' => '/jQuery FlexSlider v(\d+\.+\d+(\.+\d+)?)/', - 'lines' => 2, - ), - 'files' => array( - 'js' => array( - 'jquery.flexslider-min.js', - ), - 'css' => array( - 'flexslider.css', - ), - ), - ); - - return $libraries; -} - -/** - * Implements hook_libraries_info_alter(). - */ -function flexslider_libraries_info_alter(&$libraries) { - $debug = FLEXSLIDER_DEBUG; - if ($debug) { - // Switch to the unminified version of the library. - if (isset($libraries['flexslider'])) { - $libraries['flexslider']['files']['js'] = array( - 'jquery.flexslider.js', - ); - } - } - - // Add support for jQuery Easing module. - if (\Drupal::moduleHandler()->moduleExists('jqeasing')) { - $libraries['flexslider']['dependencies'][] = 'easing (>=1.3)'; - } -} - -/** - * Implements hook_library_info_alter(). - */ -function flexslider_library_info_alter(&$libraries, $extension) { - if ($extension == 'flexslider' and isset($libraries['flexslider'])) { - $library_path = libraries_get_path('flexslider'); - if (strpos($library_path, '/') !== 0) { - $library_path = '/' . $library_path; - } - - // Set the correct path to where the library was downloaded. - $libraries['flexslider']['js'][$library_path . '/jquery.flexslider-min.js'] = $libraries['flexslider']['js']['jquery.flexslider-min.js']; - unset($libraries['flexslider']['js']['jquery.flexslider-min.js']); - - $libraries['flexslider']['css']['component'][$library_path . '/flexslider.css'] = $libraries['flexslider']['css']['component']['flexslider.css']; - unset($libraries['flexslider']['css']['component']['flexslider.css']); - - // Enable debug mode. - if (FLEXSLIDER_DEBUG) { - // Add the unminified version. - $libraries['flexslider']['js'] = array( - $library_path . '/jquery.flexslider.js' => array(), - ); - } - - // Add support for jQuery Easing module. - if (\Drupal::moduleHandler()->moduleExists('jqeasing')) { - // Using the jqeasing module. - $libraries['flexslider']['dependencies'][] = 'jqeasing.easing'; - } - - } -} - -/** - * Implements hook_help(). - */ -function flexslider_help($route_name, $route_match) { - - switch ($route_name) { - case 'help.page.flexslider': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('The FlexSlider module integrates the FlexSlider library into Drupal. For more information about the library, see the <a href=":docs" target="_new">FlexSlider documentation</a>', array('@docs' => Url::fromUri('http://www.woothemes.com/flexslider/')->getUri())) . '</p>'; - $output .= '<h3>' . t('Terminology') . '</h3>'; - $output .= '<dl>'; - $output .= '<dt>' . t('Option set') . '</dt>'; - $output .= '<dd>' . t('An option set defines all the settings for displaying the slider. Things like slide direction, speed, starting slide, etc... You can define as many option sets as you like and on top of that they are all exportable! Which means you can carry configuration of your Flex Slider instances from one site to the next or create features.') . '</dd>'; - $output .= '</dl>'; - $output .= '<h3>' . t('Uses') . '</h3>'; - $output .= '<dl>'; - $output .= '<dt>' . t('Defining option sets') . '</dt>'; - $output .= '<dd>' . t('No matter how you want to use FlexSlider (with fields or views) you need to define "option sets" to tell FlexSlider how you want it to display. Go to the <a href=":flexslider_admin">flexslider administration page</a>. From there you can edit the default option set and define new ones. These will be listed as options in the various forms where you setup FlexSlider to display. NOTE: under advanced options, you can set a namespace prefix for the optionset. This will allow you to build custom CSS for each optionset. Start by copying the flexslider_img.css from the assets subfolder to your theme. Build new custom CSS for each prefix in your optionsets.', array(':flexslider_admin' => Url::fromRoute('entity.flexslider.collection')->getInternalPath())) . '</dd>'; - $output .= '<dt>' . t('Configuring FlexSlider field') . '</dt>'; - $output .= '<dd>' . t('The flexslider_fields module provides a way for you to turn a multi-file image field into a FlexSlider. Simply go to the "Manage Display" page of the Content type (or other Entity) containing your field and set the Format of the field to FlexSlider. There you can select your preferred option set and image style. The Responsive FlexSlider formatter is also available when core Responsive Image module is enabled.') . '</dd>'; - $output .= '<dt>' . t('Configuring FlexSlider view style') . '</dt>'; - $output .= '<dd>' . t('Flex Slider Views (flexslider_views module) allows you to build views which display their results in Flex Slider. Similar to how you can output fields as an "HTML List" or "Table", you can now select "Flex Slider" as an option. Create or edit a view and ensure it can load a content type which contain image fields. Set your display fields to include an image field. In the field settings, DO NOT SET THE FORMATTER TO FLEXSLIDER. This will attempt to put Flex Sliders inside other Flex Sliders and will just get messy. Ensure you don\'t include any wrapper markup, labels or container markup for the field value itself. Save your field. Next, go to "Format" in the main Views windows. Click and select "Flex Slider", then select your option set. Save your view and you should see your results displayed in Flex Slider.') . '</dd>'; - $output .= '<dt>' . t('Attaching the library') . '</dt>'; - $output .= '<dd>' . t('The flexslider_add() function may be used in multiple ways to manually attach the library to any render array, such as a page or block.') . '</dd>'; - $output .= '</dl>'; - return $output; - - case 'entity.flexslider.collection': - $output = ''; - $output .= t('An <em>option set</em> defines exactly how a flexslider image gallery looks and behaves on your site.'); - $output .= '<br/>'; - $output .= t('For a full documentation of all options, refer to the official <a href=":docs" target="_new">FlexSlider documentation</a>.', array('@docs' => Url::fromUri('http://www.woothemes.com/flexslider/')->getUri())); - return - '<p>' . $output . '</p>'; - } -} - -/** - * Implements hook_theme(). - */ -function flexslider_theme() { - return array( - // Flexslider container. - 'flexslider' => array( - 'variables' => array('flexslider' => array()), - 'file' => 'templates/flexslider.theme.inc', - ), - - // Slide container. - 'flexslider_list' => array( - 'variables' => array('items' => array(), 'settings' => array()), - 'file' => 'templates/flexslider.theme.inc', - ), - - // Slide item. - 'flexslider_list_item' => array( - 'variables' => array( - 'item' => array(), - 'settings' => array(), - 'caption' => '', - ), - 'file' => 'templates/flexslider.theme.inc', - ), - ); -} - -/** - * Gets an array of option sets suitable for using as select list options. - * - * @return array - * Array of optionset labels keyed by id - */ -function flexslider_optionset_list() { - $optionsets = Flexslider::loadMultiple(); - $options = array(); - foreach ($optionsets as $name => $optionset) { - $options[$name] = $optionset->label(); - } - - if (empty($options)) { - $options[''] = t('No defined option sets'); - } - return $options; -} - -/** - * Returns array of required JavaScripts and settings for a flexslider instance. - * - * @param string $id - * optional ID Attribute for FlexSlider container. - * @param object $optionset - * optional Option set to load or the machine name of an existing optionset. - * - * @return array - * Array of asset attachments. - */ -function flexslider_add($id = NULL, $optionset = NULL) { - - $attached = []; - - // Check optionset value. - if (is_string($optionset)) { - $name = $optionset; - $optionset = Flexslider::load($name); - if (empty($optionset)) { - \Drupal::logger('flexslider')->warning('Invalid optionset name supplied to flexslider_add: @name', array('@name' => $name)); - return $attached; - } - } - - // Static array to remember which scripts are already attached. - // @todo not currently in use - $cache = &drupal_static(__FUNCTION__, array()); - - $attached['library'][] = 'flexslider/integration'; - - // If the ID or optionset aren't set, it is assumed the settings will be set - // manually via the calling module/theme. - if (!empty($optionset) && !in_array($optionset->id(), $cache)) { - $cache[] = $optionset->id(); - $attached['drupalSettings']['flexslider']['optionsets'] = array( - $optionset->id() => $optionset->getOptions(TRUE), - ); - } - - if (!empty($id)) { - // JavaScript settings. - $attached['drupalSettings']['flexslider']['instances'] = array( - $id => $optionset ? $optionset->id() : '-1', - ); - // Create an empty optionset setting if none given. - if (empty($optionset)) { - $attached['drupalSettings']['flexslider']['optionsets'] = array( - '-1' => [], - ); - } - } - - return $attached; -} - -/** - * List of all easing methods available from jQuery Easing v1.3. - * - * @return array - * Array of easing methods - */ -function _flexslider_jqeasing_options() { - return array( - "jswing" => "jswing", - "def" => "def", - "easeInQuad" => "easeInQuad", - "easeOutQuad" => "easeOutQuad", - "easeInOutQuad" => "easeInOutQuad", - "easeInCubic" => "easeInCubic", - "easeOutCubic" => "easeOutCubic", - "easeInOutCubic" => "easeInOutCubic", - "easeInQuart" => "easeInQuart", - "easeOutQuart" => "easeOutQuart", - "easeInOutQuart" => "easeInOutQuart", - "easeInQuint" => "easeInQuint", - "easeOutQuint" => "easeOutQuint", - "easeInOutQuint" => "easeInOutQuint", - "easeInSine" => "easeInSine", - "easeOutSine" => "easeOutSine", - "easeInOutSine" => "easeInOutSine", - "easeInExpo" => "easeInExpo", - "easeOutExpo" => "easeOutExpo", - "easeInOutExpo" => "easeInOutExpo", - "easeInCirc" => "easeInCirc", - "easeOutCirc" => "easeOutCirc", - "easeInOutCirc" => "easeInOutCirc", - "easeInElastic" => "easeInElastic", - "easeOutElastic" => "easeOutElastic", - "easeInOutElastic" => "easeInOutElastic", - "easeInBack" => "easeInBack", - "easeOutBack" => "easeOutBack", - "easeInOutBack" => "easeInOutBack", - "easeInBounce" => "easeInBounce", - "easeOutBounce" => "easeOutBounce", - "easeInOutBounce" => "easeInOutBounce", - ); -} diff --git a/web/modules/flexslider/flexslider.permissions.yml b/web/modules/flexslider/flexslider.permissions.yml deleted file mode 100644 index 5eb446911ed5b288d8f863a0aac503a024532116..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -administer flexslider: - title: 'Administer the FlexSlider module' diff --git a/web/modules/flexslider/flexslider.routing.yml b/web/modules/flexslider/flexslider.routing.yml deleted file mode 100644 index 393d83c593d498574d880dc9952ee7afbecd253f..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider.routing.yml +++ /dev/null @@ -1,68 +0,0 @@ -flexslider.form_settings: - path: /admin/config/media/flexslider/advanced - defaults: - _title: 'FlexSlider Advanced settings' - _form: \Drupal\flexslider\Form\FlexsliderFormSettings - requirements: - _permission: 'administer flexslider' - -# Flexslider optionset routing definition -entity.flexslider.collection: - path: '/admin/config/media/flexslider' - defaults: - _entity_list: 'flexslider' - _title: 'FlexSlider' - requirements: - _permission: 'administer flexslider' - options: - _admin_route: TRUE - -entity.flexslider.add_form: - path: '/admin/config/media/flexslider/add' - defaults: - _entity_form: 'flexslider.add' - _title: 'Add optionset' - requirements: - _permission: 'administer flexslider' - options: - _admin_route: TRUE - -entity.flexslider.edit_form: - path: '/admin/config/media/flexslider/{flexslider}' - defaults: - _entity_form: 'flexslider.edit' - _title: 'Edit optionset' - requirements: - _permission: 'administer flexslider' - options: - _admin_route: TRUE - -entity.flexslider.delete_form: - path: '/admin/config/media/flexslider/{flexslider}/delete' - defaults: - _entity_form: 'flexslider.delete' - _title: 'Delete optionset' - requirements: - _permission: 'administer flexslider' - options: - _admin_route: TRUE - -entity.flexslider.enable: - path: '/admin/config/media/flexslider/{flexslider}/enable' - defaults: - _controller: '\Drupal\flexslider\Controller\FlexsliderOptionsetController::enable' - entity_type: 'flexslider' - requirements: - _permission: 'administer flexslider' - options: - _admin_route: TRUE - -entity.flexslider.disable: - path: '/admin/config/media/flexslider/{flexslider}/disable' - defaults: - _controller: '\Drupal\flexslider\Controller\FlexsliderOptionsetController::disable' - entity_type: 'flexslider' - requirements: - _permission: 'administer flexslider' - options: - _admin_route: TRUE diff --git a/web/modules/flexslider/flexslider_example/README.txt b/web/modules/flexslider/flexslider_example/README.txt deleted file mode 100644 index f5a24906746f05b301f325154a434cf84f6e4e50..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/README.txt +++ /dev/null @@ -1,40 +0,0 @@ -FlexSlider Example -================== - -INTRODUCTION ------------------- - -Contains sample configurations for FlexSlider as demonstrated at -http://flexslider.woothemes.com/. You can use these as a starting point for -creating your own FlexSlider configurations. - -This module creates the following Drupal features: - * FlexSlider example Content Type with 2 image fields - * Option sets for each example - * FlexSlider example View with displays for each example - * FlexSlider example Menu - * Sample content - -REQUIREMENTS ------------------- - -- FlexSlider Views -- FlexSlider Fields -- FlexSlider - -INSTALLATION ------------------ - - * Install as you would normally install a contributed Drupal module. See: - https://drupal.org/documentation/install/modules-themes/modules-8 - for further information. - - * You should make sure your toolbar is visible via the Toolbar module or some - other module that constructs the toolbar. - -CONFIGURATION --------------------- - -The module has no modifiable settings. There is no configuration. When -enabled, the module will provide a FlexSlider Examples menu in the toolbar. When -disabled, the module will remove all installed features. diff --git a/web/modules/flexslider/flexslider_example/config/install/core.entity_form_display.node.flexslider_example.default.yml b/web/modules/flexslider/flexslider_example/config/install/core.entity_form_display.node.flexslider_example.default.yml deleted file mode 100644 index ee631629e8c23fabedabe14587d06c667140ef6f..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/core.entity_form_display.node.flexslider_example.default.yml +++ /dev/null @@ -1,67 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.flexslider_example.field_flexslider_example_image - - field.field.node.flexslider_example.field_flexslider_example_slidesh - - node.type.flexslider_example - module: - - image - - path -id: node.flexslider_example.default -targetEntityType: node -bundle: flexslider_example -mode: default -content: - created: - type: datetime_timestamp - weight: 10 - settings: { } - third_party_settings: { } - field_flexslider_example_image: - weight: 31 - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - type: image_image - field_flexslider_example_slidesh: - weight: 32 - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - type: image_image - path: - type: path - weight: 30 - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - third_party_settings: { } - title: - type: string_textfield - weight: -5 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/web/modules/flexslider/flexslider_example/config/install/core.entity_view_display.node.flexslider_example.default.yml b/web/modules/flexslider/flexslider_example/config/install/core.entity_view_display.node.flexslider_example.default.yml deleted file mode 100644 index e97e6bedba38a65e42dcc4adc650dc62c0232eca..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/core.entity_view_display.node.flexslider_example.default.yml +++ /dev/null @@ -1,28 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.flexslider_example.field_flexslider_example_image - - field.field.node.flexslider_example.field_flexslider_example_slidesh - - node.type.flexslider_example - module: - - flexslider_fields - - user -id: node.flexslider_example.default -targetEntityType: node -bundle: flexslider_example -mode: default -content: - field_flexslider_example_slidesh: - weight: 0 - label: above - settings: - optionset: flexslider_default_thumbnail_slider - image_style: '' - caption: '1' - image_link: '' - third_party_settings: { } - type: flexslider -hidden: - field_flexslider_example_image: true - links: true diff --git a/web/modules/flexslider/flexslider_example/config/install/field.field.node.flexslider_example.field_flexslider_example_image.yml b/web/modules/flexslider/flexslider_example/config/install/field.field.node.flexslider_example.field_flexslider_example_image.yml deleted file mode 100644 index 2bc37807701237c76d0258804e14dbf85d623494..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/field.field.node.flexslider_example.field_flexslider_example_image.yml +++ /dev/null @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_flexslider_example_image - - node.type.flexslider_example - module: - - image -id: node.flexslider_example.field_flexslider_example_image -field_name: field_flexslider_example_image -entity_type: node -bundle: flexslider_example -label: 'FlexSlider Example Image' -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - file_directory: flexslider_example - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: false - alt_field_required: false - title_field: false - title_field_required: false - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff --git a/web/modules/flexslider/flexslider_example/config/install/field.field.node.flexslider_example.field_flexslider_example_slidesh.yml b/web/modules/flexslider/flexslider_example/config/install/field.field.node.flexslider_example.field_flexslider_example_slidesh.yml deleted file mode 100644 index 8c5f0ae6f03412a95107f050eed6f655dbe9e6af..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/field.field.node.flexslider_example.field_flexslider_example_slidesh.yml +++ /dev/null @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_flexslider_example_slidesh - - node.type.flexslider_example - module: - - image -id: node.flexslider_example.field_flexslider_example_slidesh -field_name: field_flexslider_example_slidesh -entity_type: node -bundle: flexslider_example -label: 'FlexSlider Example Slideshow' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: flexslider_example - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: false - alt_field_required: false - title_field: true - title_field_required: false - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff --git a/web/modules/flexslider/flexslider_example/config/install/field.storage.node.field_flexslider_example_image.yml b/web/modules/flexslider/flexslider_example/config/install/field.storage.node.field_flexslider_example_image.yml deleted file mode 100644 index 0cc61c780d0ffd17c7dcb81022ac7c52aeaec6ae..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/field.storage.node.field_flexslider_example_image.yml +++ /dev/null @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_flexslider_example_image -field_name: field_flexslider_example_image -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/flexslider/flexslider_example/config/install/field.storage.node.field_flexslider_example_slidesh.yml b/web/modules/flexslider/flexslider_example/config/install/field.storage.node.field_flexslider_example_slidesh.yml deleted file mode 100644 index 5c872874ca7474699256e5ad9c67a419b3e1b485..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/field.storage.node.field_flexslider_example_slidesh.yml +++ /dev/null @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_flexslider_example_slidesh -field_name: field_flexslider_example_slidesh -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_carousel_with_min_and_max_ranges.yml b/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_carousel_with_min_and_max_ranges.yml deleted file mode 100644 index ff5ce5a8f60b93572042227db0d9e34022bb2741..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_carousel_with_min_and_max_ranges.yml +++ /dev/null @@ -1,46 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: flexslider_carousel_with_min_and_max_ranges -label: 'FlexSlider carousel with min and max ranges' -options: - animation: slide - animationSpeed: 600 - direction: horizontal - slideshow: false - easing: swing - smoothHeight: false - reverse: false - slideshowSpeed: 7000 - animationLoop: false - randomize: false - startAt: 0 - itemWidth: 210 - itemMargin: 5 - minItems: 2 - maxItems: 4 - move: 0 - directionNav: true - controlNav: '1' - thumbCaptions: false - thumbCaptionsBoth: false - keyboard: true - multipleKeyboard: false - mousewheel: false - touch: true - prevText: Previous - nextText: Next - namespace: flex- - selector: '.slides > li' - sync: '' - asNavFor: '' - initDelay: 0 - useCSS: true - video: false - pausePlay: false - pauseText: Pause - playText: Play - pauseOnAction: true - pauseOnHover: false - controlsContainer: .flex-control-nav-container - manualControls: '' diff --git a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_basic_carousel.yml b/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_basic_carousel.yml deleted file mode 100644 index f023afd984ac39e6c937fca8087a38205decb74f..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_basic_carousel.yml +++ /dev/null @@ -1,46 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: flexslider_default_basic_carousel -label: 'Basic Carousel' -options: - animation: slide - animationSpeed: 600 - direction: horizontal - slideshow: true - easing: swing - smoothHeight: false - reverse: false - slideshowSpeed: 7000 - animationLoop: false - randomize: false - startAt: 0 - itemWidth: 210 - itemMargin: 5 - minItems: 2 - maxItems: 2 - move: 0 - directionNav: true - controlNav: '1' - thumbCaptions: false - thumbCaptionsBoth: false - keyboard: true - multipleKeyboard: false - mousewheel: false - touch: true - prevText: Previous - nextText: Next - namespace: flex- - selector: '.slides > li' - sync: '' - asNavFor: '' - initDelay: 0 - useCSS: true - video: false - pausePlay: true - pauseText: Pause - playText: Play - pauseOnAction: true - pauseOnHover: true - controlsContainer: .flex-control-nav-container - manualControls: '' diff --git a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_slider_thumbnail_controlnav.yml b/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_slider_thumbnail_controlnav.yml deleted file mode 100644 index e7e71dde55040df2ab65bbfd4607abd34018ffe6..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_slider_thumbnail_controlnav.yml +++ /dev/null @@ -1,46 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: flexslider_default_slider_thumbnail_controlnav -label: 'slider w/thumbnail controlnav pattern' -options: - animation: slide - animationSpeed: 600 - direction: horizontal - slideshow: true - easing: swing - smoothHeight: true - reverse: false - slideshowSpeed: 7000 - animationLoop: true - randomize: false - startAt: 0 - itemWidth: 0 - itemMargin: 0 - minItems: 0 - maxItems: 0 - move: 0 - directionNav: true - controlNav: thumbnails - thumbCaptions: false - thumbCaptionsBoth: false - keyboard: true - multipleKeyboard: false - mousewheel: false - touch: true - prevText: Previous - nextText: Next - namespace: flex- - selector: '.slides > li' - sync: '' - asNavFor: '' - initDelay: 0 - useCSS: true - video: false - pausePlay: false - pauseText: Pause - playText: Play - pauseOnAction: true - pauseOnHover: true - controlsContainer: .flex-control-nav-container - manualControls: '' diff --git a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_slider_w_thumbnail_slider.yml b/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_slider_w_thumbnail_slider.yml deleted file mode 100644 index 5a515204d293f1185c3ae6756c2134cde306a2b8..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_slider_w_thumbnail_slider.yml +++ /dev/null @@ -1,46 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: flexslider_default_slider_w_thumbnail_slider -label: 'Slider w/thumbnail slider' -options: - animation: slide - animationSpeed: 600 - direction: horizontal - slideshow: false - easing: swing - smoothHeight: false - reverse: false - slideshowSpeed: 7000 - animationLoop: false - randomize: false - startAt: 0 - itemWidth: 0 - itemMargin: 0 - minItems: 0 - maxItems: 0 - move: 0 - directionNav: true - controlNav: '0' - thumbCaptions: false - thumbCaptionsBoth: false - keyboard: true - multipleKeyboard: false - mousewheel: false - touch: true - prevText: Previous - nextText: Next - namespace: flex- - selector: '.slides > li' - sync: '#flexslider-2' - asNavFor: '' - initDelay: 0 - useCSS: true - video: false - pausePlay: false - pauseText: Pause - playText: Play - pauseOnAction: true - pauseOnHover: false - controlsContainer: .flex-control-nav-container - manualControls: '' diff --git a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_thumbnail_captions.yml b/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_thumbnail_captions.yml deleted file mode 100644 index c88bf3d1a5bfc1952d8c8be1707b93627c57998a..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_thumbnail_captions.yml +++ /dev/null @@ -1,46 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: flexslider_default_thumbnail_captions -label: 'FlexSlider Default Thumbnail Captions' -options: - animation: fade - animationSpeed: 600 - direction: horizontal - slideshow: true - easing: swing - smoothHeight: false - reverse: false - slideshowSpeed: 7000 - animationLoop: true - randomize: false - startAt: 0 - itemWidth: 0 - itemMargin: 0 - minItems: 0 - maxItems: 0 - move: 0 - directionNav: true - controlNav: thumbnails - thumbCaptions: true - thumbCaptionsBoth: false - keyboard: true - multipleKeyboard: false - mousewheel: false - touch: true - prevText: Previous - nextText: Next - namespace: flex- - selector: '.slides > li' - sync: '' - asNavFor: '' - initDelay: 0 - useCSS: true - video: false - pausePlay: false - pauseText: Pause - playText: Play - pauseOnAction: true - pauseOnHover: false - controlsContainer: .flex-control-nav-container - manualControls: '' diff --git a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_thumbnail_slider.yml b/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_thumbnail_slider.yml deleted file mode 100644 index 9a0d3db57d7962ed04751c95054fdc39d02a2f6b..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/flexslider.optionset.flexslider_default_thumbnail_slider.yml +++ /dev/null @@ -1,46 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: flexslider_default_thumbnail_slider -label: 'Thumbnail Slider' -options: - animation: slide - animationSpeed: 600 - direction: horizontal - slideshow: false - easing: swing - smoothHeight: true - reverse: false - slideshowSpeed: 7000 - animationLoop: false - randomize: false - startAt: 0 - itemWidth: 210 - itemMargin: 5 - minItems: 0 - maxItems: 0 - move: 0 - directionNav: true - controlNav: '0' - thumbCaptions: false - thumbCaptionsBoth: false - keyboard: true - multipleKeyboard: false - mousewheel: false - touch: true - prevText: Previous - nextText: Next - namespace: flex- - selector: '.slides > li' - sync: '' - asNavFor: '#flexslider-1' - initDelay: 0 - useCSS: true - video: false - pausePlay: false - pauseText: Pause - playText: Play - pauseOnAction: true - pauseOnHover: false - controlsContainer: .flex-control-nav-container - manualControls: '' diff --git a/web/modules/flexslider/flexslider_example/config/install/node.type.flexslider_example.yml b/web/modules/flexslider/flexslider_example/config/install/node.type.flexslider_example.yml deleted file mode 100644 index 84a8f932b7ba58ac5c54c953bd9388cea32d8039..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/node.type.flexslider_example.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'FlexSlider Example' -type: flexslider_example -description: 'Used for generating example FlexSlider implementations' -help: '' -new_revision: false -preview_mode: 1 -display_submitted: true diff --git a/web/modules/flexslider/flexslider_example/config/install/system.menu.flexslider-example.yml b/web/modules/flexslider/flexslider_example/config/install/system.menu.flexslider-example.yml deleted file mode 100644 index d210cb20894931a783062ca877f2fa609e42d688..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/system.menu.flexslider-example.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: flexslider-example -label: 'FlexSlider Example' -description: 'Example FlexSlider implementations' -locked: true diff --git a/web/modules/flexslider/flexslider_example/config/install/views.view.flexslider_views_example.yml b/web/modules/flexslider/flexslider_example/config/install/views.view.flexslider_views_example.yml deleted file mode 100644 index da231253bbb58cf49ee97f73ae4114c2f4edd982..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/config/install/views.view.flexslider_views_example.yml +++ /dev/null @@ -1,872 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_flexslider_example_image - - node.type.flexslider_example - - system.menu.flexslider-example - module: - - flexslider_views - - image - - node - - user -id: flexslider_views_example -label: 'FlexSlider Views Example' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: none - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: some - options: - items_per_page: 4 - offset: 0 - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: flexslider_default_slider_thumbnail_controlnav - captionfield: '' - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: true - fields: - field_flexslider_example_image: - id: field_flexslider_example_image - table: node__field_flexslider_example_image - field: field_flexslider_example_image - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: image - settings: - image_style: flexslider_full - image_link: '' - group_column: '' - group_columns: { } - group_rows: false - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: field - filters: - status: - value: true - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - flexslider_example: flexslider_example - entity_type: node - entity_field: type - plugin_id: bundle - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'Basic Slider' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' - embed_1: - display_plugin: embed - id: embed_1 - display_title: 'Thumbnail Controls' - position: 1 - display_options: - display_extenders: { } - defaults: - fields: true - title: false - style: false - row: false - pager: false - display_description: 'Controls another FlexSlider instance' - title: '' - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: flexslider_default_thumbnail_slider - captionfield: '' - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: true - pager: - type: some - options: - items_per_page: 10 - offset: 0 - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' - page_1: - display_plugin: page - id: page_1 - display_title: 'Basic Slider' - position: 1 - display_options: - display_extenders: { } - path: flexslider-views-example - menu: - type: normal - title: 'Basic Slider (Views)' - menu_name: flexslider-example - fields: - field_flexslider_example_image: - id: field_flexslider_example_image - table: node__field_flexslider_example_image - field: field_flexslider_example_image - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: image - settings: - image_style: flexslider_full - image_link: '' - group_column: '' - group_columns: { } - group_rows: false - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: field - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: false - ellipsis: false - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: p - element_class: flex-caption - element_label_type: '0' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '0' - element_wrapper_class: '' - element_default_classes: false - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: title - plugin_id: field - defaults: - fields: false - style: false - row: false - display_description: '' - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: default - captionfield: title - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: true - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' - page_2: - display_plugin: page - id: page_2 - display_title: 'Slide with thumbnail controls' - position: 1 - display_options: - display_extenders: { } - path: flexslider-views-example-with-thumbnail-controls - menu: - type: normal - title: 'slider w/thumbnail controlnav pattern (Views)' - description: '' - expanded: false - parent: '' - weight: 0 - context: '0' - menu_name: flexslider-example - fields: - field_flexslider_example_image: - id: field_flexslider_example_image - table: node__field_flexslider_example_image - field: field_flexslider_example_image - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: image - settings: - image_style: flexslider_full - image_link: '' - group_column: '' - group_columns: { } - group_rows: false - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: field - defaults: - fields: false - title: false - style: false - row: false - footer: true - display_description: '' - title: 'slider w/thumbnail controlnav pattern' - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: flexslider_default_slider_thumbnail_controlnav - captionfield: '' - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: true - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' - page_3: - display_plugin: page - id: page_3 - display_title: 'Slide with thumbnail slider' - position: 1 - display_options: - display_extenders: { } - path: flexslider-views-example-with-thumbnail-slider - menu: - type: normal - title: 'slider w/thumbnail slider (Views)' - description: '' - expanded: false - parent: '' - weight: 0 - context: '0' - menu_name: flexslider-example - defaults: - fields: true - title: false - style: false - row: false - pager: false - footer: false - display_description: 'Slider controlled by another instance of FlexSlider' - title: 'Slider w/thumbnail slider' - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: flexslider_default_slider_w_thumbnail_slider - captionfield: '' - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: false - footer: - view: - id: view - table: views - field: view - relationship: none - group_type: group - admin_label: '' - empty: false - view_to_insert: 'flexslider_views_example:embed_1' - inherit_arguments: false - plugin_id: view - pager: - type: some - options: - items_per_page: 10 - offset: 0 - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' - page_4: - display_plugin: page - id: page_4 - display_title: 'Basic Carousel' - position: 1 - display_options: - display_extenders: { } - defaults: - fields: true - title: false - style: false - row: false - pager: false - display_description: '' - title: 'Basic Carousel' - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: flexslider_default_basic_carousel - captionfield: '' - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: false - path: flexslider-views-example-basic-carousel - menu: - type: normal - title: 'basic carousel (Views)' - description: '' - expanded: false - parent: '' - weight: 0 - context: '0' - menu_name: flexslider-example - pager: - type: some - options: - items_per_page: 10 - offset: 0 - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' - page_5: - display_plugin: page - id: page_5 - display_title: 'Carousel with min and max ranges' - position: 1 - display_options: - display_extenders: { } - defaults: - fields: true - title: false - style: false - row: false - pager: false - display_description: '' - title: 'carousel with min and max ranges' - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: flexslider_carousel_with_min_and_max_ranges - captionfield: '' - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: false - path: flexslider-views-example-carousel-min-max - menu: - type: normal - title: 'carousel with min and max ranges (Views)' - description: '' - expanded: false - parent: '' - weight: 0 - context: '0' - menu_name: flexslider-example - pager: - type: some - options: - items_per_page: 10 - offset: 0 - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' - page_6: - display_plugin: page - id: page_6 - display_title: 'Basic Slider with Thumbnail Caption' - position: 1 - display_options: - display_extenders: { } - path: flexslider-views-example-thumbnail-captions - menu: - type: normal - title: 'Thumbnail Captions (Views)' - description: 'Basic slider with thumbnail captions' - expanded: false - parent: '' - weight: 0 - context: '0' - menu_name: flexslider-example - fields: - field_flexslider_example_image: - id: field_flexslider_example_image - table: node__field_flexslider_example_image - field: field_flexslider_example_image - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: image - settings: - image_style: flexslider_full - image_link: '' - group_column: '' - group_columns: { } - group_rows: false - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: field - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: false - ellipsis: false - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '0' - element_class: '' - element_label_type: '0' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '0' - element_wrapper_class: '' - element_default_classes: false - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: title - plugin_id: field - defaults: - fields: false - style: false - row: false - title: false - display_description: 'To use thumbnail captions, use the "caption field" option in the style settings.' - style: - type: flexslider - options: - grouping: { } - flexslider: null - optionset: flexslider_default_thumbnail_captions - captionfield: title - id: '' - row: - type: fields - options: - default_field_elements: false - inline: { } - separator: '' - hide_empty: true - title: 'Basic Slider with Thumbnail captions' - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_flexslider_example_image' diff --git a/web/modules/flexslider/flexslider_example/flexslider_example.info.yml b/web/modules/flexslider/flexslider_example/flexslider_example.info.yml deleted file mode 100644 index 141c3b00a4eaa679207aea737027e3fd9b89102e..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/flexslider_example.info.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 'FlexSlider Example' -description: 'Provide FlexSlider Example content type and related configuration. Used for generating example FlexSlider implementations' -type: module -# core: 8.x -package: FlexSlider -dependencies: - - field - - file - - flexslider - - flexslider_fields - - flexslider_views - - image - - node - - path - - system - - user - - views - -# Information added by Drupal.org packaging script on 2017-02-14 -version: '8.x-2.0-alpha2' -core: '8.x' -project: 'flexslider' -datestamp: 1487036906 diff --git a/web/modules/flexslider/flexslider_example/flexslider_example.install b/web/modules/flexslider/flexslider_example/flexslider_example.install deleted file mode 100644 index 00dc4fc2b1535feabe00a2213f2adc473c4d442b..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/flexslider_example.install +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -/** - * @file - * Install tasks for flexslider_example. - */ - -use Drupal\node\Entity\Node; - -/** - * Implements hook_install(). - */ -function flexslider_example_install() { - // Generate content for examples. - flexslider_example_generate_content(); -} - -/** - * Implements hook_uninstall(). - * - * Deletes all content and configuration installed by this module. - */ -function flexslider_example_uninstall() { - // Collect all of the example nodes and delete them. - $storage_handler = \Drupal::entityTypeManager()->getStorage('node'); - $nodes = $storage_handler->loadByProperties(array('type' => 'flexslider_example')); - - // Ensure we have some nodes before deleting. - if (!empty($nodes)) { - $storage_handler->delete($nodes); - \Drupal::logger('flexslider')->info(t('Deleted @count flexslider_example nodes', array('@count' => count($nodes))), array()); - } - - // Now delete all of the configuration installed by this module. - $dir = drupal_get_path('module', 'flexslider_example') . '/config/install'; - $files = file_scan_directory($dir, '/.*/'); - foreach ($files as $file) { - \Drupal::configFactory()->getEditable($file->name)->delete(); - } - \Drupal::logger('flexslider')->info(t('Deleted flexslider example configuration'), array()); - -} - -/** - * Generate the sample content. - */ -function flexslider_example_generate_content() { - - $dir = drupal_get_path('module', 'flexslider') . '/assets/images'; - $images = file_scan_directory($dir, '/flexslider-sample/'); - - foreach ($images as $image) { - - $filename = $image->filename; - - $file_temp = file_get_contents($image->uri); - $file_temp = file_save_data($file_temp, 'public://' . $filename, FILE_EXISTS_RENAME); - - // Create node object with attached file. - $node = Node::create([ - 'type' => 'flexslider_example', - 'title' => ucfirst(str_replace('-', ' ', $image->name)), - 'promote' => NODE_NOT_PROMOTED, - 'created' => REQUEST_TIME, - 'changed' => REQUEST_TIME, - 'uid' => 1, - 'field_flexslider_example_image' => [ - 'target_id' => $file_temp->id(), - ], - ]); - - try { - $result = $node->save(); - if ($result == SAVED_NEW) { - $saved = 'Created'; - } - elseif ($result == SAVED_UPDATED) { - $saved = 'Updated'; - } - else { - throw new Exception(t('Unknown value [@result] was returned', array('@result' => $result))); - } - - \Drupal::logger('flexslider')->info(t('@saved flexslider_example node @nid', array('@saved' => $saved, '@nid' => $node->id())), array()); - - } - catch (Exception $e) { - \Drupal::logger('flexslider')->error(t('Node create failure: @msg', array('@msg' => $e->getMessage())), array()); - } - - } -} diff --git a/web/modules/flexslider/flexslider_example/flexslider_example.module b/web/modules/flexslider/flexslider_example/flexslider_example.module deleted file mode 100644 index 175387f5f8696f0322d826adf20162e1b1e7e9ab..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_example/flexslider_example.module +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/** - * @file - * Flexslider_example module. - */ - -use Drupal\Core\Menu\MenuTreeParameters; -use Drupal\Core\Url; - -/** - * Implements hook_toolbar(). - */ -function flexslider_example_toolbar() { - $items = array(); - - // Load the menu. - $fs_tree = Drupal::service('toolbar.menu_tree')->load('flexslider-example', new MenuTreeParameters()); - // Build the menu render array. - $fs_menu = Drupal::service('toolbar.menu_tree')->build($fs_tree); - - $items['flexslider_examples'] = array( - '#type' => 'toolbar_item', - 'tab' => array( - '#type' => 'link', - '#title' => t('FlexSlider Examples'), - '#url' => Url::fromRoute('<front>'), - '#attributes' => array( - 'title' => t('FlexSlider examples menu'), - 'class' => array('toolbar-icon', 'toolbar-icon-menu'), - ), - ), - 'tray' => array( - '#heading' => t('FlexSlider examples menu'), - 'flexslider_example_menu' => $fs_menu, - ), - '#weight' => 99, - ); - - return $items; -} diff --git a/web/modules/flexslider/flexslider_fields/README.txt b/web/modules/flexslider/flexslider_fields/README.txt deleted file mode 100644 index 404e8171a10faf1be5c2d53ac892e5189b694f01..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_fields/README.txt +++ /dev/null @@ -1,34 +0,0 @@ -About -===== - -Adds a field display formatter to allow you to display field content using -FlexSlider. The module doesn't require Field UI to be enabled by default -(so you can leave it off once everything is configured) but it is recommended -to use to setup your display settings. - -Usage -===== - -Manage the fields on any entity (ex: node of type Article) - -Ex: admin/structure/types/manage/article - -Select any field of type "image" or "media" and set the display options to -"FlexSlider". Then select your option set in the display formatter settings. -That's it! - - -Responsive Images -============ - -The Responsive Image module is a core Drupal 8 module that provides an image -formatter and breakpoint mappings to output responsive images using the -HTML5 picture tag. - -FlexSlider Fields provides a FlexSlider Responsive formatter that -utilizes the core responsive image formatter. This formatter is available for -multi-file image fields when the Responsive Image module is installed. - -If the Responsive Image module is uninstalled after installing FlexSlider, -be sure to rebuild the cache to clean out any references to the FlexSlider -Responsive formatter. diff --git a/web/modules/flexslider/flexslider_fields/flexslider_fields.info.yml b/web/modules/flexslider/flexslider_fields/flexslider_fields.info.yml deleted file mode 100644 index a02f151cf304659974c5a9f9c34f3588e4088363..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_fields/flexslider_fields.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'FlexSlider Fields' -description: 'Adds a display mode in Fields for FlexSlider' -# core: 8.x -package: FlexSlider -dependencies: - - flexslider -type: module - -# Information added by Drupal.org packaging script on 2017-02-14 -version: '8.x-2.0-alpha2' -core: '8.x' -project: 'flexslider' -datestamp: 1487036906 diff --git a/web/modules/flexslider/flexslider_fields/flexslider_fields.module b/web/modules/flexslider/flexslider_fields/flexslider_fields.module deleted file mode 100644 index 99ea6bdc0bc772d204c5bb766bb734254e01a937..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_fields/flexslider_fields.module +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * @file - * Adds fields integration with FlexSlider. - */ - -/** - * Implements hook_field_formatter_info_alter(). - */ -function flexslider_fields_field_formatter_info_alter(array &$info) { - // Remove responsive formatter if responsive image module is not installed. - if (!\Drupal::moduleHandler()->moduleExists('responsive_image') && isset($info['flexslider_responsive'])) { - unset($info['flexslider_responsive']); - } -} diff --git a/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderFormatter.php b/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderFormatter.php deleted file mode 100644 index 4c3630c381d60afd04083ffaa7a1ee07b57fd709..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderFormatter.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php - -namespace Drupal\flexslider_fields\Plugin\Field\FieldFormatter; - -use Drupal\Core\Field\FieldDefinitionInterface; -use Drupal\Core\Field\FieldItemListInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter; - -/** - * Plugin implementation of the '<flexslider>' formatter. - * - * @FieldFormatter( - * id = "flexslider", - * label = @Translation("FlexSlider"), - * field_types = { - * "image" - * } - * ) - */ -class FlexsliderFormatter extends ImageFormatter { - use FlexsliderFormatterTrait; - - /** - * {@inheritdoc} - */ - public static function defaultSettings() { - return self::getDefaultSettings() + parent::defaultSettings(); - } - - /** - * {@inheritdoc} - */ - public function settingsSummary() { - $summary = $this->buildSettingsSummary($this); - - // Add the image settings summary and return. - return array_merge($summary, parent::settingsSummary()); - - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - // Add the optionset setting. - $element = $this->buildSettingsForm($this); - - // Add the image settings. - $element = array_merge($element, parent::settingsForm($form, $form_state)); - // We don't need the link setting. - $element['image_link']['#access'] = FALSE; - - // Add the caption setting. - if (!empty($this->getSettings())) { - $element += $this->captionSettings($this, $this->fieldDefinition); - } - - return $element; - } - - /** - * {@inheritdoc} - */ - public function viewElements(FieldItemListInterface $items, $langcode) { - - $images = parent::viewElements($items, $langcode); - - return $this->viewImages($images, $this->getSettings()); - - } - - /** - * {@inheritdoc} - */ - public static function isApplicable(FieldDefinitionInterface $field_definition) { - // This formatter only applies to multi-image fields. - return parent::isApplicable($field_definition) && $field_definition->getFieldStorageDefinition()->isMultiple(); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $dependencies = parent::calculateDependencies(); - return $dependencies + $this->getOptionsetDependencies($this); - } - - /** - * {@inheritdoc} - */ - public function onDependencyRemoval(array $dependencies) { - $changed = parent::onDependencyRemoval($dependencies); - - if ($this->optionsetDependenciesDeleted($this, $dependencies)) { - $changed = TRUE; - } - return $changed; - } - -} diff --git a/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderFormatterTrait.php b/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderFormatterTrait.php deleted file mode 100644 index 53698a9edfd417a15ee4e56a5f31d5d5b51054ba..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderFormatterTrait.php +++ /dev/null @@ -1,290 +0,0 @@ -<?php - -namespace Drupal\flexslider_fields\Plugin\Field\FieldFormatter; - -use Drupal\Core\Field\FieldDefinitionInterface; -use Drupal\Core\Field\FormatterBase; -use Drupal\Core\Url; -use Drupal\Core\Cache\Cache; -use Drupal\Component\Utility\Xss; -use Drupal\flexslider\Entity\Flexslider; - -/** - * A common Trait for flexslider formatters. - * - * Currently, only image based formatters exist for flexslider but this trait - * could apply to any type formatter. - * - * @see Drupal\Core\Field\FormatterBase - */ -trait FlexsliderFormatterTrait { - - /** - * Returns the flexslider specific default settings. - * - * @return array - * An array of default settings for the formatter. - */ - protected static function getDefaultSettings() { - return array( - 'optionset' => 'default', - 'caption' => '', - ); - } - - /** - * Builds the flexslider settings summary. - * - * @param \Drupal\Core\Field\FormatterBase $formatter - * The formatter having this trait. - * - * @return array - * The settings summary build array. - */ - protected function buildSettingsSummary(FormatterBase $formatter) { - $summary = array(); - - // Load the selected optionset. - $optionset = $this->loadOptionset($formatter->getSetting('optionset')); - - // Build the optionset summary. - $os_summary = $optionset ? $optionset->label() : $formatter->t('Default settings'); - $summary[] = $formatter->t('Option set: %os_summary', array('%os_summary' => $os_summary)); - - return $summary; - } - - /** - * Builds the flexslider settings form. - * - * @param \Drupal\Core\Field\FormatterBase $formatter - * The formatter having this trait. - * - * @return array - * The render array for Optionset settings. - */ - protected function buildSettingsForm(FormatterBase $formatter) { - - // Get list of option sets as an associative array. - $optionsets = flexslider_optionset_list(); - - $element['optionset'] = array( - '#title' => $formatter->t('Option Set'), - '#type' => 'select', - '#default_value' => $formatter->getSetting('optionset'), - '#options' => $optionsets, - ); - - $element['links'] = array( - '#theme' => 'links', - '#links' => array( - array( - 'title' => $formatter->t('Create new option set'), - 'url' => Url::fromRoute('entity.flexslider.add_form', array(), array('query' => \Drupal::destination()->getAsArray())), - ), - array( - 'title' => $formatter->t('Manage option sets'), - 'url' => Url::fromRoute('entity.flexslider.collection', array(), array('query' => \Drupal::destination()->getAsArray())), - ), - ), - '#access' => \Drupal::currentUser()->hasPermission('administer flexslider'), - ); - - return $element; - } - - /** - * The flexslider formatted view for images. - * - * @param array $images - * Images render array from the (Responsive)Image Formatter. - * @param array $formatter_settings - * Render array of settings. - * - * @return array - * Render of flexslider formatted images. - */ - protected function viewImages(array $images, array $formatter_settings) { - - // Bail out if no images to render. - if (empty($images)) { - return array(); - } - - // Get cache tags for the option set. - if ($optionset = $this->loadOptionset($formatter_settings['optionset'])) { - $cache_tags = $optionset->getCacheTags(); - } - else { - $cache_tags = array(); - } - - $items = []; - - foreach ($images as $delta => &$image) { - - // Merge in the cache tags. - if ($cache_tags) { - $image['#cache']['tags'] = Cache::mergeTags($image['#cache']['tags'], $cache_tags); - } - - // Prepare the slide item render array. - $item = array(); - // @todo Should find a way of dealing with render arrays instead of the actual output - $item['slide'] = render($image); - - // Check caption settings. - if ($formatter_settings['caption'] == 1) { - $item['caption'] = ['#markup' => Xss::filterAdmin($image['#item']->title)]; - } - elseif ($formatter_settings['caption'] == 'alt') { - $item['caption'] = ['#markup' => Xss::filterAdmin($image['#item']->alt)]; - } - - $items[$delta] = $item; - } - - $images['#theme'] = 'flexslider'; - $images['#flexslider'] = array( - 'settings' => $formatter_settings, - 'items' => $items, - ); - - return $images; - } - - /** - * Loads the selected option set. - * - * @param string $id - * This option set id. - * - * @returns \Drupal\flexslider\Entity\Flexslider - * The option set selected in the formatter settings. - */ - protected function loadOptionset($id) { - return Flexslider::load($id); - } - - /** - * Returns the form element for caption settings. - * - * @param \Drupal\Core\Field\FormatterBase $formatter - * The formatter having this trait. - * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition - * The image field definition. - * - * @return array - * The caption settings render array. - */ - protected function captionSettings(FormatterBase $formatter, FieldDefinitionInterface $field_definition) { - $field_settings = $field_definition->getSettings(); - - // Set the caption options. - $caption_options = array( - 0 => $formatter->t('None'), - 1 => $formatter->t('Image title'), - 'alt' => $formatter->t('Image ALT attribute'), - ); - - // Remove the options that are not available. - $action_fields = array(); - if ($field_settings['title_field'] == FALSE) { - unset($caption_options[1]); - // User action required on the image title. - $action_fields[] = 'title'; - } - if ($field_settings['alt_field'] == FALSE) { - unset($caption_options['alt']); - // User action required on the image alt. - $action_fields[] = 'alt'; - } - - // Create the caption element. - $element['caption'] = array( - '#title' => $formatter->t('Choose a caption source'), - '#type' => 'select', - '#options' => $caption_options, - ); - - // If the image field doesn't have all of the suitable caption sources, - // tell the user. - if ($action_fields) { - $action_text = $formatter->t('enable the @action_field field', array('@action_field' => implode(' and/or ', $action_fields))); - /* This may be a base field definition (e.g. in Views UI) which means it - * is not associated with a bundle and will not have the toUrl() method. - * So we need to check for the existence of the method before we can - * build a link to the image field edit form. - */ - if (method_exists($field_definition, 'toUrl')) { - // Build the link to the image field edit form for this bundle. - $rel = "{$field_definition->getTargetEntityTypeId()}-field-edit-form"; - $action = $field_definition->toLink($action_text, $rel, - array( - 'fragment' => 'edit-settings-alt-field', - 'query' => \Drupal::destination()->getAsArray(), - ) - )->toRenderable(); - } - else { - // Just use plain text if we can't build the field edit link. - $action = ['#markup' => $action_text]; - } - $element['caption']['#description'] - = $formatter->t('You need to @action for this image field to be able to use it as a caption.', - array('@action' => render($action))); - - // If there are no suitable caption sources, disable the caption element. - if (count($action_fields) >= 2) { - $element['caption']['#disabled'] = TRUE; - } - } - else { - $element['caption']['#default_value'] = $formatter->getSetting('caption'); - } - - return $element; - } - - /** - * Return the currently configured option set as a dependency array. - * - * @param FormatterBase $formatter - * The formatter having this trait. - * - * @return array - * An array of option set dependencies - */ - protected function getOptionsetDependencies(FormatterBase $formatter) { - $dependencies = array(); - $option_id = $formatter->getSetting('optionset'); - if ($option_id && $optionset = $this->loadOptionset($option_id)) { - // Add the optionset as dependency. - $dependencies[$optionset->getConfigDependencyKey()][] = $optionset->getConfigDependencyName(); - } - return $dependencies; - } - - /** - * If a dependency is going to be deleted, set the option set to default. - * - * @param FormatterBase $formatter - * The formatter having this trait. - * @param array $dependencies_deleted - * An array of dependencies that will be deleted. - * - * @return bool - * Whether or not option set dependencies changed. - */ - protected function optionsetDependenciesDeleted(FormatterBase $formatter, array $dependencies_deleted) { - $option_id = $formatter->getSetting('optionset'); - if ($option_id && $optionset = $this->loadOptionset($option_id)) { - if (!empty($dependencies_deleted[$optionset->getConfigDependencyKey()]) && in_array($optionset->getConfigDependencyName(), $dependencies_deleted[$optionset->getConfigDependencyKey()])) { - $formatter->setSetting('optionset', 'default'); - return TRUE; - } - } - return FALSE; - } - -} diff --git a/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderResponsiveFormatter.php b/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderResponsiveFormatter.php deleted file mode 100644 index 64ca68fb8aef3bdd1793ce7a1351cbed99757d2c..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderResponsiveFormatter.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -namespace Drupal\flexslider_fields\Plugin\Field\FieldFormatter; - -use Drupal\Core\Field\FieldDefinitionInterface; -use Drupal\Core\Field\FieldItemListInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\responsive_image\Plugin\Field\FieldFormatter\ResponsiveImageFormatter; - -/** - * Plugin implementation of the '<flexslider_responsive>' formatter. - * - * @FieldFormatter( - * id = "flexslider_responsive", - * label = @Translation("FlexSlider Responsive"), - * field_types = { - * "image" - * } - * ) - */ -class FlexsliderResponsiveFormatter extends ResponsiveImageFormatter { - use FlexsliderFormatterTrait; - - /** - * {@inheritdoc} - */ - public static function defaultSettings() { - return self::getDefaultSettings() + parent::defaultSettings(); - } - - /** - * {@inheritdoc} - */ - public function settingsSummary() { - $summary = $this->buildSettingsSummary($this); - - // Add the image settings summary and return. - return array_merge($summary, parent::settingsSummary()); - - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - // Add the optionset setting. - $element = $this->buildSettingsForm($this); - - // Add the image settings. - $element = array_merge($element, parent::settingsForm($form, $form_state)); - // We don't need the link setting. - $element['image_link']['#access'] = FALSE; - - // Add the caption setting. - if (!empty($this->getSettings())) { - $element += $this->captionSettings($this, $this->fieldDefinition); - } - - return $element; - } - - /** - * {@inheritdoc} - */ - public function viewElements(FieldItemListInterface $items, $langcode) { - - $images = parent::viewElements($items, $langcode); - - return $this->viewImages($images, $this->getSettings()); - - } - - /** - * {@inheritdoc} - */ - public static function isApplicable(FieldDefinitionInterface $field_definition) { - // This formatter only applies to multi-image fields when Responsive Image - // module is loaded. - if (\Drupal::moduleHandler()->moduleExists('responsive_image')) { - return parent::isApplicable($field_definition) && $field_definition->getFieldStorageDefinition()->isMultiple(); - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $dependencies = parent::calculateDependencies(); - return $dependencies + $this->getOptionsetDependencies($this); - } - - /** - * {@inheritdoc} - */ - public function onDependencyRemoval(array $dependencies) { - $changed = parent::onDependencyRemoval($dependencies); - - if ($this->optionsetDependenciesDeleted($this, $dependencies)) { - $changed = TRUE; - } - return $changed; - } - -} diff --git a/web/modules/flexslider/flexslider_views/README.txt b/web/modules/flexslider/flexslider_views/README.txt deleted file mode 100644 index 6049f2999abce78e85f0431005c307f81331b2f4..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_views/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -About -===== - -This adds a new display style to views called "FlexSlider". Similar to how you -select "HTML List" or "Unformatted List" as display styles. - -This module doesn't require Views UI to be enabled but it is required if you -want to configure your Views display using FlexSlider through the web -interface. This ensures you can leave Views UI off once everything is setup. - -Usage -===== - -Go to Views and use the display mode "FlexSlider" diff --git a/web/modules/flexslider/flexslider_views/flexslider_views.info.yml b/web/modules/flexslider/flexslider_views/flexslider_views.info.yml deleted file mode 100644 index 0253019b77ef110c167835b339e92dc31bb8ed05..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_views/flexslider_views.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'FlexSlider Views Style' -description: 'Adds a Views style plugin for FlexSlider' -# core: 8.x -package: FlexSlider -dependencies: - - views - - flexslider -type: module - -# Information added by Drupal.org packaging script on 2017-02-14 -version: '8.x-2.0-alpha2' -core: '8.x' -project: 'flexslider' -datestamp: 1487036906 diff --git a/web/modules/flexslider/flexslider_views/flexslider_views.module b/web/modules/flexslider/flexslider_views/flexslider_views.module deleted file mode 100644 index de175d6ccec30b357c43ac15704c2050e24fef31..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_views/flexslider_views.module +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -/** - * @file - * Adds Views plugins for FlexSlider. - */ diff --git a/web/modules/flexslider/flexslider_views/src/Plugin/views/style/FlexSlider.php b/web/modules/flexslider/flexslider_views/src/Plugin/views/style/FlexSlider.php deleted file mode 100644 index 89a8c64ca016e76b22faf128cca8b8aee1bfa965..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_views/src/Plugin/views/style/FlexSlider.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -namespace Drupal\flexslider_views\Plugin\views\style; - -use Drupal\Core\Form\FormStateInterface; -use Drupal\views\Plugin\views\style\StylePluginBase; - -/** - * Style plugin to render each item in an ordered or unordered list. - * - * @ingroup views_style_plugins - * - * @ViewsStyle( - * id = "flexslider", - * title = @Translation("FlexSlider"), - * help = @Translation("Display the results in a FlexSlider widget."), - * theme = "flexslider_views_style", - * theme_file = "flexslider_views.theme.inc", - * display_types = {"normal"} - * ) - */ -class FlexSlider extends StylePluginBase { - /** - * {@inheritdoc} - */ - protected $usesRowPlugin = TRUE; - - /** - * {@inheritdoc} - */ - protected $usesFields = TRUE; - - /** - * {@inheritdoc} - */ - protected $usesOptions = TRUE; - - /** - * {@inheritdoc} - */ - public function evenEmpty() { - return FALSE; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['optionset'] = array('default' => 'default'); - $options['captionfield'] = array('default' => ''); - $options['id'] = array('default' => ''); - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildOptionsForm($form, $form_state); - - $form['flexslider'] = array( - '#type' => 'fieldset', - '#title' => $this->t('FlexSlider'), - ); - - $form['flexslider']['optionset'] = array( - '#title' => t('Option set'), - '#type' => 'select', - '#options' => flexslider_optionset_list(), - '#default_value' => $this->options['optionset'], - ); - - $captionfield_options = array('' => $this->t('None')); - foreach ($this->displayHandler->getHandlers('field') as $field => $handler) { - $captionfield_options[$field] = $handler->adminLabel(); - } - - $form['flexslider']['captionfield'] = array( - '#type' => 'select', - '#title' => $this->t('Caption Field'), - '#description' => $this->t("Select a field to be used as the caption. This can also be set manually by adding the '.flex-caption' class to a field. Required to use thumbnail captions."), - '#options' => $captionfield_options, - '#default_value' => $this->options['captionfield'], - ); - - $form['flexslider']['id'] = array( - '#type' => 'textfield', - '#title' => $this->t('Element ID'), - '#description' => $this->t("Manually define the FlexSlider container ID attribute <em>Ensure you don't display similar ID elements on the same page</em>."), - '#size' => 40, - '#maxlength' => 255, - '#default_value' => $this->options['id'], - ); - - } - - /** - * {@inheritdoc} - */ - public function render() { - - // Group the rows according to the grouping field, if specified. - $sets = parent::render(); - - // Render each group separately and concatenate. - $output = $sets; - - foreach ($sets as $key => &$set) { - // Add caption field if chosen. - if (!empty($this->options['captionfield'])) { - $caption_field = $this->options['captionfield']; - foreach ($set['#rows'] as $index => $row) { - $set['#rows'][$index]['#caption'] = $this->rendered_fields[$index][$caption_field]; - } - } - $output[$key] = [ - '#theme' => $this->themeFunctions(), - '#view' => $this->view, - '#options' => $this->options, - '#rows' => $set['#rows'], - '#title' => $set['#title'], - ]; - } - - return $output; - } - - /** - * {@inheritdoc} - */ - public function submitOptionsForm(&$form, FormStateInterface $form_state) { - parent::submitOptionsForm($form, $form_state); - - /* Move flexslider options to the parent array so that - * values are saved properly. - * Original: values['style_options']['flexslider'] = ['options', 'caption', 'id']. - */ - $flexslider_options = $form_state->getValue(array('style_options', 'flexslider')); - - // Edit: values['style_options'] += ['options', 'caption', 'id']. - foreach ($flexslider_options as $key => $value) { - $form_state->setValue(array('style_options', $key), $value); - } - - // Edit: values['style_options']['flexslider'] = NULL. - $form_state->setValue(array('style_options', 'flexslider'), NULL); - } - -} diff --git a/web/modules/flexslider/flexslider_views/templates/flexslider-views-style.html.twig b/web/modules/flexslider/flexslider_views/templates/flexslider-views-style.html.twig deleted file mode 100644 index c12646603e2c965e5d3f65105ac3bd45d176a8ce..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_views/templates/flexslider-views-style.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{# -/** - * @file - * Default output for a Views style FlexSlider object. - * - * Available variables: - * - attributes: An array of attributes to apply to the element. - * - content: A renderable array of the flexslider object - * - * @see template_preprocess_flexslider_views_style() - */ -#} - -<div{{ attributes }}> - {{ content }} -</div> diff --git a/web/modules/flexslider/flexslider_views/templates/flexslider_views.theme.inc b/web/modules/flexslider/flexslider_views/templates/flexslider_views.theme.inc deleted file mode 100644 index 0208d6f445e79e90f7a80f5de405daba3d8c8973..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/flexslider_views/templates/flexslider_views.theme.inc +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * @file - * Theme functions for FlexSlider Views. - */ - -/** - * Prepares variables for flexslider view templates. - * - * Default template: flexslider-views-style.html.twig. - * - * @param array $variables - * An associative array containing: - * - view: A ViewExecutable object. - * - rows: The raw row data. - * - options: An array of options. Each option contains: - * - separator: A string to be placed between inline fields to keep them - * visually distinct. - */ -function template_preprocess_flexslider_views_style(array &$variables) { - // Only run the preprocessor if it is a view. - if (empty($variables['view'])) { - return; - } - - $view = $variables['view']; - $style = $view->style_plugin; - $options = $style->options; - - $items = array(); - $settings = array(); - $settings['optionset'] = $options['optionset']; - $settings['attributes'] = array('id' => $variables['options']['id']); - - foreach ($variables['rows'] as $row) { - // Render the row into a slide. - // @todo should use render arrays instead of actual output - $item['slide'] = render($row); - $item['caption'] = (isset($row['#caption']) && !empty($row['#caption'])) ? $row['#caption'] : NULL; - $items[] = $item; - } - - $content = array( - '#theme' => 'flexslider', - '#flexslider' => array( - 'items' => $items, - 'settings' => $settings, - ), - ); - - // Add the slide items to the variables. - $variables['content'] = $content; - -} diff --git a/web/modules/flexslider/src/Controller/FlexsliderListBuilder.php b/web/modules/flexslider/src/Controller/FlexsliderListBuilder.php deleted file mode 100644 index e256a10daf6a2dbc59551927c3636adf2006743d..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/Controller/FlexsliderListBuilder.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Drupal\flexslider\Controller; - -use Drupal\Core\Config\Entity\ConfigEntityListBuilder; -use Drupal\Core\Entity\EntityInterface; - -/** - * Provides a listing of Flexslider optionset entities. - */ -class FlexsliderListBuilder extends ConfigEntityListBuilder { - - /** - * {@inheritdoc} - */ - public function buildHeader() { - $header['label'] = $this->t('Name'); - $header['id'] = $this->t('Machine name'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row['label'] = $entity->label(); - $row['id'] = $entity->id(); - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $ops = parent::getDefaultOperations($entity); - // Do not allow deletion of the default configuration. - if ($entity->id() == 'default') { - unset($ops['delete']); - } - return $ops; - } - -} diff --git a/web/modules/flexslider/src/Controller/FlexsliderOptionsetController.php b/web/modules/flexslider/src/Controller/FlexsliderOptionsetController.php deleted file mode 100644 index d34955dbd231657ba5e3f988928f2a8020e2a1e5..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/Controller/FlexsliderOptionsetController.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Drupal\flexslider\Controller; - -use Drupal\Core\Controller\ControllerBase; -use Drupal\flexslider\Entity\Flexslider; -use Symfony\Component\HttpFoundation\RedirectResponse; - -/** - * Route controller class for the flexslider module options configuration. - */ -class FlexsliderOptionsetController extends ControllerBase { - - /** - * Enables a Flexslider object. - * - * @param \Drupal\flexslider\Entity\Flexslider $flexslider - * The Flexslider object to enable. - * - * @return \Symfony\Component\HttpFoundation\RedirectResponse - * A redirect response to the Flexslider optionset listing page. - */ - public function enable(Flexslider $flexslider) { - $flexslider->enable()->save(); - return new RedirectResponse($flexslider->url('collection', array('absolute' => TRUE))); - } - - /** - * Disables an Flexslider object. - * - * @param \Drupal\flexslider\Entity\Flexslider $flexslider - * The Flexslider object to disable. - * - * @return \Symfony\Component\HttpFoundation\RedirectResponse - * A redirect response to the Flexslider optionset listing page. - */ - public function disable(Flexslider $flexslider) { - $flexslider->disable()->save(); - return new RedirectResponse($flexslider->url('collection', array('absolute' => TRUE))); - } - -} diff --git a/web/modules/flexslider/src/Entity/Flexslider.php b/web/modules/flexslider/src/Entity/Flexslider.php deleted file mode 100644 index 1b54d08f09f0a7720945f09e2ae8065634bf2705..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/Entity/Flexslider.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - -namespace Drupal\flexslider\Entity; - -use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\flexslider\FlexsliderDefaults; -use Drupal\flexslider\FlexsliderInterface; - -/** - * Defines the Flexslider entity. - * - * @ConfigEntityType( - * id = "flexslider", - * label = @Translation("FlexSlider optionset"), - * handlers = { - * "list_builder" = "Drupal\flexslider\Controller\FlexsliderListBuilder", - * "form" = { - * "add" = "Drupal\flexslider\Form\FlexsliderForm", - * "edit" = "Drupal\flexslider\Form\FlexsliderForm", - * "delete" = "Drupal\flexslider\Form\FlexsliderDeleteForm" - * } - * }, - * config_prefix = "optionset", - * admin_permission = "administer flexslider", - * entity_keys = { - * "id" = "id", - * "label" = "label", - * "status" = "status" - * }, - * links = { - * "canonical" = "/admin/config/media/flexslider/{flexslider}", - * "edit-form" = "/admin/config/media/flexslider/{flexslider}/edit", - * "enable" = "/admin/config/media/flexslider/{flexslider}/enable", - * "disable" = "/admin/config/media/flexslider/{flexslider}/disable", - * "delete-form" = "/admin/config/media/flexslider/{flexslider}/delete", - * "collection" = "/admin/config/media/flexslider" - * }, - * config_export = { - * "id", - * "label", - * "options", - * } - * ) - */ -class Flexslider extends ConfigEntityBase implements FlexsliderInterface { - /** - * The Flexslider optionset ID. - * - * @var string - */ - protected $id; - - /** - * The Flexslider optionset label. - * - * @var string - */ - protected $label; - - /** - * The Flexslider optionset options. - * - * @var array - */ - protected $options = array(); - - /** - * {@inheritdoc} - */ - public function getOptions($strict = FALSE) { - if ($strict) { - $options = $this->options; - if (isset($options['controlNav']) && $options['controlNav'] != 'thumbnails') { - $options['controlNav'] = boolval($options['controlNav']); - } - return $options; - } - else { - return $this->options; - } - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options) { - $this->options = $options; - } - - /** - * {@inheritdoc} - */ - public function getOption($name) { - return isset($this->options[$name]) ? $this->options[$name] : NULL; - } - - /** - * {@inheritdoc} - */ - public static function create(array $values = array()) { - $flexslider = parent::create($values); - // Merge options with default options. - $default_options = FlexsliderDefaults::defaultOptions(); - $flexslider->setOptions($flexslider->getOptions() + $default_options); - return $flexslider; - } - -} diff --git a/web/modules/flexslider/src/FlexsliderDefaults.php b/web/modules/flexslider/src/FlexsliderDefaults.php deleted file mode 100644 index 0ebd2e1cb570e1c257a7106622a6efe396b8955d..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/FlexsliderDefaults.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -namespace Drupal\flexslider; - -/** - * Class FlexsliderDefaults. - * - * Defines the default settings for this module. - */ -class FlexsliderDefaults { - - /** - * Returns default flexslider library options. - */ - public static function defaultOptions() { - return [ - // String Prefix string attached to the classes of all elements generated by the plugin. - 'namespace' => 'flex-', - // Selector Must match a simple pattern. '{container} > {slide}'. - 'selector' => '.slides > li', - // String Controls the animation type, "fade" or "slide". - 'animation' => 'fade', - // String Determines the easing method used in jQuery transitions. - 'easing' => 'swing', - // String Controls the animation direction, "horizontal" or "vertical". - 'direction' => 'horizontal', - // Boolean Reverse the animation direction. - 'reverse' => FALSE, - // Boolean Gives the slider a seamless infinite loop. - 'animationLoop' => TRUE, - // Boolean Animate the height of the slider smoothly for slides of varying height. - 'smoothHeight' => FALSE, - // Number The starting slide for the slider, in array notation. - 'startAt' => 0, - // Boolean Setup a slideshow for the slider to animate automatically. - 'slideshow' => TRUE, - // Number Set the speed of the slideshow cycling, in milliseconds. - 'slideshowSpeed' => 7000, - // Number Set the speed of animations, in milliseconds. - 'animationSpeed' => 600, - // Number Set an initialization delay, in milliseconds. - 'initDelay' => 0, - // Boolean Randomize slide order, on load. - 'randomize' => FALSE, - // Boolean Pause the slideshow when interacting with control elements. - 'pauseOnAction' => TRUE, - // Boolean Pause the slideshow when hovering over slider, then resume when no longer hovering. - 'pauseOnHover' => FALSE, - // Boolean Slider will use CSS3 transitions, if available. - 'useCSS' => TRUE, - // Boolean Allow touch swipe navigation of the slider on enabled devices. - 'touch' => TRUE, - // Boolean Will prevent use of CSS3 3D Transforms, avoiding graphical glitches. - 'video' => FALSE, - // Boolean Create navigation for paging control of each slide. - 'controlNav' => TRUE, - // Boolean Create previous/next arrow navigation. - 'directionNav' => TRUE, - // String Set the text for the "previous" directionNav item. - 'prevText' => 'Previous', - // String Set the text for the "next" directionNav item. - 'nextText' => 'Next', - // Boolean Allow slider navigating via keyboard left/right keys. - 'keyboard' => TRUE, - // Boolean Allow keyboard navigation to affect multiple sliders. - 'multipleKeyboard' => FALSE, - // Boolean (Dependency) Allows slider navigating via mousewheel. - 'mousewheel' => FALSE, - // Boolean Create pause/play element to control slider slideshow. - 'pausePlay' => FALSE, - // String Set the text for the "pause" pausePlay item. - 'pauseText' => 'Pause', - // String Set the text for the "play" pausePlay item. - 'playText' => 'Play', - // jQuery Object/Selector Container the navigation elements should be appended to. - 'controlsContainer' => '' , - // jQuery Object/Selector Define element to be used in lieu of dynamic controlNav. - 'manualControls' => '', - // Selector Mirror the actions performed on this slider with another slider. - 'sync' => '', - // Selector Turn the slider into a thumbnail navigation for another slider. - 'asNavFor' => '' , - // Number Box-model width of individual carousel items, including horizontal borders and padding. - 'itemWidth' => 0 , - // Number Margin between carousel items. - 'itemMargin' => 0 , - // Number Minimum number of carousel items that should be visible. - 'minItems' => 0 , - // Number Maximum number of carousel items that should be visible. - 'maxItems' => 0 , - // Number Number of carousel items that should move on animation. - 'move' => 0 , - 'thumbCaptions' => FALSE, - 'thumbCaptionsBoth' => FALSE, - ]; - } - -} diff --git a/web/modules/flexslider/src/FlexsliderInterface.php b/web/modules/flexslider/src/FlexsliderInterface.php deleted file mode 100644 index 55d6d69307ed2aef2fc362320931f5647215effa..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/FlexsliderInterface.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\flexslider; - -use Drupal\Core\Config\Entity\ConfigEntityInterface; - -/** - * Provides an interface for defining Flexslider optionset entities. - */ -interface FlexsliderInterface extends ConfigEntityInterface { - - /** - * Returns the array of flexslider library options. - * - * @param bool $strict - * Use strict typecasting, as defined by the flexslider library. - * This fixes the typecasting of options that we defined - * differently in the schema. - * - * @return array - * The array of options. - */ - public function getOptions($strict = FALSE); - - /** - * Returns the value of a flexslider library option. - * - * @param string $name - * The option name. - * - * @return mixed - * The option value. - */ - public function getOption($name); - - /** - * Sets the flexslider library options array. - * - * @param array $options - * New/updated array of options. - */ - public function setOptions(array $options); - -} diff --git a/web/modules/flexslider/src/Form/FlexsliderDeleteForm.php b/web/modules/flexslider/src/Form/FlexsliderDeleteForm.php deleted file mode 100644 index 774c32fb04fdf94287a3263228e85f0178b55580..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/Form/FlexsliderDeleteForm.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -namespace Drupal\flexslider\Form; - -use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; - -/** - * Builds the form to delete Flexslider optionset entities. - */ -class FlexsliderDeleteForm extends EntityConfirmFormBase { - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to delete %name?', array('%name' => $this->entity->label())); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.flexslider.collection'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - - drupal_set_message( - $this->t('Deleted the %label FlexSlider optionset.', - [ - '%label' => $this->entity->label(), - ] - ) - ); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form = parent::buildForm($form, $form_state); - - if ($this->entity->id() == 'default') { - $form['#title'] = $this->t('The default optionset cannot be deleted.'); - $form['description'] = array('#markup' => t('Please click Cancel to go back to the list of optionsets.')); - $form['actions']['submit']['#access'] = FALSE; - } - - return $form; - } - -} diff --git a/web/modules/flexslider/src/Form/FlexsliderForm.php b/web/modules/flexslider/src/Form/FlexsliderForm.php deleted file mode 100644 index 3d039e26e52323b3f1acfd1b40fdc74d495404ba..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/Form/FlexsliderForm.php +++ /dev/null @@ -1,518 +0,0 @@ -<?php - -namespace Drupal\flexslider\Form; - -use Drupal\Core\Entity\EntityForm; -use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Link; -use Drupal\Core\Url; -use Drupal\flexslider\FlexsliderDefaults; - -/** - * Class FlexsliderForm. - * - * @package Drupal\flexslider\Form - */ -class FlexsliderForm extends EntityForm { - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form = parent::form($form, $form_state); - $flexslider = $this->entity; - $options = $flexslider->getOptions(); - $default_options = FlexsliderDefaults::defaultOptions(); - - $form['label'] = array( - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#maxlength' => 255, - '#default_value' => $flexslider->label(), - '#description' => $this->t('A human-readable title for this option set.'), - '#required' => TRUE, - ); - - $form['id'] = array( - '#type' => 'machine_name', - '#default_value' => $flexslider->id(), - '#machine_name' => array( - 'exists' => '\Drupal\flexslider\Entity\Flexslider::load', - ), - '#disabled' => !$flexslider->isNew(), - ); - - // Options Vertical Tab Group table. - $form['tabs'] = array( - '#type' => 'vertical_tabs', - ); - - // General Slideshow and Animiation Settings. - $form['animation_slideshow'] = array( - '#type' => 'details', - '#title' => $this->t('General Slideshow and Animation Settings'), - '#group' => 'tabs', - '#open' => TRUE, - ); - - $form['animation_slideshow']['animation'] = array( - '#type' => 'select', - '#title' => $this->t('Animation'), - '#description' => $this->t('Select your animation type'), - '#options' => array( - 'fade' => $this->t('Fade'), - 'slide' => $this->t('Slide'), - ), - '#default_value' => isset($options['animation']) ? $options['animation'] : $default_options['animation'], - // @todo add states to enable/disable the direction - ); - - $form['animation_slideshow']['animationSpeed'] = array( - '#type' => 'number', - '#title' => $this->t('Animation Speed'), - '#description' => $this->t('Set the speed of animations, in milliseconds'), - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#default_value' => isset($options['animationSpeed']) ? $options['animationSpeed'] : $default_options['animationSpeed'], - ); - - $form['animation_slideshow']['direction'] = array( - '#type' => 'select', - '#title' => $this->t('Slide Direction'), - '#description' => $this->t('Select the sliding direction, "horizontal" or "vertical"'), - '#options' => array( - 'horizontal' => $this->t('Horizontal'), - 'vertical' => $this->t('Vertical'), - ), - '#default_value' => isset($options['direction']) ? $options['direction'] : $default_options['direction'], - ); - - $form['animation_slideshow']['slideshow'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Slideshow'), - '#description' => $this->t('Animate the slides automatically'), - '#default_value' => isset($options['slideshow']) ? $options['slideshow'] : $default_options['slideshow'], - ); - - // Build in support for easing plugin. - $easing_options = array('swing' => $this->t('Swing'), 'linear' => $this->t('Linear')); - if ($this->moduleHandler->moduleExists('jqeasing')) { - $easing_options = array_merge($easing_options, _flexslider_jqeasing_options()); - } - - $form['animation_slideshow']['easing'] = array( - '#type' => 'select', - '#title' => $this->t('Easing'), - '#multiple' => FALSE, - '#description' => $this->t('The description appears usually below the item.'), - '#options' => $easing_options, - '#default_value' => isset($options['easing']) ? $options['easing'] : $default_options['easing'], - ); - - $form['animation_slideshow']['smoothHeight'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Smooth Height'), - '#description' => $this->t('Animate the height of the slider smoothly for slides of varying height.'), - '#default_value' => isset($options['smoothHeight']) ? $options['smoothHeight'] : $default_options['smoothHeight'], - ); - - $form['animation_slideshow']['reverse'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Reverse'), - '#description' => $this->t('Animate the slides in reverse'), - '#default_value' => isset($options['reverse']) ? $options['reverse'] : $default_options['reverse'], - ); - - $form['animation_slideshow']['slideshowSpeed'] = array( - '#type' => 'number', - '#title' => $this->t('Slideshow speed'), - '#description' => $this->t('Set the speed of the slideshow cycling, in milliseconds'), - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#default_value' => isset($options['slideshowSpeed']) ? $options['slideshowSpeed'] : $default_options['slideshowSpeed'], - ); - - $form['animation_slideshow']['animationLoop'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Loop Slideshow'), - '#description' => $this->t('Loop the slideshow once it reaches the last slide.'), - '#default_value' => isset($options['animationLoop']) ? $options['animationLoop'] : $default_options['animationLoop'], - ); - - $form['animation_slideshow']['randomize'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Randomize Slide Order'), - '#description' => $this->t('Randomize the order the slides play back.'), - '#default_value' => isset($options['randomize']) ? $options['randomize'] : $default_options['randomize'], - ); - $form['animation_slideshow']['startAt'] = array( - '#type' => 'number', - '#title' => $this->t('Starting Slide'), - '#description' => $this->t('The slide that the slider should start on. Ex: For the first slide enter "0", for the second enter "1", etc. If you enter a value which is greater than the number of slides, the slider will default to the first slide.'), - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#default_value' => isset($options['startAt']) ? $options['startAt'] : $default_options['startAt'], - // @todo add states to disable if randomize is set - ); - - $form['animation_slideshow']['itemWidth'] = array( - '#type' => 'number', - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#title' => $this->t('Item Width'), - '#description' => $this->t('Box-model width of individual carousel items, including horizontal borders and padding.'), - '#default_value' => isset($options['itemWidth']) ? $options['itemWidth'] : $default_options['itemWidth'], - ); - $form['animation_slideshow']['itemMargin'] = array( - '#type' => 'number', - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#title' => $this->t('Item Margin'), - '#description' => $this->t('Margin between carousel items. (NB: the margin must be set in your CSS styles. This property merely informs FlexSlider of the margin.)'), - '#default_value' => isset($options['itemMargin']) ? $options['itemMargin'] : $default_options['itemMargin'], - ); - $form['animation_slideshow']['minItems'] = array( - '#type' => 'number', - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#title' => $this->t('Minimum Items'), - '#description' => $this->t('Minimum number of carousel items that should be visible.'), - '#default_value' => isset($options['minItems']) ? $options['minItems'] : $default_options['minItems'], - ); - $form['animation_slideshow']['maxItems'] = array( - '#type' => 'number', - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#title' => $this->t('Max Items'), - '#description' => $this->t('Maximum number of carousel items that should be visible.'), - '#default_value' => isset($options['maxItems']) ? $options['maxItems'] : $default_options['maxItems'], - ); - $form['animation_slideshow']['move'] = array( - '#type' => 'number', - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#title' => $this->t('Move'), - '#description' => $this->t('Number of carousel items that should move on animation. If 0, slider will move all visible items.'), - '#default_value' => isset($options['move']) ? $options['move'] : $default_options['move'], - ); - - // Navigation and Control Settings. - $form['nav_controls'] = array( - '#type' => 'details', - '#title' => $this->t('Navigation and Control Settings'), - '#group' => 'tabs', - ); - $form['nav_controls']['directionNav'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Next/Previous Controls'), - '#description' => $this->t('Add controls for previous/next navigation'), - '#default_value' => isset($options['directionNav']) ? $options['directionNav'] : $default_options['directionNav'], - ); - $form['nav_controls']['controlNav'] = array( - '#type' => 'select', - '#title' => $this->t('Paging Controls'), - '#description' => $this->t('Add controls to jump to individual slides. (Note: set to "On" if using Manual Controls)'), - '#default_value' => isset($options['controlNav']) ? $options['controlNav'] : $default_options['controlNav'], - '#options' => array( - 0 => $this->t('Off'), - 1 => $this->t('On'), - 'thumbnails' => $this->t('Thumbnails'), - ), - ); - $form['nav_controls']['thumbCaptions'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Thumbnail Captions'), - '#description' => $this->t('<em>Requires FlexSlider Library 2.2+</em>. After selecting this captions will be added to thumbnails and removed from the main slide.'), - '#default_value' => isset($options['thumbCaptions']) ? $options['thumbCaptions'] : $default_options['thumbCaptions'], - '#states' => array( - 'visible' => array( - ':input[name="controlNav"]' => array('value' => 'thumbnails'), - ), - ), - '#element_validate' => array('::validateMinimumVersion22', '::validateThumbnailOptions'), - ); - $form['nav_controls']['thumbCaptionsBoth'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Display both thumbnail captions and normal captions'), - '#description' => $this->t('<em>Requires FlexSlider Library 2.2+</em>. Display captions in the thumbnail as well as in the slider.'), - '#default_value' => isset($options['thumbCaptionsBoth']) ? $options['thumbCaptionsBoth'] : $default_options['thumbCaptionsBoth'], - '#states' => array( - 'visible' => array( - ':input[name="controlNav"]' => array('value' => 'thumbnails'), - ), - ), - '#element_validate' => array('::validateMinimumVersion22', '::validateThumbnailOptions'), - ); - $form['nav_controls']['keyboard'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Keyboard Navigation'), - '#description' => $this->t('Allow slider navigating via keyboard left/right keys'), - '#default_value' => isset($options['keyboard']) ? $options['keyboard'] : $default_options['keyboard'], - ); - $form['nav_controls']['multipleKeyboard'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Multiple Keyboard'), - '#description' => $this->t('Allow keyboard navigation to affect multiple sliders.'), - '#default_value' => isset($options['multipleKeyboard']) ? $options['multipleKeyboard'] : $default_options['multipleKeyboard'], - ); - $form['nav_controls']['mousewheel'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Mousewheel Navigation'), - '#description' => $this->t('Allow slider navigating via mousewheel'), - '#default_value' => isset($options['mousewheel']) ? $options['mousewheel'] : $default_options['mousewheel'], - // @todo add check for jquery mousewheel library - ); - $form['nav_controls']['touch'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Touch'), - '#description' => $this->t('Allow touch swipe navigation.'), - '#default_value' => isset($options['touch']) ? $options['touch'] : $default_options['touch'], - ); - $form['nav_controls']['prevText'] = array( - '#type' => 'textfield', - '#title' => $this->t('Previous Link Text'), - '#description' => $this->t('Set the text for the "previous" control item. <em>Text translation can be controlled using the <a href="http://drupal.org/project/stringoverrides">String Overrides module</a>.</em>'), - '#default_value' => isset($options['prevText']) ? $options['prevText'] : $default_options['prevText'], - ); - $form['nav_controls']['nextText'] = array( - '#type' => 'textfield', - '#title' => $this->t('Next Link Text'), - '#description' => $this->t('Set the text for the "next" control item. <em>Text translation can be controlled using the <a href="http://drupal.org/project/stringoverrides">String Overrides module</a>.</em>'), - '#default_value' => isset($options['nextText']) ? $options['nextText'] : $default_options['nextText'], - ); - - // Advanced Options. - $form['advanced'] = array( - '#type' => 'details', - '#title' => $this->t('Advanced Options'), - '#group' => 'tabs', - ); - $form['advanced']['namespace'] = array( - '#type' => 'textfield', - '#title' => $this->t('Namespace'), - '#description' => $this->t('Prefix string attached to the classes of all elements generated by the plugin.'), - '#size' => 40, - '#maxlength' => 255, - '#element_validate' => array('::validateNamespace'), - '#default_value' => isset($options['namespace']) ? $options['namespace'] : $default_options['namespace'], - ); - $form['advanced']['selector'] = array( - '#type' => 'textfield', - '#title' => $this->t('Selector'), - '#description' => $this->t('Must match a simple pattern. "{container} > {slide}".'), - '#size' => 40, - '#maxlength' => 255, - '#element_validate' => array('::validateSelector'), - '#default_value' => isset($options['selector']) ? $options['selector'] : $default_options['selector'], - ); - $form['advanced']['sync'] = array( - '#type' => 'textfield', - '#title' => $this->t('Sync'), - '#description' => $this->t('Mirror the actions performed on this slider with another slider.'), - '#size' => 40, - '#maxlength' => 255, - '#default_value' => isset($options['sync']) ? $options['sync'] : $default_options['sync'], - ); - $form['advanced']['asNavFor'] = array( - '#type' => 'textfield', - '#title' => $this->t('Use as navigation'), - '#description' => $this->t('Turn the slider into a thumbnail navigation for another slider.'), - '#size' => 40, - '#maxlength' => 255, - '#default_value' => isset($options['asNavFor']) ? $options['asNavFor'] : $default_options['asNavFor'], - ); - $form['advanced']['initDelay'] = array( - '#type' => 'number', - '#title' => $this->t('Initialize Delay'), - '#description' => $this->t('Set an initialization delay, in milliseconds.'), - // Only positive numbers. - '#min' => 0, - // Only integers. - '#step' => 1, - '#default_value' => isset($options['initDelay']) ? $options['initDelay'] : $default_options['initDelay'], - ); - $form['advanced']['useCSS'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Use CSS'), - '#description' => $this->t('Slider will use CSS3 transitions, if available.'), - '#default_value' => isset($options['useCSS']) ? $options['useCSS'] : $default_options['useCSS'], - ); - $form['advanced']['video'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Video'), - '#description' => $this->t('Will prevent use of CSS3 3D Transforms, avoiding graphical glitches.'), - '#default_value' => isset($options['video']) ? $options['video'] : $default_options['video'], - ); - $form['advanced']['pausePlay'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Add Pause/Play Indicator'), - '#description' => $this->t('Have FlexSlider add an element indicating the current state of the slideshow (i.e. "pause" or "play").'), - '#default_value' => isset($options['pausePlay']) ? $options['pausePlay'] : $default_options['pausePlay'], - // @todo add states value for pause/play text - ); - $form['advanced']['pauseText'] = array( - '#type' => 'textfield', - '#title' => $this->t('Pause State Text'), - '#description' => $this->t('Set the text for the "pause" state indicator. <em>Text translation can be controlled using the <a href="http://drupal.org/project/stringoverrides">String Overrides module</a>.</em>'), - '#default_value' => isset($options['pauseText']) ? $options['pauseText'] : $default_options['pauseText'], - ); - $form['advanced']['playText'] = array( - '#type' => 'textfield', - '#title' => $this->t('Play State Text'), - '#description' => $this->t('Set the text for the "play" state indicator. <em>Text translation can be controlled using the <a href="http://drupal.org/project/stringoverrides">String Overrides module</a>.</em>'), - '#default_value' => isset($options['playText']) ? $options['playText'] : $default_options['playText'], - ); - $form['advanced']['pauseOnAction'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Pause On Controls'), - '#description' => $this->t('Pause the slideshow when interacting with control elements.'), - '#default_value' => isset($options['pauseOnAction']) ? $options['pauseOnAction'] : $default_options['pauseOnAction'], - ); - $form['advanced']['pauseOnHover'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Pause On Hover'), - '#description' => $this->t('Pause the slideshow when hovering over slider, then resume when no longer hovering.'), - '#default_value' => isset($options['pauseOnHover']) ? $options['pauseOnHover'] : $default_options['pauseOnHover'], - ); - $form['advanced']['controlsContainer'] = array( - '#type' => 'textfield', - '#title' => $this->t('Controls container (Advanced)'), - '#description' => $this->t('Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.'), - '#default_value' => isset($options['controlsContainer']) ? $options['controlsContainer'] : $default_options['controlsContainer'], - ); - $form['advanced']['manualControls'] = array( - '#type' => 'textfield', - '#title' => $this->t('Manual controls (Advanced)'), - '#description' => $this->t('Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.'), - '#default_value' => isset($options['manualControls']) ? $options['manualControls'] : $default_options['manualControls'], - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - /** @var \Drupal\flexslider\Entity\Flexslider $flexslider */ - $flexslider = $this->entity; - - $status = parent::save($form, $form_state); - - switch ($status) { - case SAVED_NEW: - drupal_set_message($this->t('Created the %label FlexSlider optionset.', [ - '%label' => $flexslider->label(), - ])); - break; - - default: - drupal_set_message($this->t('Saved the %label FlexSlider optionset.', [ - '%label' => $flexslider->label(), - ])); - } - $form_state->setRedirectUrl($flexslider->toUrl('collection')); - } - - /** - * {@inheritdoc} - */ - protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) { - $options = array(); - $values = $form_state->getValues(); - foreach ($values as $key => $value) { - if (in_array($key, array('id', 'label'))) { - $entity->set($key, $value); - } - else { - $options[$key] = $value; - } - } - $entity->set('options', $options); - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - // Prevent access to delete button when editing default configuration. - if ($this->entity->id() == 'default' && isset($actions['delete'])) { - $actions['delete']['#access'] = FALSE; - } - return $actions; - } - - /** - * Validation functions. - */ - public function validateNamespace(array &$element, FormStateInterface $form_state) { - // @todo - // @see form_error() - return TRUE; - } - - /** - * Validation functions. - */ - public function validateSelector(array &$element, FormStateInterface $form_state) { - // @todo - // @see form_error() - return TRUE; - } - - /** - * Validate the correct version for thumbnail options. - */ - public function validateMinimumVersion22(array &$element, FormStateInterface $form_state) { - $lib = libraries_detect('flexslider'); - if (!isset($lib['version'])) { - drupal_set_message($this->t('Unable to detect FlexSlider library version. Some options may not function properly. Please review the README.md file for installation instructions.'), 'warning'); - } - else { - $version = $lib['version']; - $required = "2.2"; - if ($element['#value'] && !version_compare($version, $required, '>=')) { - $form_state->setError($element, $this->t('To use %name you must install FlexSlider version !required or higher.', array( - '%name' => $element['#title'], - '!required' => Link::fromTextAndUrl($required, Url::fromUri('https://github.com/woothemes/FlexSlider/tree/version/2.2')), - ))); - } - } - } - - /** - * Validate thumbnail option values. - * - * Empties the value of the thumbnail caption option when the paging control - * is not set to thumbnails. - * - * @param array $element - * The element to validate. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - */ - public function validateThumbnailOptions(array &$element, FormStateInterface $form_state) { - if ($form_state->getValue('controlNav') !== 'thumbnails' && $element['#value']) { - $form_state->setValueForElement($element, ''); - } - } - -} diff --git a/web/modules/flexslider/src/Form/FlexsliderFormSettings.php b/web/modules/flexslider/src/Form/FlexsliderFormSettings.php deleted file mode 100644 index 237ed0e84592923e705ee8fa27c10004ba1ca11b..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/Form/FlexsliderFormSettings.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -namespace Drupal\flexslider\Form; - -use Drupal\Core\Asset\LibraryDiscovery; -use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Form\ConfigFormBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Session\AccountProxyInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Class FlexsliderFormSettings. - * - * @package Drupal\flexslider\Form - */ -class FlexsliderFormSettings extends ConfigFormBase { - - /** - * The library discovery service. - * - * @var LibraryDiscovery - */ - private $libraryDiscovery; - - /** - * The current user account service. - * - * @var AccountProxyInterface - */ - private $currentUser; - - /** - * Constructs a new FlexSliderFormSettings. - * - * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory - * The config factory service. - * @param \Drupal\Core\Asset\LibraryDiscovery $libraryDiscovery - * The library discovery service. - * @param \Drupal\Core\Session\AccountProxyInterface $currentUser - * The user account service. - */ - public function __construct(ConfigFactoryInterface $configFactory, LibraryDiscovery $libraryDiscovery, AccountProxyInterface $currentUser) { - parent::__construct($configFactory); - $this->libraryDiscovery = $libraryDiscovery; - $this->currentUser = $currentUser; - } - - /** - * Use Symfony's ContainerInterface to declare dependency for constructor. - * - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), - $container->get('library.discovery'), - $container->get('current_user') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'flexslider_advanced_settings_form'; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('flexslider.settings'); - $config->set('flexslider_debug', $form_state->getValue('flexslider_debug')) - ->save(); - - // Invalidate the library discovery cache to update new assets. - $this->libraryDiscovery->clearCachedDefinitions(); - - parent::submitForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['flexslider.settings']; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form = []; - - $form['library'] = [ - '#type' => 'fieldset', - '#title' => 'Library', - '#tree' => FALSE, - ]; - - // Debug mode toggle. - $form['library']['flexslider_debug'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enable debug mode'), - '#description' => $this->t('Load the human-readable version of the FlexSlider library.'), - '#default_value' => $this->config('flexslider.settings')->get('flexslider_debug'), - '#access' => $this->currentUser->hasPermission('administer flexslider'), - ]; - - return parent::buildForm($form, $form_state); - } - -} diff --git a/web/modules/flexslider/src/Tests/FlexsliderTest.php b/web/modules/flexslider/src/Tests/FlexsliderTest.php deleted file mode 100644 index 8c9770b85fc7299fb456ca8422faed212ca1ed7f..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/src/Tests/FlexsliderTest.php +++ /dev/null @@ -1,237 +0,0 @@ -<?php - -namespace Drupal\flexslider\Tests; - -use Drupal\flexslider\Entity\Flexslider; -use Drupal\flexslider\FlexsliderDefaults; -use Drupal\simpletest\WebTestBase; - -/** - * Test the FlexSlider presets, configuration options and permission controls. - * - * @group flexslider - */ -class FlexsliderTest extends WebTestBase { - - /** - * Our module dependencies. - * - * In Drupal 8's SimpleTest, we declare module dependencies in a public - * static property called $modules. WebTestBase automatically enables these - * modules for us. - * - * @var array - */ - public static $modules = array('flexslider'); - - /** - * User with permission to admin flexslider. - * - * @var \Drupal\user\UserInterface - */ - protected $adminUser; - - /** - * User with permission to access administration pages. - * - * @var \Drupal\user\UserInterface - */ - protected $anyUser; - - /** - * {@inheritdoc} - */ - public function setUp() { - parent::setUp(); - - // Create users. - $this->adminUser = $this->drupalCreateUser(array('administer flexslider'), NULL, TRUE); - $this->anyUser = $this->drupalCreateUser(array('access administration pages')); - } - - /** - * Admin Access test. - */ - public function testAdminAccess() { - - // Login as the admin user. - $this->drupalLogin($this->adminUser); - - // Load admin page. - $this->drupalGet('admin/config/media/flexslider'); - $this->assertResponse(200, t('Administrative permission allows access to administration page.')); - - // Logout as admin user. - $this->drupalLogout(); - - // Login as any user. - $this->drupalLogin($this->anyUser); - - // Attempt to load admin page. - $this->drupalGet('admin/config/media/flexslider'); - $this->assertResponse(403, t('Regular users do not have access to administrative pages.')); - - } - - /** - * Test managing the optionset. - */ - public function testOptionSetCrud() { - // Login as the admin user. - $this->drupalLogin($this->adminUser); - $testsets = array('testset', 'testset2'); - - foreach ($testsets as $name) { - // Create a new optionset with default settings. - /** @var Flexslider $optionset */ - $optionset = Flexslider::create(array('id' => $name, 'label' => $name)); - $this->assertTrue($optionset->id() == $name, t('Optionset object created: @name', array('@name' => $optionset->id()))); - $this->assertFalse(empty($optionset->getOptions()), t('Create optionset works.')); - - // Save the optionset to the database. - $optionset->save(); - - $this->assertFalse(FALSE === $optionset, t('Optionset saved to database.')); - - // Read the values from the database. - $optionset = Flexslider::load($name); - - $this->assertTrue(is_object($optionset), t('Loaded option set.')); - $this->assertEqual($name, $optionset->id(), t('Loaded name matches: @name', array('@name' => $optionset->id()))); - - /** @var Flexslider $default_optionset */ - $default_optionset = Flexslider::create(); - foreach ($default_optionset->getOptions() as $key => $value) { - $this->assertEqual($value, $optionset->getOptions()[$key], t('Option @option matches saved value.', array('@option' => $key))); - } - - } - - // Load all optionsets. - $optionsets = Flexslider::loadMultiple(); - $this->assertTrue(is_array($optionsets), t('Array of optionsets loaded')); - $this->assertTrue(count($optionsets) == 3, t('Proper number of optionsets loaded (two created, one default): 3')); - - // Ensure they all loaded correctly. - foreach ($optionsets as $optionset) { - $this->assertTrue($optionset->id(), t('Loaded optionsets have a defined machine name')); - $this->assertTrue($optionset->label(), t('Loaded optionsets have a defined human readable name (label)')); - $this->assertTrue(!empty($optionset->getOptions()), t('Loaded optionsets have a defined array of options')); - } - - // Update the optionset. - $test_options = $this->getTestOptions(); - $test_options = $test_options['valid']; - - // Load one of the test option sets. - $optionset = Flexslider::load($testsets[0]); - - // Change the settings. - $optionset->setOptions($test_options['set2'] + $optionset->getOptions()); - - // Save the updated values. - $saved = $optionset->save(); - - $this->assertTrue(SAVED_UPDATED == $saved, t('Saved updates to optionset to database.')); - - // Load the values from the database again. - $optionset = Flexslider::load($testsets[0]); - - // Compare settings to the test options. - foreach ($test_options['set2'] as $key => $value) { - $this->assertEqual($optionset->getOptions()[$key], $value, t('Saved value matches set value: @key', array('@key' => $key))); - } - - // Delete the optionset. - $this->assertTrue(is_object($optionset), t('Optionset exists and is ready to be deleted.')); - try { - $optionset->delete(); - // Ensure the delete is successful. - $this->pass(t('Optionset successfully deleted: @name', array('@name' => $optionset->id()))); - } - catch (\Exception $e) { - $this->fail(t('Caught exception: @msg', array('@msg' => $e->getMessage()))); - } - - } - - /** - * Test the option set form. - */ - public function testOptionSetForm() { - - // Login with admin user. - $this->drupalLogin($this->adminUser); - - // ------------ Test Option Set Add ------------ // - // Load create form. - $this->drupalGet('admin/config/media/flexslider/add'); - $this->assertResponse(200, t('Administrative user can reach the "Add" form.')); - - // Save new optionset. - $optionset = array(); - $optionset['label'] = t('testset'); - $optionset['id'] = 'testset'; - $this->drupalPostForm('admin/config/media/flexslider/add', $optionset, t('Save')); - - $this->assertResponse(200); - $this->assertText('Created the testset FlexSlider optionset.', t('Successfully saved the new optionset "testset"')); - - // Attempt to save option set of the same name again. - $this->drupalPostForm('admin/config/media/flexslider/add', $optionset, t('Save')); - $this->assertResponse(200); - $this->assertText('The machine-readable name is already in use. It must be unique.', t('Blocked the creation of duplicate named optionset.')); - - // ------------ Test Option Set Edit ------------ // - // Attempt to save each option value. - $options = $this->getTestOptions(); - - foreach ($options['valid'] as $testset) { - $this->drupalPostForm('admin/config/media/flexslider/default', $testset, t('Save')); - $this->assertResponse(200); - - // Test saved values loaded into form. - $this->drupalGet('admin/config/media/flexslider/default'); - $this->assertResponse(200, t('Default optionset reloaded.')); - foreach ($testset as $key => $option) { - $this->assertFieldByName($key, $option, t('Value for @key appears in form correctly.', array('@key' => $key))); - } - } - - // ------------ Test Option Set Delete ------------ //. - $testset = Flexslider::load('testset'); - - // Test the delete workflow. - $this->drupalGet("admin/config/media/flexslider/{$testset->id()}/delete"); - $this->assertResponse(200); - $this->assertText("Are you sure you want to delete {$testset->label()}?", t('Delete confirmation form loaded.')); - $this->drupalPostForm("admin/config/media/flexslider/{$testset->id()}/delete", [], t('Delete')); - $this->assertResponse(200); - $this->assertText("Deleted the {$testset->label()} FlexSlider optionset.", t('Deleted test set using form.')); - - } - - /** - * Get the test configuration options. - * - * @return array - * Returns an array of options to test saving. - */ - protected function getTestOptions() { - // Valid option set data. - $valid = array( - 'set1' => FlexsliderDefaults::defaultOptions(), - 'set2' => array( - 'animation' => 'slide', - 'startAt' => 4, - // @todo add more option tests - ), - ); - - // Invalid edge cases. - $error = array(); - - return array('valid' => $valid, 'error' => $error); - } - -} diff --git a/web/modules/flexslider/templates/flexslider-list-item.html.twig b/web/modules/flexslider/templates/flexslider-list-item.html.twig deleted file mode 100644 index bf076875b1a7acd496fce6092b8cfc4a3b97f17d..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/templates/flexslider-list-item.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{# -/** - * @file - * Default theme implementation for the individual Flexslider item/slide template. - * - * Available variables: - * - attributes: An array of attributes to apply to the element. - * - item.slide: A renderable array of the main image/background. - * - item.caption: A renderable array containing caption fields if provided: - * - title: The individual slide title. - * - alt: The core Image field Alt as caption. - * - link: The slide links or buttons. - * - overlay: The image/audio/video overlay, or a nested slick. - * - data: any possible field for more complex data if crazy enough. - * - settings: An array containing the given settings. - * - * @see template_preprocess_flexslider_list_item() - */ -#} - -<li{{ attributes }}> - {{ item }} - {% if caption %} - <div class="flex-caption">{{ caption }}</div> - {% endif %} -</li> \ No newline at end of file diff --git a/web/modules/flexslider/templates/flexslider-list.html.twig b/web/modules/flexslider/templates/flexslider-list.html.twig deleted file mode 100644 index cf02d6fa38da25b9288e3237facf91be91f7a5c3..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/templates/flexslider-list.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{# -/** - * @file - * Default theme implementation for the Flexslider list wrapper template. - * - * Available variables: - * - attributes: An array of attributes to apply to the element. - * - settings.type: The wrapper type. (ul or ol) - * - content.list: The array of slides - * - settings: An array containing the given settings. - * - * @see template_preprocess_flexslider_list() - */ -#} - -<{{ settings.type }}{{ attributes }}> - {{ content.list }} -</{{ settings.type }}> \ No newline at end of file diff --git a/web/modules/flexslider/templates/flexslider.html.twig b/web/modules/flexslider/templates/flexslider.html.twig deleted file mode 100644 index c38300ae34363782ed2750d6710c98a84237ca51..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/templates/flexslider.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{# -/** - * @file - * Default output for a FlexSlider object. - * - * Available variables: - * - attributes: An array of attributes to apply to the element. - * - content.list: A renderable array of the flexslider list - * - settings: An array containing the given settings. - * - * @see template_preprocess_flexslider() - */ -#} - -<div{{ attributes }}> - {{ content.list }} -</div> diff --git a/web/modules/flexslider/templates/flexslider.theme.inc b/web/modules/flexslider/templates/flexslider.theme.inc deleted file mode 100644 index 40ae4132746a8837cc289d366e8f7016cf743a45..0000000000000000000000000000000000000000 --- a/web/modules/flexslider/templates/flexslider.theme.inc +++ /dev/null @@ -1,181 +0,0 @@ -<?php - -/** - * @file - * Theming functions for the flexslider module. - * - * Preprocessor functions fill variables for templates and helper - * functions to make theming easier. - */ - -use Drupal\Component\Utility\Html; -use Drupal\Component\Utility\NestedArray; -use Drupal\flexslider\Entity\Flexslider; -use Drupal\flexslider\FlexsliderDefaults; - -/** - * Prepares variables for flexslider template. - * - * Default template: flexslider.html.twig. - */ -function template_preprocess_flexslider(&$variables) { - - // Reference configuration variables. - $settings = &$variables['flexslider']['settings']; - $optionset = &$settings['optionset']; - $items = &$variables['flexslider']['items']; - - // Set the default container type. - if (empty($settings['type'])) { - $settings['type'] = 'ul'; - } - - // Load the selected optionset. - if (!empty($optionset)) { - $optionset = Flexslider::load($optionset); - } - - // Check if an optionset was loaded. - if (is_null($optionset)) { - // Fall back to 'default' options. - $options = FlexsliderDefaults::defaultOptions(); - \Drupal::logger('flexslider')->warning('Fallback to default optionset.', array()); - } - else { - $options = $optionset->getOptions(); - } - - // Configure attributes for containing elements. - $attributes = $variables['attributes']; - // Merge with defined attributes. - if (isset($settings['attributes']) && is_array($settings['attributes'])) { - $attributes = NestedArray::mergeDeep($attributes, $settings['attributes']); - } - - // Set the ID for each flexslider instance if none is provided. - if (empty($attributes['id'])) { - $flexslider_id = &drupal_static('flexslider_id', 0); - $attributes['id'] = 'flexslider-' . ++$flexslider_id; - } - - // Add the namespace to any classes. - // @todo figure out what this is supposed to do - if (!empty($attributes['class']) && !empty($options['namespace'])) { - foreach ($attributes['class'] as $key => $value) { - $attributes['class'][$key] = $options['namespace'] . $value; - } - } - - // Add the flexslider class to be namespaced. - $attributes['class'][] = 'flexslider'; - - // Add the optionset name as a class to the container. - $attributes['class'][] = 'optionset-' . Html::getClass($optionset->id()); - - // Add the image style name as a class to the container. - if (!empty($settings['image_style'])) { - $attributes['class'][] = 'imagestyle-' . Html::getClass($settings['image_style']); - } - - // Pass attributes to twig. - $variables['attributes'] = $attributes; - - // Add the list render array. - $variables['content']['list'] = array( - '#theme' => 'flexslider_list', - '#items' => $items, - '#settings' => $settings, - ); - - // Finally, add the configuration to the page. - $attached = flexslider_add($variables['attributes']['id'], $variables['flexslider']['settings']['optionset']); - $variables['#attached'] = $attached; - -} - -/** - * Prepares variables for flexslider list template. - * - * Default template: flexslider-list.html.twig. - */ -function template_preprocess_flexslider_list(&$variables) { - - // Reference configuration variables. - $optionset = &$variables['settings']['optionset']; - $items = &$variables['items']; - $attributes = &$variables['attributes']; - - // @todo find a way to detect the outer container class if possible - $attributes['class'][] = 'slides'; - - // Build the list. - $variables['content']['list'] = array(); - if (!empty($items)) { - foreach ($items as $i => $item) { - - $caption = ''; - if (!empty($item['caption'])) { - $caption = $item['caption']; - } - - // Add the list item render array. - $variables['content']['list'][$i] = array( - '#theme' => 'flexslider_list_item', - '#item' => $item['slide'], - '#settings' => array( - 'optionset' => $optionset, - ), - '#caption' => $caption, - ); - } - } - -} - -/** - * Prepares variables for flexslider list item template. - * - * Default template: flexslider-list-item.html.twig. - */ -function template_preprocess_flexslider_list_item(&$variables) { - - // Reference configuration variables. - $item = &$variables['item']; - $settings = &$variables['settings']; - $caption = &$variables['caption']; - $attributes = &$variables['attributes']; - /** @var \Drupal\flexslider\Entity\Flexslider $optionset */ - $optionset = $settings['optionset']; - - // Generated thumbnail support. - if ($optionset->getOption('controlNav') === "thumbnails") { - // If the thumbnails are enabled in the option set, - // extract the url to set as the thumbnail data. - $src = array(); - if (!preg_match("/<img.+?src=[\"'](.+?)[\"'].+?>/", $item, $src)) { - preg_match("/<img.+?srcset=[\"'](.+?)[\"'].+?>/", $item, $src); - } - - if (!empty($src[1])) { - $attributes['data-thumb'] = $src[1]; - } - - // Let's also get the alt attribute to apply to thumbnails. - // This only works in library version 2.6+. - $alt = array(); - preg_match("/<img.+?alt=[\"'](.+?)[\"'].+?>/", $item, $alt); - - if (!empty($alt)) { - $attributes['data-thumb-alt'] = $alt[1]; - } - } - - if ($optionset->getOption('thumbCaptions') and !empty($caption)) { - $attributes['data-thumbcaption'] = $caption; - // Prevent captions from appearing in the slider as well. - if (FALSE === $optionset->getOption('thumbCaptionsBoth')) { - $caption = ''; - } - } - -} diff --git a/web/modules/libraries/CHANGELOG.txt b/web/modules/libraries/CHANGELOG.txt deleted file mode 100644 index 6d1daa8351781ca92e24b008ece84bc2a2e27539..0000000000000000000000000000000000000000 --- a/web/modules/libraries/CHANGELOG.txt +++ /dev/null @@ -1,163 +0,0 @@ - -Libraries 8.x-3.x, xxxx-xx-xx ------------------------------ -#2833756 by 20th: Check that public://library-definitions directory does not exist -#2825940 by tstoeckler, rjacobs: Remove LibrariesServiceProvider -#2816115 by rjacobs: Remove ExtensionHandler service -#2770983 by rjacobs: Update services.yml to reference new registry URL of http://cgit.drupalcode.org/libraries_registry/plain/registry/8 -#2770983 by rjacobs: Update shipped config to reference new registry URL of http://cgit.drupalcode.org/libraries_registry/plain/registry/8 -#2815189 by rjacobs, tstoeckler: Library dependency checking can fail for install profile -#2770983 by tstoeckler, rjacobs: Fetch definitions remotely and store them locally. -#2770983 by tstoeckler: Make Libraries API work on Windows. -#2770983 by tstoeckler: Allow libraries to be symlinked to their right place. -#2756265 by rajeshwari10: Replace deprecated usage of SafeMarkup::checkPlain(). -#2742333 by jrockowitz: Fix missing @group in LinePatternDetectorTest -by tstoeckler: Document plugin alter hooks -by tstoeckler: Fix coding standards -by tstoeckler: Split out library dependencies to a separate interface -by tstoeckler: Implement version detection for libraries -by tstoeckler: Add deprecation notices to all legacy functions and hooks -#2090623 by tstoeckler: Introduce the notion of library types -#2090623 by tstoeckler: Provide support for remote asset libraries -#2090623 by tstoeckler: Introduce a stream wrapper for asset libraries -#2090623 by tstoeckler: Introduce the concept of locators -#2606420 by googletorp, tstoeckler: Fix profile library detection -#2090623 by tstoeckler: Add an external library registry -#2572401 by rjacobs, yas: Fix missing @group annotation in PhpFileLibraryTest -#2090623 by tstoeckler: Add a test for PHP file loading -#2090623 by tstoeckler: Provide a modern, flexible library API -#2525898 by rjacobs, jonhattan: Fix obsoleted cache bin declaration. -#2471501 by LKS90: Replace all occurrences of String with the SafeMarkup equivalent. -by tstoeckler: Fix drush libraries-list and drush cache-clear libraries. -#2427801 by Anushka-mp, tstoeckler: Replace module_invoke() call. -by tstoeckler: Fix tests. -#2390301 by rjacobs: Fix DrupalUnitTestBase no longer exists so tests can't load. -#2332157 by tstoeckler: Add a composer.json. -#2287529 by drupalshrek, tstoeckler: Update installation link in README.txt. -by tstoeckler: Fix tests. -#2309203 by JayeshSolanki: Replace removed functions with module handler service. -#2290767 by yukare: Replace removed cache() function. -#2183087 by tstoeckler, rjacobs: Update for removed core functions. -by tstoeckler: Fix tests. -by tstoeckler: Provide required 'type' key in test library info file. -#2090351 by tstoeckler: Remove obsolete hook_flush_caches(). -#2090425 by tstoeckler: Adapt for renamed ControllerInterface. -#2090323 by tstoeckler: Remove obsolete libraries_parse_dependency(). -#2090379 by tstoeckler: Change 'pattern' to 'path' in routing YAML file. -#2058371 by gordon: Re-port to Drupal 8 (.info.yml, controllers, cache service, ...). -#1779714 by tstoeckler, klonos: Wrong filepath in README.txt and fix JS testing. -#1167496 by tstoeckler: Remove leftover libraries.test file. -#1167496 by tstoeckler, benshell: Port to Drupal 8. - - -Libraries 7.x-3.x, xxxx-xx-xx ------------------------------ -#1938638 by tstoeckler: Remove unneeded check. - - -Libraries 7.x-2.x, xxxx-xx-xx ------------------------------ -#2352251 by netw3rker: Fix incorrect hook name in libraries.api.php. -#2352237 by netw3rker, tstoeckler: Allow clearing the libraries cache from Drush. -#2193969 by tstoeckler: Avoid warnings for stale library caches. -#2287529 by drupalshrek, tstoeckler: Update installation link in README.txt. - -Libraries 7.x-2.2, 2014-02-09 ------------------------------ -#2046919 by tstoeckler: Clarify 'version' docs. -#1946110 by munroe_richard: Allow uppercase letters as library machine names. -#1953260 by tstoeckler: Improve documentation of libraries_get_version(). -#1855918 by tstoeckler: Make integration file loading backwards-compatible. -#1876124 by tstoeckler: Fix integration files for themes. -#1876124 by tstoeckler: Add tests for theme-provided library information. -#1876124 by tstoeckler: Prepare for adding a test theme. -#1876124 by tstoeckler | whastings, fubhy: Fix hook_libraries_info() for themes. -#2015721 by tstoeckler, CaptainHook: Protect against files overriding local variables. -#2046919 by tstoeckler: Improve documentation around 'version callback'. -#1844272 by tstoeckler, jweowu: Fix typos in libraries.api.php. -#1938638 by tstoeckler: Prevent weird PHP notice on update. -#1329388 by RobLoach, tstoeckler: Clear static caches in libraries_flush_caches(). -#1855918 by rbayliss: Load integration files after library files. -#1938638 by Pol: Fix typo in libraries.api.php. - -Libraries 7.x-2.1, 2013-03-09 ------------------------------ -#1937446 by Pol, tstoeckler: Add a 'pre-dependencies-load' callback group. -#1775668 by tstoeckler: Fix bogus assertion message in assertLibraryFiles(). -#1773640 by tstoeckler: Use drupal_get_path() to find the profile directory. -#1565426 by tstoeckler: Invoke hook_libraries_info() in enabled themes. - -Libraries 7.x-2.0, 2012-07-29 ------------------------------ -#1606018 by chemical: Tests fail if the module is downloaded from Drupal.org. -#1386250 by tstoeckler: Clarify module and library installation in README.txt. -#1578618 by iamEAP: Fixed Fatal cache flush failure on major version upgrades. -#1449346 by tstoeckler, sun: Clean-up libraries.test - -Libraries 7.x-2.0-alpha2, 2011-12-15 ------------------------------------- -#1299076 by tstoeckler: Improve testing of JS, CSS, and PHP files. -#1347214 by rfay: Improve update function 7200. -#1323530 by tstoeckler: Document libraries_get_version() pattern matching. -#1325524 by sun, Rob Loach, tstoeckler: Statically cache libraries_detect(). -#1321372 by Rob Loach: Provide a 'post-load' callback group. -#1205854 by tstoeckler, sun: Test library caching. - -Libraries 7.x-2.0-alpha1, 2011-10-01 ------------------------------------- -#1268342 by tstoeckler: Clean up drush libraries-list command. -#962214 by tstoeckler, sun: Add support for library dependencies. -#1224838 by sun, mjpa: Fix library path not being prepended to JS/CSS files. -#1023258 by tstoeckler: Make 'files' consistently keyed by filename. -#958162 by sun, tstoeckler: Add pre-detect callback group. -#958162 by sun, tstoeckler: Make tests debuggable and provide libraries_info_defaults(). -#961476 by tstoeckler: Changed libraries_get_path() to return FALSE by default. -#958162 by tstoeckler, sun, good_man: Allow to apply callbacks to libraries. -#1125904 by tstoeckler, boombatower: Fix drush libraries-list. -#1050076 by tstoeckler: Re-utilize libraries_detect() and remove libraries_detect_library(). -#466090 by tstoeckler: Add update function. -#466090 by tstoeckler: Allow cache to be flushed. -#466090 by tstoeckler, sun: Cache library information. -#1064008 by tstoeckler, bfroehle: Fix outdated API examples in libraries.api.php. -#1028744 by tstoeckler: Code clean-up. -#1023322 by tstoeckler, sun: Fixed libraries shouldn't be loaded multiple times. -#1024080 by hswong3i, tstoeckler: Fixed installation profile retrieval. -#995988 by good_man: Wrong default install profile. -#975498 by Gábor Hojtsy: Update JS/CSS-loading to new drupal_add_js/css() API. -#958162 by tsteoeckler, sun: Consistent variable naming. -#924130 by aaronbauman: Fixed libraries_get_path() should use drupal_static(). -#958162 by tstoeckler, sun: Code clean-up, tests revamp, more robust loading. -#919632 by tstoeckler, sun: Allow library information to be stored in info files. -by sun: Fixed testbot breaks upon directory name/info file name mismatch. -#864376 by tstoeckler, sun: Code-cleanup, allow hard-coded 'version'. -#939174 by sun, tstoeckler: Rename example.info to libraries_example.info. -by sun: Fixed testbot breaks upon .info file without .module file. -#542940 by tstoeckler, sun: Add libraries-list command. -#919632 by tstoeckler: Add example library info file for testing purposes. -#719896 by tstoeckler, sun: Documentation clean-up and tests improvement. -#542940 by sun: Added initial Drush integration file. -#719896 by tstoeckler, sun: Improved library detection and library loading. -#855050 by Gábor Hojtsy: Avoid call-time pass by reference in libraries_detect(). -#719896 by tstoeckler, sun: Added starting point for hook_libraries_info(). - - -Libraries 7.x-1.x, xxxx-xx-xx ------------------------------ - -Libraries 7.x-1.0, 2010-01-27 ------------------------------ -#743522 by sun: Ported to D7. - - -Libraries 6.x-1.x, xxxx-xx-xx ------------------------------ - -Libraries 6.x-1.0, 2010-01-27 ------------------------------ -#1028744 by tstoeckler: Code clean-up. -#496732 by tstoeckler, robphillips: Allow placing libraries in root directory. - -Libraries 6.x-1.0-alpha1, 2009-12-30 ------------------------------------- -#480440 by markus_petrux: Fixed base_path() not applied to default library path. -#320562 by sun: Added basic functions. diff --git a/web/modules/libraries/LICENSE.txt b/web/modules/libraries/LICENSE.txt deleted file mode 100644 index d159169d1050894d3ea3b98e1c965c4058208fe1..0000000000000000000000000000000000000000 --- a/web/modules/libraries/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/web/modules/libraries/README.txt b/web/modules/libraries/README.txt deleted file mode 100644 index 9ff0ece53b15239fbe50aac61ebf9db03f9819d0..0000000000000000000000000000000000000000 --- a/web/modules/libraries/README.txt +++ /dev/null @@ -1,40 +0,0 @@ - -# Libraries API - -## General information - -Libraries API provides external library handling for Drupal modules. - -Relevant links: -- [Project page](https://www.drupal.org/project/libraries) -- [Issue tracker](https://www.drupal.org/project/issues/libraries) -- [Repository viewer](http://cgit.drupalcode.org/libraries) - -### Installation - -Install like any module, see the -[Drupal.org handbook](https://www.drupal.org/documentation/install/modules-themes/modules-8) -for further information. Note that installing external libraries is separate from -installing this module and should happen in the top-level `libraries` directory. -See the online [module documentation](https://www.drupal.org/node/1440066) for more -information. - - -### Maintainers - -Current maintainers: -- Daniel F. Kudwien ([sun](https://www.drupal.org/u/sun)) -- Tobias Stöckler ([tstoeckler](http://www.drupal.org/u/tstoeckler)) -- Ryan Jacobs ([rjacobs](http://www.drupal.org/u/rjacobs)) -- Pol Dellaiera ([pol](http://www.drupal.org/u/pol)) - -### Sponsorship - -This project has been sponsored by: -- **UNLEASHED MIND** - Specialized in consulting and planning of Drupal powered sites, UNLEASHED - MIND offers installation, development, theming, customization, and hosting - to get you started. Visit - [http://www.unleashedmind.com](http://www.unleashedmind.com) for more - information. - diff --git a/web/modules/libraries/composer.json b/web/modules/libraries/composer.json deleted file mode 100644 index 4af11e12e838280670e4095241afeef46d2d91ca..0000000000000000000000000000000000000000 --- a/web/modules/libraries/composer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "drupal/libraries", - "description": "Allows version-dependent and shared usage of external libraries in Drupal.", - "type": "drupal-module", - "homepage": "http://drupal.org/project/libraries", - "authors": [ - ], - "support": { - "issues": "http://drupal.org/project/issues/libraries", - "irc": "irc://irc.freenode.org/drupal-contribute", - "source": "http://cgit.drupalcode.org/libraries" - }, - "license": "GPL-2.0+" -} diff --git a/web/modules/libraries/config/install/libraries.settings.yml b/web/modules/libraries/config/install/libraries.settings.yml deleted file mode 100644 index 0981884b1ad3ee32726149b1d6b4f4e950a16354..0000000000000000000000000000000000000000 --- a/web/modules/libraries/config/install/libraries.settings.yml +++ /dev/null @@ -1,10 +0,0 @@ -definition: - local: - # @todo Implement a stream wrapper that finds library definitions in e.g. - # sites/all/libraries. - path: 'public://library-definitions' - remote: - enable: TRUE - urls: - - 'http://cgit.drupalcode.org/libraries_registry/plain/registry/8' -global_locators: [] \ No newline at end of file diff --git a/web/modules/libraries/config/schema/libraries.schema.yml b/web/modules/libraries/config/schema/libraries.schema.yml deleted file mode 100644 index 72c4c52f2e80873654a90422578c90d5ae68948f..0000000000000000000000000000000000000000 --- a/web/modules/libraries/config/schema/libraries.schema.yml +++ /dev/null @@ -1,53 +0,0 @@ -# Configuration schema for the Libraries API module. - -# Base configuration schema -libraries.settings: - type: config_object - label: 'Libraries API settings' - mapping: - definition: - type: mapping - label: 'Library definition settings' - mapping: - local: - type: mapping - label: 'Local' - mapping: - path: - type: path - label: 'Local path' - remote: - type: mapping - title: 'Remote' - mapping: - enable: - type: boolean - label: 'Enable remote fetching of library definitions' - urls: - type: sequence - label: 'A list of remote library registry URLs' - sequence: - type: uri - label: 'The URL of a remote library registry' - global_locators: - type: sequence - title: 'Global library locators' - sequence: - type: mapping - title: 'Global locator plugins' - mapping: - id: - type: string - title: 'The locator plugin id' - configuration: - type: libraries.locator.[%parent.id] - title: 'The plugin configuration' - -# Dynamic locator plugin schema -libraries.locator.uri: - type: mapping - label: 'URI locator configuration' - mapping: - uri: - type: uri - label: 'The locator URI' \ No newline at end of file diff --git a/web/modules/libraries/libraries.api.php b/web/modules/libraries/libraries.api.php deleted file mode 100644 index 859e6023eb4529bcdb3731fefc7a44971744aabe..0000000000000000000000000000000000000000 --- a/web/modules/libraries/libraries.api.php +++ /dev/null @@ -1,609 +0,0 @@ -<?php - -/** - * @file - * Documents API functions for Libraries module. - */ - -/** - * @defgroup libraries External libraries - * @{ - * External libraries are not shipped as part of contributed modules for - * licensing and maintenance reasons. The Libraries API module aims to solve the - * problem of integrating with and loading external libraries as part of the - * Drupal request-response process in a generic way. - * - * @section sec_definitions Library definitions - * In order to be useful to other modules Libraries API needs a list of known - * libraries and metadata about each of the libraries. Because multiple modules - * themes may integrate with the same external library a key objective of - * Libraries API is to keep this information separate from any one module or - * theme. - * - * Definitions are accessed via a discovery that is responsible for checking - * whether a given definition exists and fetching it, if it is. See - * LibraryRegistryInterface and StreamDefinitionDiscovery for more information. - * - * @subsection sub_definitions_machine_name - * A central part of a library's metadata is the library's machine name or ID. - * For maximum interoperability it must consist of only lowercase ASCII letters, - * numbers, and underscores. As the machine name is the single identifier of a - * library and is independent of any given module or theme name it must be - * unique among all libraries known to Libraries API. - * - * @subsection sub_definitions_history Historical background - * In Drupal 7 library information could already be provided by - * module-independent info files, but this was not widely used, because there - * was no way to distribute these info files properly. The information was - * predominantly provided by a hook that modules could implement, which caused - * race conditions between modules providing information for the same library. - * Thus, in Drupal 8 there is no longer a hook making it necessary to properly - * solve the problem of centrally maintaining and distributing library info - * files. This has yet to be done. See https://www.drupal.org/node/773508 for - * more information. - * - * @section sec_types Library types - * Libraries are classed objects that implement LibraryInterface. This generic - * interface only dictates that a library is aware of its ID. Any further - * functionality depends on the type of library, each type of library comes with - * a dedicated interface. See LibraryInterface for more information. - * - * @subsection sub_types_version Version detection - * A central aspect of Libraries API is version detection. Modules or themes may - * only work with a specific version of an external library, so Libraries API - * needs a way to detect the version of a library by inspecting the library - * files. - * - * As the mechanism for doing this is generally not specific to any one - * library, it is handled by version detector plugins. A 'line_pattern' plugin - * that scans a file line by line whether for whether a pattern containing the - * version is matched. It can be used if the version is always specified in a - * particular place in a particular file, for example a changelog. See - * VersionDetectorInterface and LinePatternDetector for more information. - * - * @subsection sub_types_dependency Dependency handling - * Many libraries depend on other libraries to function. Thus, most library - * classes should implement DependentLibraryInterface to allow libraries to - * declare their dependencies as part of their metadata. In case of API changes - * in the dependencies libraries need to be able to declare dependencies on - * specific versions or version ranges of other libraries. This has yet to be - * implemented. - * - * Furthermore, Libraries API must also maintain a list of libraries that are - * required by the installed installation profile, modules, and themes - * (extensions). With this information installation of extensions with library - * dependencies can be prevented until the libraries are properly installed. - * This is currently not implemented. In the future this will be used to - * automatically retrieve library definitions of required libraries, and - * possibly to automatically download the libraries themselves. - * - * To declare library dependencies extensions can place a 'library_dependencies' - * key in their info file with a list of library machine names as the value. - * For example: - * @code - * name: My module - * type: module - * core: 8.x - * library_dependencies: - * - flexslider - * - jquery_mobile - * @endcode - * - * @subsection sub_types_asset Asset libraries - * With Drupal 8 relying on Composer for autoloading and dependency resolution - * of PHP libraries, asset libraries are the primary use-case for Libraries API. - * Because asset libraries cannot be loaded ad-hoc, but must be attached to a - * renderable element, Libraries API registers external asset libraries that are - * required by the installed extensions with the core asset library system. See - * AssetLibraryInterface for more information. - * - * @subsection sub_types_php_file - * For feature parity with the Drupal 7 version of this module, a PHP file - * library type is provided, that can load a list of PHP files on demand. - * Generally, it is encouraged to use Composer instead of this library type and - * avoid Libraries API altogether for PHP libraries. See PhpFileLibraryInterface - * for more information. - * - * This library type might be removed in a future version of Libraries API. - * - * @see \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface - * @see \Drupal\libraries\ExternalLibrary\Definition\StreamDefinitionDiscovery - * @see \Drupal\libraries\ExternalLibrary\LibraryInterface - * @see \Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface - * @see \Drupal\libraries\Plugin\libraries\VersionDetector\LinePatternDetector - * @see \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface - * @see \Drupal\libraries\ExternalLibrary\Dependency\DependentLibraryInterface - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface - * @see \Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLibraryInterface - * - * @} - */ - -/** - * Alter library type information. - * - * @param array $library_types - * An array of library types keyed by ID. Each library type is an array with - * the following keys: - * - id: The ID of the library type. - * - class: The class to use for this library type. - * - provider: The provider of this library type. - */ -function hook_libraries_library_type_info_alter(array &$library_types) { - // Use a different class for the asset library type. Note that this class is - // distinct from the class actually for asset libraries themselves. - $library_types['asset']['class'] = 'Drupal\mymodule\ExternalLibrary\BetterAssetLibraryType'; -} - -/** - * Alter library locator information. - * - * @param array $locators - * An array of library locators keyed by ID. Each locator is an array with the - * following keys: - * - id: The ID of the library locator. - * - class: The class to use for this library locator. - * - provider: The provider of this library locator. - */ -function hook_libraries_locator_info_alter(array &$locators) { - // Use a different class for the stream locator. - $locators['stream']['class'] = 'Drupal\mymodule\ExternalLibrary\BetterStreamLocator'; -} - -/** - * Alter library version detector information. - * - * @param array $version_detectors - * An array of library version detectors keyed by ID. Each detector is an - * array with the following keys: - * - id: The ID of the library version detector. - * - class: The class to use for this library version detector. - * - provider: The provider of this library version detector. - */ -function hook_libraries_version_detector_info_alter(array &$version_detectors) { - // Use a different class for the line pattern locator. - $version_detectors['line_pattern']['class'] = 'Drupal\mymodule\ExternalLibrary\BetterLinePatternDetector'; -} - -/** - * Return information about external libraries. - * - * @return - * An associative array whose keys are internal names of libraries and whose - * values are describing each library. Each key is the directory name below - * the 'libraries' directory, in which the library may be found. Each value is - * an associative array containing: - * - name: The official, human-readable name of the library. - * - vendor url: The URL of the homepage of the library. - * - download url: The URL of a web page on which the library can be obtained. - * - path: (optional) A relative path from the directory of the library to the - * actual library. Only required if the extracted download package contains - * the actual library files in a sub-directory. - * - library path: (optional) The absolute path to the library directory. This - * should not be declared normally, as it is automatically detected, to - * allow for multiple possible library locations. A valid use-case is an - * external library, in which case the full URL to the library should be - * specified here. - * - version: (optional) The version of the library. This should not be - * declared normally, as it is automatically detected (see 'version - * callback' below) to allow for version changes of libraries without code - * changes of implementing modules and to support different versions of a - * library simultaneously (though only one version can be installed per - * site). A valid use-case is an external library whose version cannot be - * determined programmatically. - * - version callback: (optional) The name of a function that detects and - * returns the full version string of the library. The first argument is - * always $library, an array containing all library information as described - * here. There are two ways to declare the version callback's additional - * arguments, either as a single $options parameter or as multiple - * parameters, which correspond to the two ways to specify the argument - * values (see 'version arguments'). Defaults to libraries_get_version(). - * - version arguments: A list of arguments to pass to the version callback. - * Version arguments can be declared either as an associative array whose - * keys are the argument names or as an indexed array without specifying - * keys. If declared as an associative array, the arguments get passed to - * the version callback as a single $options parameter whose keys are the - * argument names (i.e. $options is identical to the specified array). If - * declared as an indexed array, the array values get passed to the version - * callback as separate arguments in the order they were declared. The - * default version callback libraries_get_version() expects a single, - * associative array with named keys: - * - file: The filename to parse for the version, relative to the library - * path. For example: 'docs/changelog.txt'. - * - pattern: A string containing a regular expression (PCRE) to match the - * library version. For example: '@version\s+([0-9a-zA-Z\.-]+)@'. Note - * that the returned version is not the match of the entire pattern (i.e. - * '@version 1.2.3' in the above example) but the match of the first - * sub-pattern (i.e. '1.2.3' in the above example). - * - lines: (optional) The maximum number of lines to search the pattern in. - * Defaults to 20. - * - cols: (optional) The maximum number of characters per line to take into - * account. Defaults to 200. In case of minified or compressed files, this - * prevents reading the entire file into memory. - * - files: An associative array of library files to load. Supported keys are: - * - js: A list of JavaScript files to load, using the same syntax as Drupal - * core's hook_library(). - * - css: A list of CSS files to load, using the same syntax as Drupal - * core's hook_library(). - * - php: A list of PHP files to load. - * - dependencies: An array of libraries this library depends on. Similar to - * declaring module dependencies, the dependency declaration may contain - * information on the supported version. Examples of supported declarations: - * @code - * $libraries['dependencies'] = array( - * // Load the 'example' library, regardless of the version available: - * 'example', - * // Only load the 'example' library, if version 1.2 is available: - * 'example (1.2)', - * // Only load a version later than 1.3-beta2 of the 'example' library: - * 'example (>1.3-beta2)' - * // Only load a version equal to or later than 1.3-beta3: - * 'example (>=1.3-beta3)', - * // Only load a version earlier than 1.5: - * 'example (<1.5)', - * // Only load a version equal to or earlier than 1.4: - * 'example (<=1.4)', - * // Combinations of the above are allowed as well: - * 'example (>=1.3-beta2, <1.5)', - * ); - * @endcode - * - variants: (optional) An associative array of available library variants. - * For example, the top-level 'files' property may refer to a default - * variant that is compressed. If the library also ships with a minified and - * uncompressed/source variant, those can be defined here. Each key should - * describe the variant type, e.g. 'minified' or 'source'. Each value is an - * associative array of top-level properties that are entirely overridden by - * the variant, most often just 'files'. Additionally, each variant can - * contain following properties: - * - variant callback: (optional) The name of a function that detects the - * variant and returns TRUE or FALSE, depending on whether the variant is - * available or not. The first argument is always $library, an array - * containing all library information as described here. The second - * argument is always a string containing the variant name. There are two - * ways to declare the variant callback's additional arguments, either as a - * single $options parameter or as multiple parameters, which correspond - * to the two ways to specify the argument values (see 'variant - * arguments'). If omitted, the variant is expected to always be - * available. - * - variant arguments: A list of arguments to pass to the variant callback. - * Variant arguments can be declared either as an associative array whose - * keys are the argument names or as an indexed array without specifying - * keys. If declared as an associative array, the arguments get passed to - * the variant callback as a single $options parameter whose keys are the - * argument names (i.e. $options is identical to the specified array). If - * declared as an indexed array, the array values get passed to the - * variant callback as separate arguments in the order they were declared. - * Variants can be version-specific (see 'versions'). - * - versions: (optional) An associative array of supported library versions. - * Naturally, libraries evolve over time and so do their APIs. In case a - * library changes between versions, different 'files' may need to be - * loaded, different 'variants' may become available, or Drupal modules need - * to load different integration files adapted to the new version. Each key - * is a version *string* (PHP does not support floats as keys). Each value - * is an associative array of top-level properties that are entirely - * overridden by the version. - * - integration files: (optional) An associative array whose keys are module - * names and whose values are sets of files to load for the module, using - * the same notion as the top-level 'files' property. Each specified file - * should contain the path to the file relative to the module it belongs to. - * - callbacks: An associative array whose keys are callback groups and whose - * values are arrays of callbacks to apply to the library in that group. - * Each callback receives the following arguments: - * - $library: An array of library information belonging to the top-level - * library, a specific version, a specific variant or a specific variant - * of a specific version. Because library information such as the 'files' - * property (see above) can be declared in all these different locations - * of the library array, but a callback may have to act on all these - * different parts of the library, it is called recursively for each - * library with a certain part of the libraries array passed as $library - * each time. - * - $version: If the $library array belongs to a certain version (see - * above), a string containing the version. This argument may be empty, so - * NULL should be specified as the default value. - * - $variant: If the $library array belongs to a certain variant (see - * above), a string containing the variant name. This argument may be - * empty, so NULL should be specified as the default value. - * Valid callback groups are: - * - info: Callbacks registered in this group are applied after the library - * information has been retrieved via hook_libraries_info() or info files. - * - pre-detect: Callbacks registered in this group are applied after the - * library path has been determined and before the version callback is - * invoked. At this point the following additional information is available: - * - $library['library path']: The path on the file system to the library. - * - post-detect: Callbacks registered in this group are applied after the - * library has been successfully detected. At this point the library - * contains the version-specific information, if specified, and following - * additional information is available: - * - $library['installed']: A boolean indicating whether the library is - * installed or not. - * - $library['version']: If it could be detected, a string containing the - * version of the library. - * - $library['variants'][$variant]['installed']: For each specified - * variant, a boolean indicating whether the variant is installed or - * not. - * Note that in this group the 'versions' property is no longer available. - * - pre-load: Callbacks registered in this group are applied directly - * before this library is loaded. At this point the library contains - * variant-specific information, if specified. Note that in this group the - * 'variants' property is no longer available. - * - post-load: Callbacks registered in this group are applied directly - * after this library is loaded. At this point, the library contains a - * 'loaded' key, which contains the number of files that were loaded. - * Additional top-level properties can be registered as needed. - * - * @see hook_library() - * - * @deprecated Will be removed before a stable Drupal 8 release. - */ -function hook_libraries_info() { - // The following is a full explanation of all properties. See below for more - // concrete example implementations. - - // This array key lets Libraries API search for 'sites/all/libraries/example' - // directory, which should contain the entire, original extracted library. - $libraries['example'] = array( - // Only used in administrative UI of Libraries API. - 'name' => 'Example library', - 'vendor url' => 'http://example.com', - 'download url' => 'http://example.com/download', - // Optional: If, after extraction, the actual library files are contained in - // 'sites/all/libraries/example/lib', specify the relative path here. - 'path' => 'lib', - // Optional: Define a custom version detection callback, if required. - 'version callback' => 'mymodule_get_version', - // Specify arguments for the version callback. By default, - // libraries_get_version() takes a named argument array: - 'version arguments' => array( - 'file' => 'docs/CHANGELOG.txt', - 'pattern' => '@version\s+([0-9a-zA-Z\.-]+)@', - 'lines' => 5, - 'cols' => 20, - ), - // Default list of files of the library to load. Important: Only specify - // third-party files belonging to the library here, not integration files of - // your module. - 'files' => array( - // 'js' and 'css' follow the syntax of hook_library(), but file paths are - // relative to the library path. - 'js' => array( - 'exlib.js', - 'gadgets/foo.js', - ), - 'css' => array( - 'lib_style.css', - 'skin/example.css', - ), - // For PHP libraries, specify include files here, still relative to the - // library path. - 'php' => array( - 'exlib.php', - 'exlib.inc', - ), - ), - // Optional: Specify alternative variants of the library, if available. - 'variants' => array( - // All properties defined for 'minified' override top-level properties. - 'minified' => array( - 'files' => array( - 'js' => array( - 'exlib.min.js', - 'gadgets/foo.min.js', - ), - 'css' => array( - 'lib_style.css', - 'skin/example.css', - ), - ), - 'variant callback' => 'mymodule_check_variant', - 'variant arguments' => array( - 'variant' => 'minified', - ), - ), - ), - // Optional, but usually required: Override top-level properties for later - // versions of the library. The properties of the minimum version that is - // matched override the top-level properties. Note: - // - When registering 'versions', it usually does not make sense to register - // 'files', 'variants', and 'integration files' on the top-level, as most - // of those likely need to be different per version and there are no - // defaults. - // - The array keys have to be strings, as PHP does not support floats for - // array keys. - 'versions' => array( - '2' => array( - 'files' => array( - 'js' => array('exlib.js'), - 'css' => array('exlib_style.css'), - ), - ), - '3.0' => array( - 'files' => array( - 'js' => array('exlib.js'), - 'css' => array('lib_style.css'), - ), - ), - '3.2' => array( - 'files' => array( - 'js' => array( - 'exlib.js', - 'gadgets/foo.js', - ), - 'css' => array( - 'lib_style.css', - 'skin/example.css', - ), - ), - ), - ), - // Optional: Register files to auto-load for your module. All files must be - // keyed by module, and follow the syntax of the 'files' property. - 'integration files' => array( - 'mymodule' => array( - 'js' => array('ex_lib.inc'), - ), - ), - // Optionally register callbacks to apply to the library during different - // stages of its lifetime ('callback groups'). - 'callbacks' => array( - // Used to alter the info associated with the library. - 'info' => array( - 'mymodule_example_libraries_info_callback', - ), - // Called before detecting the given library. - 'pre-detect' => array( - 'mymodule_example_libraries_predetect_callback', - ), - // Called after detecting the library. - 'post-detect' => array( - 'mymodule_example_libraries_postdetect_callback', - ), - // Called before the library is loaded. - 'pre-load' => array( - 'mymodule_example_libraries_preload_callback', - ), - // Called after the library is loaded. - 'post-load' => array( - 'mymodule_example_libraries_postload_callback', - ), - ), - ); - - // A very simple library. No changing APIs (hence, no versions), no variants. - // Expected to be extracted into 'sites/all/libraries/simple'. - $libraries['simple'] = array( - 'name' => 'Simple library', - 'vendor url' => 'http://example.com/simple', - 'download url' => 'http://example.com/simple', - 'version arguments' => array( - 'file' => 'readme.txt', - // Best practice: Document the actual version strings for later reference. - // 1.x: Version 1.0 - 'pattern' => '/Version (\d+)/', - 'lines' => 5, - ), - 'files' => array( - 'js' => array('simple.js'), - ), - ); - - // A library that (naturally) evolves over time with API changes. - $libraries['tinymce'] = array( - 'name' => 'TinyMCE', - 'vendor url' => 'http://tinymce.moxiecode.com', - 'download url' => 'http://tinymce.moxiecode.com/download.php', - 'path' => 'jscripts/tiny_mce', - // The regular expression catches two parts (the major and the minor - // version), which libraries_get_version() doesn't allow. - 'version callback' => 'tinymce_get_version', - 'version arguments' => array( - // It can be easier to parse the first characters of a minified file - // instead of doing a multi-line pattern matching in a source file. See - // 'lines' and 'cols' below. - 'file' => 'jscripts/tiny_mce/tiny_mce.js', - // Best practice: Document the actual version strings for later reference. - // 2.x: this.majorVersion="2";this.minorVersion="1.3" - // 3.x: majorVersion:'3',minorVersion:'2.0.1' - 'pattern' => '@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', - 'lines' => 1, - 'cols' => 100, - ), - 'versions' => array( - '2.1' => array( - 'files' => array( - 'js' => array('tiny_mce.js'), - ), - 'variants' => array( - 'source' => array( - 'files' => array( - 'js' => array('tiny_mce_src.js'), - ), - ), - ), - 'integration files' => array( - 'wysiwyg' => array( - 'js' => array('editors/js/tinymce-2.js'), - 'css' => array('editors/js/tinymce-2.css'), - ), - ), - ), - // Definition used if 3.1 or above is detected. - '3.1' => array( - // Does not support JS aggregation. - 'files' => array( - 'js' => array( - 'tiny_mce.js' => array('preprocess' => FALSE), - ), - ), - 'variants' => array( - // New variant leveraging jQuery. Not stable yet; therefore not the - // default variant. - 'jquery' => array( - 'files' => array( - 'js' => array( - 'tiny_mce_jquery.js' => array('preprocess' => FALSE), - ), - ), - ), - 'source' => array( - 'files' => array( - 'js' => array( - 'tiny_mce_src.js' => array('preprocess' => FALSE), - ), - ), - ), - ), - 'integration files' => array( - 'wysiwyg' => array( - 'js' => array('editors/js/tinymce-3.js'), - 'css' => array('editors/js/tinymce-3.css'), - ), - ), - ), - ), - ); - return $libraries; -} - -/** - * Alter the library information before detection and caching takes place. - * - * The library definitions are passed by reference. A common use-case is adding - * a module's integration files to the library array, so that the files are - * loaded whenever the library is. As noted above, it is important to declare - * integration files inside of an array, whose key is the module name. - * - * @see hook_libraries_info() - * - * @deprecated Will be removed before a stable Drupal 8 release. - */ -function hook_libraries_info_alter(&$libraries) { - $files = array( - 'php' => array('example_module.php_spellchecker.inc'), - ); - $libraries['php_spellchecker']['integration files']['example_module'] = $files; -} - -/** - * Specify paths to look for library info files. - * - * Libraries API looks in the following directories for library info files by - * default: - * - libraries - * - profiles/$profile/libraries - * - sites/all/libraries - * - sites/$site/libraries - * This hook allows you to specify additional locations to look for library info - * files. This should only be used for modules that declare many libraries. - * Modules that only implement a few libraries should implement - * hook_libraries_info(). - * - * @return - * An array of paths. - * - * @deprecated Will be removed before a stable Drupal 8 release. - */ -function hook_libraries_info_file_paths() { - // Taken from the Libraries test module, which needs to specify the path to - // the test library. - return array(drupal_get_path('module', 'libraries_test') . '/example'); -} diff --git a/web/modules/libraries/libraries.drush.inc b/web/modules/libraries/libraries.drush.inc deleted file mode 100644 index 22b7d62da06a06d4e827d689126d42c61a5e25f1..0000000000000000000000000000000000000000 --- a/web/modules/libraries/libraries.drush.inc +++ /dev/null @@ -1,169 +0,0 @@ -<?php - -/** - * @file - * Drush integration for Libraries API. - */ - -use Drupal\Component\Utility\Unicode; - -/** - * Implements hook_drush_command(). - */ -function libraries_drush_command() { - $items['libraries-list'] = array( - 'callback' => 'libraries_drush_list', - 'description' => dt('Lists registered library information.'), - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - ); - /**$items['libraries-download'] = array( - 'callback' => 'libraries_drush_download', - 'description' => dt('Downloads a registered library into the libraries directory for the active site.'), - 'arguments' => array( - 'name' => dt('The internal name of the registered library.'), - ), - );*/ - return $items; -} - -/** - * Implements hook_drush_help(). - */ -function libraries_drush_help($section) { - switch ($section) { - case 'drush:libraries-list': - return dt('Lists registered library information.'); - - case 'drush:libraries-download': - return dt('Downloads a registered library into the libraries directory for the active site. - -See libraries-list for a list of registered libraries.'); - } -} - -/** - * Implements hook_drush_cache_clear(). - * - * @see drush_cache_clear_types() - */ -function libraries_drush_cache_clear(&$types) { - $types['libraries'] = 'libraries_drush_invalidate_cache'; -} - -/** - * Clears the library cache. - */ -function libraries_drush_invalidate_cache() { - \Drupal::cache('libraries')->deleteAll(); -} - -/** - * Lists registered library information. - */ -function libraries_drush_list() { - $libraries = array(); - foreach (libraries_info() as $name => $info) { - $libraries[$name] = libraries_detect($name); - } - ksort($libraries); - - if (empty($libraries)) { - drush_print('There are no registered libraries.'); - } - - else { - $rows = array(); - // drush_print_table() automatically treats the first row as the header, if - // $header is TRUE. - $rows[] = array(dt('Name'), dt('Status'), dt('Version'), dt('Variants'), dt('Dependencies')); - foreach ($libraries as $name => $library) { - $status = ($library['installed'] ? dt('OK') : Unicode::ucfirst($library['error'])); - $version = (($library['installed'] && !empty($library['version'])) ? $library['version'] : '-'); - - // Only list installed variants. - $variants = array(); - foreach ($library['variants'] as $variant_name => $variant) { - if ($variant['installed']) { - $variants[] = $variant_name; - } - } - $variants = (empty($variants) ? '-' : implode(', ', $variants)); - - $dependencies = (!empty($library['dependencies']) ? implode(', ', $library['dependencies']) : '-'); - - $rows[] = array($name, $status, $version, $variants, $dependencies); - } - // Make the possible values for the 'Status' column and the 'Version' header - // wrap nicely. - $widths = array(0, 12, 7, 0, 0); - drush_print_table($rows, TRUE, $widths); - } -} - -/** - * Downloads a library. - * - * @param $name - * The internal name of the library to download. - */ -function libraries_drush_download($name) { - return; - - // @todo Looks wonky? - if (!drush_shell_exec('type unzip')) { - return drush_set_error(dt('Missing dependency: unzip. Install it before using this command.')); - } - - // @todo Simply use current drush site. - $args = func_get_args(); - if ($args[0]) { - $path = $args[0]; - } - else { - $path = 'sites/all/libraries'; - } - - // Create the path if it does not exist. - if (!is_dir($path)) { - drush_op('mkdir', $path); - drush_log(dt('Directory @path was created', array('@path' => $path)), 'notice'); - } - - // Set the directory to the download location. - $olddir = getcwd(); - chdir($path); - - $filename = basename(COLORBOX_DOWNLOAD_URI); - $dirname = basename(COLORBOX_DOWNLOAD_URI, '.zip'); - - // Remove any existing Colorbox plugin directory - if (is_dir($dirname)) { - drush_log(dt('A existing Colorbox plugin was overwritten at @path', array('@path' => $path)), 'notice'); - } - // Remove any existing Colorbox plugin zip archive - if (is_file($filename)) { - drush_op('unlink', $filename); - } - - // Download the zip archive - if (!drush_shell_exec('wget '. COLORBOX_DOWNLOAD_URI)) { - drush_shell_exec('curl -O '. COLORBOX_DOWNLOAD_URI); - } - - if (is_file($filename)) { - // Decompress the zip archive - drush_shell_exec('unzip -qq -o '. $filename); - // Remove the zip archive - drush_op('unlink', $filename); - } - - // Set working directory back to the previous working directory. - chdir($olddir); - - if (is_dir($path .'/'. $dirname)) { - drush_log(dt('Colorbox plugin has been downloaded to @path', array('@path' => $path)), 'success'); - } - else { - drush_log(dt('Drush was unable to download the Colorbox plugin to @path', array('@path' => $path)), 'error'); - } -} diff --git a/web/modules/libraries/libraries.info.yml b/web/modules/libraries/libraries.info.yml deleted file mode 100644 index 02136222c77638e32a78040d0087cc6853c16d30..0000000000000000000000000000000000000000 --- a/web/modules/libraries/libraries.info.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Libraries -type: module -description: Allows version-dependent and shared usage of external libraries. -# core: 8.x - -# Information added by Drupal.org packaging script on 2018-01-27 -version: '8.x-3.0-alpha1' -core: '8.x' -project: 'libraries' -datestamp: 1517046488 diff --git a/web/modules/libraries/libraries.install b/web/modules/libraries/libraries.install deleted file mode 100644 index a2edea4928282ff1d92f9450917fe12d6f584911..0000000000000000000000000000000000000000 --- a/web/modules/libraries/libraries.install +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * @file - * Containsinstall, uninstall and update functions for Libraries API. - */ - -use Drupal\libraries\ExternalLibrary\Definition\FileDefinitionDiscovery; - -/** - * Implements hook_install(). - */ -function libraries_install() { - if (!is_dir('public://library-definitions')) { - /** @var \Drupal\Core\File\FileSystemInterface $file_system */ - $file_system = \Drupal::service('file_system'); - $file_system->mkdir('public://library-definitions'); - } -} - -/** - * Implements hook_uninstall(). - */ -function libraries_uninstall() { - if (is_dir('public://library-definitions')) { - file_unmanaged_delete_recursive('public://library-definitions'); - } -} diff --git a/web/modules/libraries/libraries.module b/web/modules/libraries/libraries.module deleted file mode 100644 index 3006c345ceb1716bce03c98045f108430fb6a39f..0000000000000000000000000000000000000000 --- a/web/modules/libraries/libraries.module +++ /dev/null @@ -1,868 +0,0 @@ -<?php - -/** - * @file - * External library handling for Drupal modules. - */ - -use Drupal\Core\DrupalKernel; -use Drupal\Core\Extension\ModuleHandler; -use Drupal\libraries\ExternalLibrary\Asset\AttachableAssetLibraryRegistrationInterface; -use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorInterface; -use Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorInterface; -use Symfony\Component\Yaml\Parser; - -/** - * Implements hook_library_info_build(). - * - * Register external asset libraries with Drupal core's library APIs. - */ -function libraries_library_info_build() { - /** @var \Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager */ - $library_manager = \Drupal::service('libraries.manager'); - $attachable_libraries = []; - $libraries_with_errors = []; - foreach ($library_manager->getRequiredLibraryIds() as $external_library_id) { - try { - $external_library = $library_manager->getLibrary($external_library_id); - $library_type = $external_library->getType(); - if ($library_type instanceof AttachableAssetLibraryRegistrationInterface) { - $attachable_libraries += $library_type->getAttachableAssetLibraries($external_library, $library_manager); - } - } - catch (\Exception $e) { - // Library-specific exceptions should not be allowed to kill the rest of - // the build process, but should be logged. - if ($e instanceof LibraryIdAccessorInterface || $e instanceof LibraryAccessorInterface) { - $libraries_with_errors[] = $external_library_id; - watchdog_exception('libraries', $e); - } - else { - // Re-throw exceptions that are not library-specific. - throw $e; - } - } - } - // If we had library specific errors also log an informative message to - // tell admins that detection will not be run again without a cache clear. - if ($libraries_with_errors) { - \Drupal::logger('libraries')->error('The following external libraries could not successfully be registered with Drupal core: @libs. See earlier log entries for more details. Once these issues are addressed please be sure to clear your Drupal library cache to ensure external library detection is run again.', ['@libs' => implode(',', $libraries_with_errors)]); - } - return $attachable_libraries; -} - -/** - * Gets the path of a library. - * - * @param $name - * The machine name of a library to return the path for. - * @param $base_path - * Whether to prefix the resulting path with base_path(). - * - * @return - * The path to the specified library or FALSE if the library wasn't found. - * - * @ingroup libraries - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_get_path($name, $base_path = FALSE) { - $libraries = &drupal_static(__FUNCTION__); - - if (!isset($libraries)) { - $libraries = libraries_get_libraries(); - } - - $path = ($base_path ? base_path() : ''); - if (!isset($libraries[$name])) { - return FALSE; - } - else { - $path .= $libraries[$name]; - } - - return $path; -} - -/** - * Returns an array of library directories. - * - * Returns an array of library directories from the all-sites directory - * (i.e. sites/all/libraries/), the profiles directory, and site-specific - * directory (i.e. sites/somesite/libraries/). The returned array will be keyed - * by the library name. Site-specific libraries are prioritized over libraries - * in the default directories. That is, if a library with the same name appears - * in both the site-wide directory and site-specific directory, only the - * site-specific version will be listed. - * - * @return - * A list of library directories. - * - * @ingroup libraries - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_get_libraries() { - $searchdir = array(); - $config = DrupalKernel::findSitePath(\Drupal::request()); - - // @todo core/libraries - - // Similar to 'modules' and 'themes' directories inside an installation - // profile, installation profiles may want to place libraries into a - // 'libraries' directory. - if ($profile = drupal_get_profile()) { - $profile_path = drupal_get_path('profile', $profile); - $searchdir[] = "$profile_path/libraries"; - }; - - // Search sites/all/libraries for backwards-compatibility. - $searchdir[] = 'sites/all/libraries'; - - // Always search the root 'libraries' directory. - $searchdir[] = 'libraries'; - - // Also search sites/<domain>/*. - $searchdir[] = "$config/libraries"; - - // Retrieve list of directories. - $directories = array(); - $nomask = array('CVS'); - foreach ($searchdir as $dir) { - if (is_dir($dir) && $handle = opendir($dir)) { - while (FALSE !== ($file = readdir($handle))) { - if (!in_array($file, $nomask) && $file[0] != '.') { - if (is_dir("$dir/$file")) { - $directories[$file] = "$dir/$file"; - } - } - } - closedir($handle); - } - } - - return $directories; -} - -/** - * Looks for library info files. - * - * This function scans the following directories for info files: - * - libraries - * - profiles/$profilename/libraries - * - sites/all/libraries - * - sites/$sitename/libraries - * - any directories specified via hook_libraries_info_file_paths() - * - * @return - * An array of info files, keyed by library name. The values are the paths of - * the files. - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_scan_info_files() { - $profile = drupal_get_path('profile', drupal_get_profile()); - $config = DrupalKernel::findSitePath(\Drupal::request()); - - // Build a list of directories. - $directories = \Drupal::moduleHandler()->invokeAll('libraries_info_file_paths', $args = array()); - $directories[] = "$profile/libraries"; - $directories[] = 'sites/all/libraries'; - $directories[] = 'libraries'; - $directories[] = "$config/libraries"; - - // Scan for info files. - $files = array(); - foreach ($directories as $dir) { - if (file_exists($dir)) { - $files = array_merge($files, file_scan_directory($dir, '@^[a-z0-9._-]+\.libraries\.info\.yml$@', array( - 'key' => 'name', - 'recurse' => FALSE, - ))); - } - } - - foreach ($files as $filename => $file) { - $files[basename($filename, '.libraries.info')] = $file; - unset($files[$filename]); - } - - return $files; -} - -/** - * Invokes library callbacks. - * - * @param $group - * A string containing the group of callbacks that is to be applied. Should be - * either 'info', 'pre-detect', 'post-detect', or 'load'. - * @param $library - * An array of library information, passed by reference. - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_invoke($group, &$library) { - foreach ($library['callbacks'][$group] as $callback) { - libraries_traverse_library($library, $callback); - } -} - -/** - * Helper function to apply a callback to all parts of a library. - * - * Because library declarations can include variants and versions, and those - * version declarations can in turn include variants, modifying e.g. the 'files' - * property everywhere it is declared can be quite cumbersome, in which case - * this helper function is useful. - * - * @param $library - * An array of library information, passed by reference. - * @param $callback - * A string containing the callback to apply to all parts of a library. - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_traverse_library(&$library, $callback) { - // Always apply the callback to the top-level library. - $callback($library, NULL, NULL); - - // Apply the callback to versions. - if (isset($library['versions'])) { - foreach ($library['versions'] as $version_string => &$version) { - $callback($version, $version_string, NULL); - // Versions can include variants as well. - if (isset($version['variants'])) { - foreach ($version['variants'] as $version_variant_name => &$version_variant) { - $callback($version_variant, $version_string, $version_variant_name); - } - } - } - } - - // Apply the callback to variants. - if (isset($library['variants'])) { - foreach ($library['variants'] as $variant_name => &$variant) { - $callback($variant, NULL, $variant_name); - } - } -} - -/** - * Library info callback to make all 'files' properties consistent. - * - * This turns libraries' file information declared as e.g. - * @code - * $library['files']['js'] = array('example_1.js', 'example_2.js'); - * @endcode - * into - * @code - * $library['files']['js'] = array( - * 'example_1.js' => array(), - * 'example_2.js' => array(), - * ); - * @endcode - * It does the same for the 'integration files' property. - * - * @param $library - * An associative array of library information or a part of it, passed by - * reference. - * @param $version - * If the library information belongs to a specific version, the version - * string. NULL otherwise. - * @param $variant - * If the library information belongs to a specific variant, the variant name. - * NULL otherwise. - * - * @see libraries_info() - * @see libraries_invoke() - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_prepare_files(&$library, $version = NULL, $variant = NULL) { - // Both the 'files' property and the 'integration files' property contain file - // declarations, and we want to make both consistent. - $file_types = array(); - if (isset($library['files'])) { - $file_types[] = &$library['files']; - } - if (isset($library['integration files'])) { - // Integration files are additionally keyed by module. - foreach ($library['integration files'] as &$integration_files) { - $file_types[] = &$integration_files; - } - } - foreach ($file_types as &$files) { - // Go through all supported types of files. - foreach (array('js', 'css', 'php') as $type) { - if (isset($files[$type])) { - foreach ($files[$type] as $key => $value) { - // Unset numeric keys and turn the respective values into keys. - if (is_numeric($key)) { - $files[$type][$value] = array(); - unset($files[$type][$key]); - } - } - } - } - } -} - -/** - * Library post-detect callback to process and detect dependencies. - * - * It checks whether each of the dependencies of a library are installed and - * available in a compatible version. - * - * @param $library - * An associative array of library information or a part of it, passed by - * reference. - * @param $version - * If the library information belongs to a specific version, the version - * string. NULL otherwise. - * @param $variant - * If the library information belongs to a specific variant, the variant name. - * NULL otherwise. - * - * @see libraries_info() - * @see libraries_invoke() - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_detect_dependencies(&$library, $version = NULL, $variant = NULL) { - if (isset($library['dependencies'])) { - foreach ($library['dependencies'] as &$dependency_string) { - $dependency_info = ModuleHandler::parseDependency($dependency_string); - $dependency = libraries_detect($dependency_info['name']); - if (!$dependency['installed']) { - $library['installed'] = FALSE; - $library['error'] = 'missing dependency'; - $library['error message'] = t('The %dependency library, which the %library library depends on, is not installed.', array( - '%dependency' => $dependency['name'], - '%library' => $library['name'], - )); - } - elseif (drupal_check_incompatibility($dependency_info, $dependency['version'])) { - $library['installed'] = FALSE; - $library['error'] = 'incompatible dependency'; - $library['error message'] = t('The version %dependency_version of the %dependency library is not compatible with the %library library.', array( - '%dependency_version' => $dependency['version'], - '%dependency' => $dependency['name'], - '%library' => $library['name'], - )); - } - - // Remove the version string from the dependency, so libraries_load() can - // load the libraries directly. - $dependency_string = $dependency_info['name']; - } - } -} - -/** - * Returns information about registered libraries. - * - * The returned information is unprocessed; i.e., as registered by modules. - * - * @param $name - * (optional) The machine name of a library to return registered information - * for. If omitted, information about all registered libraries is returned. - * - * @return array|false - * An associative array containing registered information for all libraries, - * the registered information for the library specified by $name, or FALSE if - * the library $name is not registered. - * - * @see hook_libraries_info() - * - * @todo Re-introduce support for include file plugin system - either by copying - * Wysiwyg's code, or directly switching to CTools. - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function &libraries_info($name = NULL) { - // This static cache is re-used by libraries_detect() to save memory. - $libraries = &drupal_static(__FUNCTION__); - - if (!isset($libraries)) { - $libraries = array(); - // Gather information from hook_libraries_info(). - $module_handler = \Drupal::moduleHandler(); - foreach ($module_handler->getImplementations('libraries_info') as $module) { - foreach ($module_handler->invoke($module, 'libraries_info') as $machine_name => $properties) { - $properties['module'] = $module; - $libraries[$machine_name] = $properties; - } - } - // Gather information from hook_libraries_info() in enabled themes. - // @see drupal_alter() - global $theme, $base_theme_info; - if (isset($theme)) { - $theme_keys = array(); - foreach ($base_theme_info as $base) { - $theme_keys[] = $base->name; - } - $theme_keys[] = $theme; - foreach ($theme_keys as $theme_key) { - $function = $theme_key . '_' . 'libraries_info'; - if (function_exists($function)) { - foreach ($function() as $machine_name => $properties) { - $properties['theme'] = $theme_key; - $libraries[$machine_name] = $properties; - } - } - } - } - - // Gather information from .info files. - // .info files override module definitions. - // In order to stop Drupal's extension and the Drupal.org packaging - // system from finding library info files we use the 'libraries.info.yml' - // file extension. Therefore, having a 'type' key, like info files of - // modules, themes, and profiles have, is superfluous. - // \Drupal\Core\Extension\InfoParser, however, enforces the existence of a - // 'type' key in info files. We therefore use Symfony's YAML parser - // directly. - // @todo Consider creating a dedicating InfoParser for library info files - // similar to \Drupal\Core\Extension\InfoParser - $parser = new Parser(); - foreach (libraries_scan_info_files() as $machine_name => $file) { - $properties = $parser->parse(file_get_contents($file->uri)); - $properties['info file'] = $file->uri; - $libraries[$machine_name] = $properties; - } - - // Provide defaults. - foreach ($libraries as $machine_name => &$properties) { - libraries_info_defaults($properties, $machine_name); - } - - // Allow modules to alter the registered libraries. - $module_handler->alter('libraries_info', $libraries); - - // Invoke callbacks in the 'info' group. - foreach ($libraries as &$properties) { - libraries_invoke('info', $properties); - } - } - - if (isset($name)) { - if (!empty($libraries[$name])) { - return $libraries[$name]; - } - else { - $false = FALSE; - return $false; - } - } - return $libraries; -} - -/** - * Applies default properties to a library definition. - * - * @library - * An array of library information, passed by reference. - * @name - * The machine name of the passed-in library. - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_info_defaults(&$library, $name) { - $library += array( - 'machine name' => $name, - 'name' => $name, - 'vendor url' => '', - 'download url' => '', - 'path' => '', - 'library path' => NULL, - 'version callback' => 'libraries_get_version', - 'version arguments' => array(), - 'files' => array(), - 'dependencies' => array(), - 'variants' => array(), - 'versions' => array(), - 'integration files' => array(), - 'callbacks' => array(), - ); - $library['callbacks'] += array( - 'info' => array(), - 'pre-detect' => array(), - 'post-detect' => array(), - 'pre-load' => array(), - 'post-load' => array(), - ); - - // Add our own callbacks before any others. - array_unshift($library['callbacks']['info'], 'libraries_prepare_files'); - array_unshift($library['callbacks']['post-detect'], 'libraries_detect_dependencies'); - - return $library; -} - -/** - * Tries to detect a library and its installed version. - * - * @param $name - * The machine name of a library to return registered information for. - * - * @return array|false - * An associative array containing registered information for the library - * specified by $name, or FALSE if the library $name is not registered. - * In addition to the keys returned by libraries_info(), the following keys - * are contained: - * - installed: A boolean indicating whether the library is installed. Note - * that not only the top-level library, but also each variant contains this - * key. - * - version: If the version could be detected, the full version string. - * - error: If an error occurred during library detection, one of the - * following error statuses: "not found", "not detected", "not supported". - * - error message: If an error occurred during library detection, a detailed - * error message. - * - * @see libraries_info() - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_detect($name) { - // Re-use the statically cached value of libraries_info() to save memory. - $library = &libraries_info($name); - - if ($library === FALSE) { - return $library; - } - // If 'installed' is set, library detection ran already. - if (isset($library['installed'])) { - return $library; - } - - $library['installed'] = FALSE; - - // Check whether the library exists. - if (!isset($library['library path'])) { - $library['library path'] = libraries_get_path($library['machine name']); - } - if ($library['library path'] === FALSE || !file_exists($library['library path'])) { - $library['error'] = 'not found'; - $library['error message'] = t('The %library library could not be found.', array( - '%library' => $library['name'], - )); - return $library; - } - - // Invoke callbacks in the 'pre-detect' group. - libraries_invoke('pre-detect', $library); - - // Detect library version, if not hardcoded. - if (!isset($library['version'])) { - // We support both a single parameter, which is an associative array, and an - // indexed array of multiple parameters. - if (isset($library['version arguments'][0])) { - // Add the library as the first argument. - $library['version'] = call_user_func_array($library['version callback'], array_merge(array($library), $library['version arguments'])); - } - else { - $library['version'] = $library['version callback']($library, $library['version arguments']); - } - if (empty($library['version'])) { - $library['error'] = 'not detected'; - $library['error message'] = t('The version of the %library library could not be detected.', array( - '%library' => $library['name'], - )); - return $library; - } - } - - // Determine to which supported version the installed version maps. - if (!empty($library['versions'])) { - ksort($library['versions']); - $version = 0; - foreach ($library['versions'] as $supported_version => $version_properties) { - if (version_compare($library['version'], $supported_version, '>=')) { - $version = $supported_version; - } - } - if (!$version) { - $library['error'] = 'not supported'; - $library['error message'] = t('The installed version %version of the %library library is not supported.', array( - '%version' => $library['version'], - '%library' => $library['name'], - )); - return $library; - } - - // Apply version specific definitions and overrides. - $library = array_merge($library, $library['versions'][$version]); - unset($library['versions']); - } - - // Check each variant if it is installed. - if (!empty($library['variants'])) { - foreach ($library['variants'] as $variant_name => &$variant) { - // If no variant callback has been set, assume the variant to be - // installed. - if (!isset($variant['variant callback'])) { - $variant['installed'] = TRUE; - } - else { - // We support both a single parameter, which is an associative array, - // and an indexed array of multiple parameters. - if (isset($variant['variant arguments'][0])) { - // Add the library as the first argument, and the variant name as the second. - $variant['installed'] = call_user_func_array($variant['variant callback'], array_merge(array($library, $variant_name), $variant['variant arguments'])); - } - else { - $variant['installed'] = $variant['variant callback']($library, $variant_name, $variant['variant arguments']); - } - if (!$variant['installed']) { - $variant['error'] = 'not found'; - $variant['error message'] = t('The %variant variant of the %library library could not be found.', array( - '%variant' => $variant_name, - '%library' => $library['name'], - )); - } - } - } - } - - // If we end up here, the library should be usable. - $library['installed'] = TRUE; - - // Invoke callbacks in the 'post-detect' group. - libraries_invoke('post-detect', $library); - - return $library; -} - -/** - * Loads a library. - * - * @param $name - * The name of the library to load. - * @param $variant - * The name of the variant to load. Note that only one variant of a library - * can be loaded within a single request. The variant that has been passed - * first is used; different variant names in subsequent calls are ignored. - * - * @return - * An associative array of the library information as returned from - * libraries_info(). The top-level properties contain the effective definition - * of the library (variant) that has been loaded. Additionally: - * - installed: Whether the library is installed, as determined by - * libraries_detect_library(). - * - loaded: Either the amount of library files that have been loaded, or - * FALSE if the library could not be loaded. - * See hook_libraries_info() for more information. - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_load($name, $variant = NULL) { - $loaded = &drupal_static(__FUNCTION__, array()); - - if (!isset($loaded[$name])) { - $library = \Drupal::cache('libraries')->get($name); - if ($library) { - $library = $library->data; - } - else { - $library = libraries_detect($name); - \Drupal::cache('libraries')->set($name, $library); - } - // If a variant was specified, override the top-level properties with the - // variant properties. - if (isset($variant)) { - // Ensure that the $variant key exists, and if it does not, set its - // 'installed' property to FALSE by default. This will prevent the loading - // of the library files below. - $library['variants'] += array($variant => array('installed' => FALSE)); - $library = array_merge($library, $library['variants'][$variant]); - } - // Regardless of whether a specific variant was requested or not, there can - // only be one variant of a library within a single request. - unset($library['variants']); - - // If the library (variant) is installed, load it. - $library['loaded'] = FALSE; - if ($library['installed']) { - // Load library dependencies. - if (isset($library['dependencies'])) { - foreach ($library['dependencies'] as $dependency) { - libraries_load($dependency); - } - } - - // Invoke callbacks in the 'pre-load' group. - libraries_invoke('pre-load', $library); - - // Load all the files associated with the library. - $library['loaded'] = libraries_load_files($library); - - // Invoke callbacks in the 'post-load' group. - libraries_invoke('post-load', $library); - } - $loaded[$name] = $library; - } - - return $loaded[$name]; -} - -/** - * Loads a library's files. - * - * @param $library - * An array of library information as returned by libraries_info(). - * - * @return - * The number of loaded files. - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_load_files($library) { - - // Construct the full path to the library for later use. - $path = $library['library path']; - $path = ($library['path'] !== '' ? $path . '/' . $library['path'] : $path); - - // Count the number of loaded files for the return value. - $count = 0; - - // Load both the JavaScript and the CSS files. - // The parameters for drupal_add_js() and drupal_add_css() require special - // handling. - // @see drupal_process_attached() - foreach (array('js', 'css') as $type) { - // Given the removal of core functions like _drupal_add_js and - // _drupal_add_css the logic below cannot safely be run anymore. - // @see https://www.drupal.org/node/2702563 - break; - if (!empty($library['files'][$type])) { - foreach ($library['files'][$type] as $data => $options) { - // If the value is not an array, it's a filename and passed as first - // (and only) argument. - if (!is_array($options)) { - $data = $options; - $options = array(); - } - // In some cases, the first parameter ($data) is an array. Arrays can't - // be passed as keys in PHP, so we have to get $data from the value - // array. - if (is_numeric($data)) { - $data = $options['data']; - unset($options['data']); - } - // Prepend the library path to the file name. - $data = "$path/$data"; - // Apply the default group if the group isn't explicitly given. - if (!isset($options['group'])) { - $options['group'] = ($type == 'js') ? JS_DEFAULT : CSS_AGGREGATE_DEFAULT; - } - if ($type === 'js') { - $options['version'] = -1; - } - // @todo Avoid the usage of _drupal_add_js() and _drupal_add_css() - call_user_func('_drupal_add_' . $type, $data, $options); - $count++; - } - } - } - - // Load PHP files. - if (!empty($library['files']['php'])) { - foreach ($library['files']['php'] as $file => $array) { - $file_path = DRUPAL_ROOT . '/' . $path . '/' . $file; - if (file_exists($file_path)) { - require_once $file_path; - $count++; - } - } - } - - // Load integration files. - if (!empty($library['integration files'])) { - foreach ($library['integration files'] as $module => $files) { - libraries_load_files(array( - 'files' => $files, - 'path' => '', - 'library path' => drupal_get_path('module', $module), - )); - } - } - - return $count; -} - -/** - * Gets the version information from an arbitrary library. - * - * @param $library - * An associative array containing all information about the library. - * @param $options - * An associative array containing with the following keys: - * - file: The filename to parse for the version, relative to the library - * path. For example: 'docs/changelog.txt'. - * - pattern: A string containing a regular expression (PCRE) to match the - * library version. For example: '@version\s+([0-9a-zA-Z\.-]+)@'. Note that - * the returned version is not the match of the entire pattern (i.e. - * '@version 1.2.3' in the above example) but the match of the first - * sub-pattern (i.e. '1.2.3' in the above example). - * - lines: (optional) The maximum number of lines to search the pattern in. - * Defaults to 20. - * - cols: (optional) The maximum number of characters per line to take into - * account. Defaults to 200. In case of minified or compressed files, this - * prevents reading the entire file into memory. - * - * @return - * A string containing the version of the library. - * - * @see libraries_get_path() - * - * @deprecated Will be removed before a stable Drupal 8 release. Please use the - * new library load and managment concepts described at: - * https://www.drupal.org/node/2170763 - */ -function libraries_get_version($library, $options) { - // Provide defaults. - $options += array( - 'file' => '', - 'pattern' => '', - 'lines' => 20, - 'cols' => 200, - ); - - $file = DRUPAL_ROOT . '/' . $library['library path'] . '/' . $options['file']; - if (empty($options['file']) || !file_exists($file)) { - return; - } - $file = fopen($file, 'r'); - while ($options['lines'] && $line = fgets($file, $options['cols'])) { - if (preg_match($options['pattern'], $line, $version)) { - fclose($file); - return $version[1]; - } - $options['lines']--; - } - fclose($file); -} diff --git a/web/modules/libraries/libraries.services.yml b/web/modules/libraries/libraries.services.yml deleted file mode 100644 index b2880ad5724639f929802a12a69d90ca7818599f..0000000000000000000000000000000000000000 --- a/web/modules/libraries/libraries.services.yml +++ /dev/null @@ -1,73 +0,0 @@ -services: - libraries.manager: - class: Drupal\libraries\ExternalLibrary\LibraryManager - arguments: - - '@libraries.definition.discovery' - - '@plugin.manager.libraries.library_type' - - # By default Libraries API downloads library definitions from a number of - # remote library registries, the canonical one being - # https://www.drupal.org/project/libraries_registry, and stores them locally - # in the public://library-definitions directory. The URLs of the remote - # library registries and the local base path can be configured. The remote - # fetching can also be disabled altogether. - libraries.definition.discovery: - class: Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface - factory: 'libraries.definition.discovery.factory:get' - libraries.definition.discovery.factory: - class: Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryFactory - arguments: - - '@config.factory' - - '@serialization.json' - - '@http_client' - - '@serialization.json' - # If you instead want to check your library definitions into version control - # and use YAML for them instead of JSON, you can place the following service - # definition in your site's services.yml file: - # libraries.definition.discovery: - # class: Drupal\libraries\ExternalLibrary\Definition\FileDefinitionDiscovery - # arguments: - # - '@serialization.yaml' - # # Replace this with the location of the library definitions in your setup. - # - '../library-definitions' - - plugin.manager.libraries.library_type: - class: Drupal\libraries\ExternalLibrary\Type\LibraryTypeFactory - parent: default_plugin_manager - plugin.manager.libraries.locator: - class: Drupal\libraries\ExternalLibrary\Local\LocatorManager - parent: default_plugin_manager - plugin.manager.libraries.version_detector: - class: Drupal\libraries\ExternalLibrary\Version\VersionDetectorManager - parent: default_plugin_manager - - libraries.config_subscriber: - class: Drupal\libraries\Config\LibrariesConfigSubscriber - arguments: ['@service_container'] - tags: - - { name: event_subscriber } - - libraries.php_file_loader: - class: Drupal\libraries\ExternalLibrary\PhpFile\PhpRequireLoader - - stream_wrapper.library_definitions: - class: Drupal\libraries\StreamWrapper\LibraryDefinitionsStream - arguments: ['@config.factory'] - tags: - - { name: stream_wrapper, scheme: 'library-definitions' } - stream_wrapper.asset_libraries: - class: Drupal\libraries\StreamWrapper\AssetLibrariesStream - tags: - - { name: stream_wrapper, scheme: 'asset' } - stream_wrapper.php_file_libraries: - class: Drupal\libraries\StreamWrapper\PhpFileLibrariesStream - tags: - - { name: stream_wrapper, scheme: 'php-file' } - - - cache.libraries: - class: Drupal\Core\Cache\CacheBackendInterface - tags: - - { name: cache.bin } - factory: cache_factory:get - arguments: [library] diff --git a/web/modules/libraries/src/Annotation/LibraryType.php b/web/modules/libraries/src/Annotation/LibraryType.php deleted file mode 100644 index 3cf5491165e6eddf763632ea2522e458f962196f..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Annotation/LibraryType.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Drupal\libraries\Annotation; - -use Drupal\Component\Annotation\PluginID; - -/** - * Provides an annotation class for locator plugins. - * - * @Annotation - */ -class LibraryType extends PluginID { - -} diff --git a/web/modules/libraries/src/Annotation/Locator.php b/web/modules/libraries/src/Annotation/Locator.php deleted file mode 100644 index ab4311d156da8712ab7a73aa44500633356218ac..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Annotation/Locator.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Drupal\libraries\Annotation; - -use Drupal\Component\Annotation\PluginID; - -/** - * Provides an annotation class for locator plugins. - * - * @Annotation - */ -class Locator extends PluginID { - -} diff --git a/web/modules/libraries/src/Annotation/VersionDetector.php b/web/modules/libraries/src/Annotation/VersionDetector.php deleted file mode 100644 index a664f994f2b9a46b1a20d44026a7ed92f8e94160..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Annotation/VersionDetector.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Drupal\libraries\Annotation; - -use Drupal\Component\Annotation\PluginID; - -/** - * Provides an annotation class for version detector plugins. - * - * @Annotation - */ -class VersionDetector extends PluginID { - -} diff --git a/web/modules/libraries/src/Config/LibrariesConfigSubscriber.php b/web/modules/libraries/src/Config/LibrariesConfigSubscriber.php deleted file mode 100644 index 6578f42c6d6eaae190575fb48d42832ad92f28bf..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Config/LibrariesConfigSubscriber.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Drupal\libraries\Config; - -use Drupal\Core\Config\ConfigCrudEvent; -use Drupal\Core\Config\ConfigEvents; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Reacts to configuration changes of the 'libraries.settings' configuration. - */ -class LibrariesConfigSubscriber implements EventSubscriberInterface { - - /** - * The service container. - * - * @var \Symfony\Component\DependencyInjection\ContainerInterface - */ - protected $container; - - /** - * Constructs a Libraries API configuration subscriber. - * - * @param \Symfony\Component\DependencyInjection\ContainerInterface $container - * The service container. - */ - public function __construct(ContainerInterface $container) { - $this->container = $container; - } - - /** - * Unsets the definition discovery service when its configuration changes. - * - * @param \Drupal\Core\Config\ConfigCrudEvent $event - * The configuration event. - */ - public function onConfigSave(ConfigCrudEvent $event) { - if (($event->getConfig()->getName() === 'libraries.settings') && $event->isChanged('definition')) { - $this->container->set('libraries.definition.discovery', NULL); - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - return [ConfigEvents::SAVE => 'onConfigSave']; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Asset/AssetLibrary.php b/web/modules/libraries/src/ExternalLibrary/Asset/AssetLibrary.php deleted file mode 100644 index 50a31868682d824ee0f3cdcc7fa35d0b3f963a8d..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Asset/AssetLibrary.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Asset; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException; -use Drupal\libraries\ExternalLibrary\LibraryBase; -use Drupal\libraries\ExternalLibrary\LibraryManagerInterface; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryTrait; -use Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface; -use Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryTrait; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface; - -/** - * Provides a class for a single attachable asset library. - */ -class AssetLibrary extends LibraryBase implements - AssetLibraryInterface, - LocalLibraryInterface, - RemoteLibraryInterface -{ - - use - LocalLibraryTrait, - RemoteLibraryTrait, - LocalRemoteAssetTrait - ; - - /** - * An array containing the CSS assets of the library. - * - * @var array - */ - protected $cssAssets = []; - - /** - * An array containing the JavaScript assets of the library. - * - * @var array - */ - protected $jsAssets = []; - - /** - * An array of attachable asset library IDs that this library depends on. - * - * @todo Explain the difference to regular dependencies. - */ - protected $attachableDependencies = []; - - /** - * Construct an external library. - * - * @param string $id - * The library ID. - * @param array $definition - * The library definition array. - * @param \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface $library_type - * The library type of the library. - */ - public function __construct($id, array $definition, LibraryTypeInterface $library_type) { - parent::__construct($id, $definition, $library_type); - $this->remoteUrl = $definition['remote_url']; - $this->cssAssets = $definition['css']; - $this->jsAssets = $definition['js']; - $this->attachableDependencies = $definition['attachable_dependencies']; - } - - /** - * {@inheritdoc} - */ - protected static function processDefinition(array &$definition) { - parent::processDefinition($definition); - $definition += [ - 'remote_url' => '', - 'css' => [], - 'js' => [], - 'attachable_dependencies' => [], - ]; - } - - /** - * Returns a core library array structure for this library. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager - * The library manager that can be used to fetch dependencies. - * - * @return array - * - * @see \Drupal\libraries\ExternalLibrary\Asset\getAttachableAssetLibraries::getAttachableAssetLibraries() - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\InvalidLibraryDependencyException - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryTypeNotFoundException - * @throws \Drupal\Component\Plugin\Exception\PluginException - * - * @todo Document the return value. - */ - public function getAttachableAssetLibrary(LibraryManagerInterface $library_manager) { - if (!$this->canBeAttached()) { - throw new LibraryNotInstalledException($this); - } - return [ - 'version' => $this->getVersion(), - 'css' => $this->processCssAssets($this->cssAssets), - 'js' => $this->processJsAssets($this->jsAssets), - 'dependencies' => $this->attachableDependencies, - ]; - } - - /** - * Gets the locator of this library using the locator factory. - * - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory - * - * @return \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::getLocator() - */ - public function getLocator(FactoryInterface $locator_factory) { - // @todo Consider consolidating the stream wrappers used here. For now we - // allow asset libs to live almost anywhere. - return $locator_factory->createInstance('chain') - ->addLocator($locator_factory->createInstance('uri', ['uri' => 'asset://'])) - ->addLocator($locator_factory->createInstance('uri', ['uri' => 'php-file://'])); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Asset/AssetLibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/Asset/AssetLibraryInterface.php deleted file mode 100644 index eac629024d5ce2e3928d1af45531e2263a7d1827..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Asset/AssetLibraryInterface.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Asset; - -use Drupal\libraries\ExternalLibrary\Dependency\DependentLibraryInterface; -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\LibraryManagerInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; - -/** - * Provides an interface for external asset libraries with a single library. - * - * Asset is the generic term for CSS and JavaScript files. - * - * In order to load assets of external libraries as part of a page request the - * assets must be registered with Drupal core's library system. Therefore, - * Libraries API makes all libraries that are required by the installed - * installation profile, modules, and themes available as core asset libraries - * with the identifier 'libraries/[machine_name]' where '[machine_name]' is - * the Libraries API machine name of the external library. - * - * Thus, assuming that the external library 'flexslider' has been declared as a - * dependency, for example, it can be attached to a render array in the $build - * variable with the following code: - * @code - * $build['#attached']['library'] = ['libraries/flexslider']; - * @endcode - * - * In some cases an external library may contain multiple components, that - * should be loadable independently from each other. In this case, implement - * MultipleAssetLibraryInterface instead. - * - * @see libraries_library_info_build() - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryTrait - * @see \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface - * - * @todo Support loading of source or minified assets. - * @todo Document how library dependencies work. - * - * @ingroup libraries - */ -interface AssetLibraryInterface extends - LibraryInterface, - VersionedLibraryInterface, - DependentLibraryInterface -{ - - /** - * Returns a core asset library array structure for this library. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager - * The library manager that can be used to fetch dependencies. - * - * @return array - * - * @see \Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\InvalidLibraryDependencyException - * - * @todo Document the return value. - * @todo Reconsider passing the library manager. - */ - public function getAttachableAssetLibrary(LibraryManagerInterface $library_manager); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Asset/AttachableAssetLibraryRegistrationInterface.php b/web/modules/libraries/src/ExternalLibrary/Asset/AttachableAssetLibraryRegistrationInterface.php deleted file mode 100644 index 8a8a6e5cfb1496dce64fa7d1f6c43069cad13e41..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Asset/AttachableAssetLibraryRegistrationInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Asset; - -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\LibraryManagerInterface; - -/** - * An interface for library types that want to react to library instantiation. - */ -interface AttachableAssetLibraryRegistrationInterface { - - /** - * Reacts to the instantiation of a library. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryInterface $external_library - * The library that is being instantiated. - * @param \Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager - */ - public function getAttachableAssetLibraries(LibraryInterface $external_library, LibraryManagerInterface $library_manager); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Asset/LocalRemoteAssetTrait.php b/web/modules/libraries/src/ExternalLibrary/Asset/LocalRemoteAssetTrait.php deleted file mode 100644 index e673caba975e86faf32d2d7249d77d3dfb5d1cc7..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Asset/LocalRemoteAssetTrait.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Asset; - -/** - * A trait for asset libraries that serve local and remote files. - * - * If the library files are available locally, they are served locally. - * Otherwise, the remote files are served, assuming a remote URL is specified. - * - * This trait should only be used in classes implementing LocalLibraryInterface - * and RemoteLibraryInterface. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface - * @see \Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface - */ -trait LocalRemoteAssetTrait { - - /** - * Checks whether this library can be attached. - * - * @return bool - * TRUE if the library can be attached; FALSE otherwise. - * - * @see \Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait::canBeAttached() - */ - protected function canBeAttached() { - /** @var \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface|\Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface $this */ - return ($this->isInstalled() || $this->hasRemoteUrl()); - } - - /** - * Gets the prefix to prepend to file paths. - * - * For local libraries this is the library path, for remote libraries this is - * the remote URL. - * - * @return string - * The path prefix. - */ - protected function getPathPrefix() { - /** @var \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface|\Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface $this */ - if ($this->isInstalled()) { - // LocalLibraryInterface::getLocalPath() returns the path relative to the - // app root. In order for the core core asset system to register the path - // as relative to the app root, a leading slash is required. - /** @see \Drupal\Core\Asset\LibraryDiscoveryParser::buildByExtension() */ - return '/' . $this->getLocalPath(); - } - elseif ($this->hasRemoteUrl()) { - return $this->getRemoteUrl(); - } - else { - // @todo Throw an exception. - } - } - - /** - * Gets the CSS assets attached to this library. - * - * @param array $assets - * - * @return array - * An array of CSS assets of the library following the core library CSS - * structure. The keys of the array must be among the SMACSS categories - * 'base', 'layout, 'component', 'state', and 'theme'. The value of each - * category is in turn an array where the keys are the file paths of the CSS - * files and values are CSS options. - * - * @see https://smacss.com/ - * - * @see \Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait::getCssAssets() - */ - protected function processCssAssets(array $assets) { - // @todo Consider somehow caching the processed information. - $processed_assets = []; - foreach ($assets as $category => $category_assets) { - // @todo Somehow consolidate this with getJsAssets(). - foreach ($category_assets as $filename => $options) { - $processed_assets[$category][$this->getPathPrefix() . '/' . $filename] = $options; - } - } - return $processed_assets; - } - - /** - * Gets the JavaScript assets attached to this library. - * - * @param array $assets - * - * @return array - * An array of JavaScript assets of the library. The keys of the array are - * the file paths of the JavaScript files and the values are JavaScript - * options. - * - * @see \Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait::getJsAssets() - */ - protected function processJsAssets(array $assets) { - // @todo Consider somehow caching the processed information. - $processed_assets = []; - // @todo Somehow consolidate this with getCssAssets(). - foreach ($assets as $filename => $options) { - $processed_assets[$this->getPathPrefix() . '/' . $filename] = $options; - } - return $processed_assets; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Asset/MultipleAssetLibrary.php b/web/modules/libraries/src/ExternalLibrary/Asset/MultipleAssetLibrary.php deleted file mode 100644 index f2c3d3c46c23d1b5d25acb405d6d1096ea2392f0..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Asset/MultipleAssetLibrary.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Asset; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\Dependency\DependentLibraryInterface; -use Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException; -use Drupal\libraries\ExternalLibrary\LibraryBase; -use Drupal\libraries\ExternalLibrary\LibraryManagerInterface; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryTrait; -use Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface; -use Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryTrait; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; - -/** - * Provides a class for a library with multiple attachable asset libraries. - */ -class MultipleAssetLibrary extends LibraryBase implements - MultipleAssetLibraryInterface, - VersionedLibraryInterface, - DependentLibraryInterface, - LocalLibraryInterface, - RemoteLibraryInterface -{ - - use - LocalLibraryTrait, - RemoteLibraryTrait, - LocalRemoteAssetTrait - ; - - /** - * An array of attachable asset libraries. - */ - protected $libraries = []; - - /** - * Construct an external library. - * - * @param string $id - * The library ID. - * @param array $definition - * The library definition array. - * @param \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface $library_type - * The library type of the library. - */ - public function __construct($id, array $definition, LibraryTypeInterface $library_type) { - parent::__construct($id, $definition, $library_type); - $this->remoteUrl = $definition['remote_url']; - $this->libraries = $definition['libraries']; - } - - /** - * {@inheritdoc} - */ - protected static function processDefinition(array &$definition) { - parent::processDefinition($definition); - $definition += [ - 'remote_url' => '', - 'libraries' => [], - ]; - foreach ($definition['libraries'] as &$library) { - $library += [ - 'css' => [], - 'js' => [], - 'dependencies' => [], - ]; - } - } - - /** - * Returns a core library array structure for this library. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager - * The library manager that can be used to fetch dependencies. - * - * @return array - * - * @see \Drupal\libraries\ExternalLibrary\Asset\getAttachableAssetLibraries::getAttachableAssetLibraries() - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\InvalidLibraryDependencyException - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryTypeNotFoundException - * @throws \Drupal\Component\Plugin\Exception\PluginException - * - * @todo Document the return value. - */ - public function getAttachableAssetLibraries(LibraryManagerInterface $library_manager) { - if (!$this->canBeAttached()) { - throw new LibraryNotInstalledException($this); - } - $attachable_libraries = []; - foreach ($this->libraries as $attachable_library_id => $attachable_library) { - $attachable_libraries[$attachable_library_id] = [ - 'version' => $this->getVersion(), - 'css' => $this->processCssAssets($attachable_library['css']), - 'js' => $this->processJsAssets($attachable_library['js']), - 'dependencies' => $attachable_library['dependencies'], - ]; - } - return $attachable_libraries; - } - - /** - * Gets the locator of this library using the locator factory. - * - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory - * - * @return \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::getLocator() - */ - public function getLocator(FactoryInterface $locator_factory) { - // @todo Consider consolidating the stream wrappers used here. For now we - // allow asset libs to live almost anywhere. - return $locator_factory->createInstance('chain') - ->addLocator($locator_factory->createInstance('uri', ['uri' => 'asset://'])) - ->addLocator($locator_factory->createInstance('uri', ['uri' => 'php-file://'])); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Asset/MultipleAssetLibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/Asset/MultipleAssetLibraryInterface.php deleted file mode 100644 index 5dc43ffdc700714fad11a149a0e69aac727411a3..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Asset/MultipleAssetLibraryInterface.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Asset; - -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\LibraryManagerInterface; - -/** - * Provides an interface for external asset libraries with multiple libraries. - * - * See SingleAssetLibraryInterface for more information on external asset - * libraries in general. - * - * In case an external asset library contains multiple components that should - * be loadable independently from each other, Libraries API registers each - * library component as a separate library in the core asset library system. The - * resulting core library identifier is - * 'libraries/[machine_name].[component_name]' where '[machine_name]' is the - * Libraries API machine name of the external library and '[component_name]' is - * the component name specified by the library definition. - * - * Thus, assuming that the external library 'bootstrap' has been declared as a - * dependency, for example, and it has 'button' and 'form' components, they can - * be attached to a render array in the $build variable with the following code: - * @code - * $build['#attached']['library'] = [ - * 'libraries/bootstrap.button', - * 'libraries/bootstrap.form', - * ]; - * @endcode - * - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface - * - * @todo Support loading of source or minified assets. - * @todo Document how library dependencies work. - */ -interface MultipleAssetLibraryInterface extends LibraryInterface { - - /** - * Separates the library machine name from its component name. - * - * The period is chosen in alignment with core asset libraries, which are - * named, for example, 'core/jquery.once'. - */ - const SEPARATOR = '.'; - - /** - * Returns a core asset library array structure for this library. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager - * The library manager that can be used to fetch dependencies. - * - * @return array - * - * @see \Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\InvalidLibraryDependencyException - * - * @todo Document the return value. - * @todo Reconsider passing the library manager. - */ - public function getAttachableAssetLibraries(LibraryManagerInterface $library_manager); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/ChainDefinitionDiscovery.php b/web/modules/libraries/src/ExternalLibrary/Definition/ChainDefinitionDiscovery.php deleted file mode 100644 index f58801816d39fafd7e172cfa368b8ec1f576eab7..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/ChainDefinitionDiscovery.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -use Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException; - -/** - * Provides a definition discovery that checks a list of other discoveries. - * - * The discoveries are checked sequentially. If the definition was not present - * in some discoveries but is found in a later discovery the definition will be - * written to the earlier discoveries if they implement - * WritableDefinitionDiscoveryInterface. - * - * @see \Drupal\libraries\ExternalLibrary\Definition\WritableDefinitionDiscoveryInterface - */ -class ChainDefinitionDiscovery implements DefinitionDiscoveryInterface { - - /** - * The list of definition discoveries that will be checked. - * - * @var \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface[] - */ - protected $discoveries = []; - - /** - * {@inheritdoc} - */ - public function hasDefinition($id) { - foreach ($this->discoveries as $discovery) { - if ($discovery->hasDefinition($id)) { - return TRUE; - } - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function getDefinition($id) { - /** @var \Drupal\libraries\ExternalLibrary\Definition\WritableDefinitionDiscoveryInterface[] $discoveries_to_write */ - $discoveries_to_write = []; - foreach ($this->discoveries as $discovery) { - if ($discovery->hasDefinition($id)) { - $definition = $discovery->getDefinition($id); - break; - } - elseif ($discovery instanceof WritableDefinitionDiscoveryInterface) { - $discoveries_to_write[] = $discovery; - } - } - - if (!isset($definition)) { - throw new LibraryDefinitionNotFoundException($id); - } - - foreach ($discoveries_to_write as $discovery_to_write) { - $discovery_to_write->writeDefinition($id, $definition); - } - - return $definition; - } - - /** - * Adds a definition discovery to the list to check. - * - * @param \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface $discovery - * The definition discovery to add. - * - * @return $this - */ - public function addDiscovery(DefinitionDiscoveryInterface $discovery) { - $this->discoveries[] = $discovery; - return $this; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/DefinitionDiscoveryFactory.php b/web/modules/libraries/src/ExternalLibrary/Definition/DefinitionDiscoveryFactory.php deleted file mode 100644 index 970385e5f0ebacd40ab50952b84a55377207bd70..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/DefinitionDiscoveryFactory.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -use Drupal\Component\Serialization\SerializationInterface; -use Drupal\Core\Config\ConfigFactoryInterface; -use GuzzleHttp\ClientInterface; - -/** - * Instantiates a library definition discovery based on configuration. - */ -class DefinitionDiscoveryFactory { - - /** - * The configuration factory. - * - * @var \Drupal\Core\Config\ConfigFactoryInterface - */ - protected $configFactory; - - /** - * The serializer for local definition files. - * - * @var \Drupal\Component\Serialization\SerializationInterface - */ - protected $localSerializer; - - /** - * The HTTP client used to fetch remote definitions. - * - * @var \GuzzleHttp\ClientInterface - */ - protected $httpClient; - - /** - * The serializer for remote definitions. - * - * @var \Drupal\Component\Serialization\SerializationInterface - */ - protected $remoteSerializer; - - /** - * Constructs a definition discovery factory. - * - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The configuration factory. - * @param \Drupal\Component\Serialization\SerializationInterface $local_serializer - * The serializer for local definition files. - * @param \GuzzleHttp\ClientInterface $http_client - * The HTTP client used to fetch remote definitions. - * @param \Drupal\Component\Serialization\SerializationInterface $remote_serializer - * The serializer for remote definitions. - */ - public function __construct( - ConfigFactoryInterface $config_factory, - SerializationInterface $local_serializer, - ClientInterface $http_client, - SerializationInterface $remote_serializer - ) { - $this->configFactory = $config_factory; - $this->localSerializer = $local_serializer; - $this->httpClient = $http_client; - $this->remoteSerializer = $remote_serializer; - } - - /** - * Gets a library definition discovery. - * - * @return \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface - * The library definition discovery. - */ - public function get() { - $config = $this->configFactory->get('libraries.settings'); - - if ($config->get('definition.remote.enable')) { - $discovery = new ChainDefinitionDiscovery(); - - $local_discovery = new WritableFileDefinitionDiscovery( - $this->localSerializer, - $config->get('definition.local.path') - ); - $discovery->addDiscovery($local_discovery); - - foreach ($config->get('definition.remote.urls') as $remote_url) { - $remote_discovery = new GuzzleDefinitionDiscovery( - $this->httpClient, - $this->remoteSerializer, - $remote_url - ); - - $discovery->addDiscovery($remote_discovery); - } - } - else { - $discovery = new FileDefinitionDiscovery( - $this->localSerializer, - $config->get('definition.local.path') - ); - } - - return $discovery; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/DefinitionDiscoveryInterface.php b/web/modules/libraries/src/ExternalLibrary/Definition/DefinitionDiscoveryInterface.php deleted file mode 100644 index 61fc589ccab3fabec86faf97a7b3db0caab25bdc..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/DefinitionDiscoveryInterface.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -/** - * Provides an interface for library definition discoveries. - * - * This is similar to the plugin system's DiscoveryInterface, except that this - * does not require knowing all definitions upfront, so there is no - * getDefinitions() method. - * - * @see \Drupal\Component\Plugin\Discovery\DiscoveryInterface - * - * @ingroup libraries - */ -interface DefinitionDiscoveryInterface { - - /** - * Checks whether a library definition exists. - * - * @param string $id - * The library ID. - * - * @return bool - * TRUE if a library definition with the given ID exists; FALSE otherwise. - */ - public function hasDefinition($id); - - /** - * Gets a library definition by its ID. - * - * @param string $id - * The library ID. - * - * @return array - * The library definition. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException - * - * @todo Consider returning a classed object instead of an array or at least - * document and validate the array structure. - */ - public function getDefinition($id); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/FileDefinitionDiscovery.php b/web/modules/libraries/src/ExternalLibrary/Definition/FileDefinitionDiscovery.php deleted file mode 100644 index 6ad62c491516d1174a49b1db2274c782627985dc..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/FileDefinitionDiscovery.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -use Drupal\Component\Serialization\SerializationInterface; -use Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException; - -/** - * Provides a libraries definition discovery using PHP's native file functions. - * - * It supports either a URI with a stream wrapper, an absolute file path or a - * file path relative to the Drupal root as a base URI. - * - * By default YAML files are used. - * - * @see \Drupal\libraries\StreamWrapper\LibraryDefinitionsStream - * - * @ingroup libraries - */ -class FileDefinitionDiscovery extends FileDefinitionDiscoveryBase implements DefinitionDiscoveryInterface { - - /** - * {@inheritdoc} - */ - public function hasDefinition($id) { - return file_exists($this->getFileUri($id)); - } - - /** - * {@inheritdoc} - */ - protected function getSerializedDefinition($id) { - return file_get_contents($this->getFileUri($id)); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/FileDefinitionDiscoveryBase.php b/web/modules/libraries/src/ExternalLibrary/Definition/FileDefinitionDiscoveryBase.php deleted file mode 100644 index 0151f2794980042ce22a912823c93f5792d4373a..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/FileDefinitionDiscoveryBase.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -use Drupal\Component\Serialization\SerializationInterface; -use Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException; - -/** - * Provides a base implementation for file-based definition discoveries. - * - * This discovery assumes that library files contain the serialized library - * definition and are accessible under a common base URI. The expected library - * file URI will be constructed from this by appending '/$id.$extension' to - * this, where $id is the library ID and $extension is the serializer extension. - */ -abstract class FileDefinitionDiscoveryBase implements DefinitionDiscoveryInterface { - - /** - * The serializer for the library definition files. - * - * @var \Drupal\Component\Serialization\SerializationInterface - */ - protected $serializer; - - /** - * The base URI for the library files. - * - * @var string - */ - protected $baseUri; - - /** - * Constructs a stream-based library definition discovery. - * - * @param \Drupal\Component\Serialization\SerializationInterface $serializer - * The serializer for the library definition files. - * @param string $base_uri - * The base URI for the library files. - */ - public function __construct(SerializationInterface $serializer, $base_uri) { - $this->serializer = $serializer; - $this->baseUri = $base_uri; - } - - /** - * {@inheritdoc} - */ - public function getDefinition($id) { - if (!$this->hasDefinition($id)) { - throw new LibraryDefinitionNotFoundException($id); - } - return $this->serializer->decode($this->getSerializedDefinition($id)); - } - - /** - * Gets the contents of the library file. - * - * @param $id - * The library ID to retrieve the serialized definition for. - * - * @return string - * The serialized library definition. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException - */ - abstract protected function getSerializedDefinition($id); - - /** - * Returns the file URI of the library definition file for a given library ID. - * - * @param $id - * The ID of the external library. - * - * @return string - * The file URI of the file the library definition resides in. - */ - protected function getFileUri($id) { - $filename = $id . '.' . $this->serializer->getFileExtension(); - return "$this->baseUri/$filename"; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/GuzzleDefinitionDiscovery.php b/web/modules/libraries/src/ExternalLibrary/Definition/GuzzleDefinitionDiscovery.php deleted file mode 100644 index 59745b78c7fbd6523287da0bce6f14ce601d7f22..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/GuzzleDefinitionDiscovery.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -use Drupal\Component\Serialization\SerializationInterface; -use Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException; -use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\GuzzleException; - -/** - * Provides a definition discovery that fetches remote definitions using Guzzle. - * - * By default JSON files are assumed to be in JSON format. - * - * @todo Cache responses statically by ID to avoid multiple HTTP requests when - * calling hasDefinition() and getDefinition() sequentially. - */ -class GuzzleDefinitionDiscovery extends FileDefinitionDiscoveryBase implements DefinitionDiscoveryInterface { - - /** - * The HTTP client. - * - * @var \GuzzleHttp\ClientInterface - */ - protected $httpClient; - - /** - * Constructs a Guzzle-based definition discvoery. - * - * @param \GuzzleHttp\ClientInterface $http_client - * The HTTP client. - * @param \Drupal\Component\Serialization\SerializationInterface $serializer - * The serializer for the library definition files. - * @param string $base_url - * The base URL for the library files. - */ - public function __construct(ClientInterface $http_client, SerializationInterface $serializer, $base_url) { - parent::__construct($serializer, $base_url); - $this->httpClient = $http_client; - } - - /** - * {@inheritdoc} - */ - public function hasDefinition($id) { - try { - $response = $this->httpClient->request('GET', $this->getFileUri($id)); - return $response->getStatusCode() === 200; - } - catch (GuzzleException $exception) { - return FALSE; - } - } - - /** - * {@inheritdoc} - */ - protected function getSerializedDefinition($id) { - try { - $response = $this->httpClient->request('GET', $this->getFileUri($id)); - return (string) $response->getBody(); - } - catch (GuzzleException $exception) { - throw new LibraryDefinitionNotFoundException($id, '', 0, $exception); - } - catch (\RuntimeException $exception) { - throw new LibraryDefinitionNotFoundException($id, '', 0, $exception); - } - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/WritableDefinitionDiscoveryInterface.php b/web/modules/libraries/src/ExternalLibrary/Definition/WritableDefinitionDiscoveryInterface.php deleted file mode 100644 index f644a0d36ee9a49385105b195c4621960f210810..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/WritableDefinitionDiscoveryInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -/** - * Provides an interface for library definition discoveries that are writable. - * - * @see \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface - * @see \Drupal\libraries\ExternalLibrary\Definition\ChainDefinitionDiscovery - */ -interface WritableDefinitionDiscoveryInterface extends DefinitionDiscoveryInterface { - - /** - * Writes a library definition persistently. - * - * @param string $id - * The library ID. - * @param array $definition - * The library definition to write. - * - * @return $this - */ - public function writeDefinition($id, $definition); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Definition/WritableFileDefinitionDiscovery.php b/web/modules/libraries/src/ExternalLibrary/Definition/WritableFileDefinitionDiscovery.php deleted file mode 100644 index b8204fb9e508abdcbd0c5758b90ddc7329455361..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Definition/WritableFileDefinitionDiscovery.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Definition; - -/** - * Provides a definition discovery based on a writable directory or stream. - * - * @see \Drupal\libraries\ExternalLibrary\Definition\FileDefinitionDiscovery - */ -class WritableFileDefinitionDiscovery extends FileDefinitionDiscovery implements WritableDefinitionDiscoveryInterface { - - /** - * {@inheritdoc} - */ - public function writeDefinition($id, $definition) { - file_put_contents($this->getFileUri($id), $this->serializer->encode($definition)); - return $this; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Dependency/DependentLibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/Dependency/DependentLibraryInterface.php deleted file mode 100644 index fd838101f325f81b6dc8c8a8c5e4d5d3ebab7827..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Dependency/DependentLibraryInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Dependency; - -use Drupal\libraries\ExternalLibrary\LibraryInterface; - -/** - * Provides an interface for libraries that depend on other libraries. - * - * @todo Implement versioned dependencies. - */ -interface DependentLibraryInterface extends LibraryInterface { - - /** - * Returns the libraries dependencies, if any. - * - * @return string[] - * An array of library IDs of libraries that the library depends on. - */ - public function getDependencies(); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Dependency/DependentLibraryTrait.php b/web/modules/libraries/src/ExternalLibrary/Dependency/DependentLibraryTrait.php deleted file mode 100644 index e7623ae7a2ec36c8a622e818c10ed87881459e16..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Dependency/DependentLibraryTrait.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Dependency; - -/** - * Provides a trait for libraries that depend on other libraries. - */ -trait DependentLibraryTrait { - - /** - * An array of library IDs of libraries that the library depends on. - * - * @return string[] - */ - protected $dependencies; - - /** - * Returns the libraries dependencies, if any. - * - * @return string[] - * An array of library IDs of libraries that the library depends on. - * - * @see \Drupal\libraries\ExternalLibrary\Dependency\DependentLibraryInterface::getDependencies() - */ - public function getDependencies() { - return $this->dependencies; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Exception/InvalidLibraryDependencyException.php b/web/modules/libraries/src/ExternalLibrary/Exception/InvalidLibraryDependencyException.php deleted file mode 100644 index 7ab3eeb7e4ce73dd3b3bbef97f2571ab13b214e0..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Exception/InvalidLibraryDependencyException.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Exception; - -use Drupal\libraries\ExternalLibrary\Utility\DependencyAccessorTrait; -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorTrait; -use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorInterface; - -/** - * Provides an exception for an invalid library exception. - */ -class InvalidLibraryDependencyException extends \UnexpectedValueException implements LibraryAccessorInterface { - - use LibraryAccessorTrait; - use DependencyAccessorTrait; - - /** - * Constructs a library exception. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryInterface $library - * The library with the invalid dependency. - * @param \Drupal\libraries\ExternalLibrary\LibraryInterface $dependency - * The dependency. - * @param string $message - * (optional) The exception message. - * @param int $code - * (optional) The error code. - * @param \Exception $previous - * (optional) The previous exception. - */ - public function __construct( - LibraryInterface $library, - LibraryInterface $dependency, - $message = '', - $code = 0, - \Exception $previous = NULL - ) { - $this->library = $library; - $this->dependency = $dependency; - $message = $message ?: "The library '{$this->library->getId()}' cannot depend on the library '{$this->dependency->getId()}'."; - parent::__construct($message, $code, $previous); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Exception/LibraryDefinitionNotFoundException.php b/web/modules/libraries/src/ExternalLibrary/Exception/LibraryDefinitionNotFoundException.php deleted file mode 100644 index c274302d699892a8b2950f7964b3f90af253f571..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Exception/LibraryDefinitionNotFoundException.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Exception; - -use Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorTrait; -use Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorInterface; - -/** - * Provides an exception for a library definition that cannot be found. - */ -class LibraryDefinitionNotFoundException extends \RuntimeException implements LibraryIdAccessorInterface { - - use LibraryIdAccessorTrait; - - /** - * Constructs a library exception. - * - * @param string $library_id - * The library ID. - * @param string $message - * (optional) The exception message. - * @param int $code - * (optional) The error code. - * @param \Exception $previous - * (optional) The previous exception. - */ - public function __construct( - $library_id, - $message = '', - $code = 0, - \Exception $previous = NULL - ) { - $this->libraryId = (string) $library_id; - $message = $message ?: "The library definition for the library '{$this->libraryId}' could not be found."; - parent::__construct($message, $code, $previous); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Exception/LibraryNotInstalledException.php b/web/modules/libraries/src/ExternalLibrary/Exception/LibraryNotInstalledException.php deleted file mode 100644 index ed48a629c458165cd5a30e0584e6cc70e92a9a2d..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Exception/LibraryNotInstalledException.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Exception; - -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorTrait; -use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorInterface; - -/** - * Provides an exception for a library that is not installed. - */ -class LibraryNotInstalledException extends \RuntimeException implements LibraryAccessorInterface { - - use LibraryAccessorTrait; - - /** - * Constructs a library exception. - * - * @param \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library - * The library that is not installed. - * @param string $message - * (optional) The exception message. - * @param int $code - * (optional) The error code. - * @param \Exception $previous - * (optional) The previous exception. - */ - public function __construct( - LocalLibraryInterface $library, - $message = '', - $code = 0, - \Exception $previous = NULL - ) { - $this->library = $library; - $message = $message ?: "The library '{$this->library->getId()}' is not installed."; - parent::__construct($message, $code, $previous); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Exception/LibraryTypeNotFoundException.php b/web/modules/libraries/src/ExternalLibrary/Exception/LibraryTypeNotFoundException.php deleted file mode 100644 index b5655bba09a626a1d7b73a60b2971a1fc19c5a83..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Exception/LibraryTypeNotFoundException.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Exception; - -use Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorTrait; -use Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorInterface; - -/** - * Provides an exception for a library definition without a type declaration. - */ -class LibraryTypeNotFoundException extends \RuntimeException implements LibraryAccessorInterface { - - use LibraryIdAccessorTrait; - - /** - * Constructs a library exception. - * - * @param string $library_id - * The library ID. - * @param string $message - * (optional) The exception message. - * @param int $code - * (optional) The error code. - * @param \Exception $previous - * (optional) The previous exception. - */ - public function __construct( - $library_id, - $message = '', - $code = 0, - \Exception $previous = NULL - ) { - $this->libraryId = (string) $library_id; - $message = $message ?: "The library type for the library '{$this->libraryId}' could not be found."; - parent::__construct($message, $code, $previous); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Exception/UnknownLibraryVersionException.php b/web/modules/libraries/src/ExternalLibrary/Exception/UnknownLibraryVersionException.php deleted file mode 100644 index 4afe0593feb4f48770fdbd1651164bf337f5af8b..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Exception/UnknownLibraryVersionException.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Exception; - -use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorTrait; -use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; - -/** - * Provides an exception for libraries whose version has not been detected. - */ -class UnknownLibraryVersionException extends \RuntimeException implements LibraryAccessorInterface { - - use LibraryAccessorTrait; - - /** - * Constructs a library exception. - * - * @param \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface $library - * The library. - * @param string $message - * (optional) The exception message. - * @param int $code - * (optional) The error code. - * @param \Exception $previous - * (optional) The previous exception. - */ - public function __construct( - VersionedLibraryInterface $library, - $message = '', - $code = 0, - \Exception $previous = NULL - ) { - $this->library = $library; - $message = $message ?: "The version of library '{$this->library->getId()}' could not be detected."; - parent::__construct($message, $code, $previous); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/LibraryBase.php b/web/modules/libraries/src/ExternalLibrary/LibraryBase.php deleted file mode 100644 index 8571552c7dda49504545397e96472a2c14b360d2..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/LibraryBase.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary; - -use Drupal\libraries\ExternalLibrary\Dependency\DependentLibraryInterface; -use Drupal\libraries\ExternalLibrary\Dependency\DependentLibraryTrait; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface; -use Drupal\libraries\ExternalLibrary\Utility\IdAccessorTrait; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryTrait; - -/** - * Provides a base external library implementation. - */ -abstract class LibraryBase implements - LibraryInterface, - DependentLibraryInterface, - VersionedLibraryInterface -{ - - use - IdAccessorTrait, - DependentLibraryTrait, - VersionedLibraryTrait - ; - - /** - * The library type of this library. - * - * @var \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface - */ - protected $type; - - /** - * Constructs a library. - * - * @param string $id - * The library ID. - * @param array $definition - * The library definition array. - * @param \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface $type - * The library type of this library. - */ - public function __construct($id, array $definition, LibraryTypeInterface $type) { - $this->id = (string) $id; - $this->type = $type; - $this->dependencies = $definition['dependencies']; - $this->versionDetector = $definition['version_detector']; - } - - /** - * {@inheritdoc} - */ - public static function create($id, array $definition, LibraryTypeInterface $type) { - static::processDefinition($definition); - return new static($id, $definition, $type); - } - - /** - * Gets library definition defaults. - * - * @param array $definition - * A library definition array. - */ - protected static function processDefinition(array &$definition) { - $definition += [ - 'dependencies' => [], - // @todo This fallback is not very elegant. - 'version_detector' => [ - 'id' => 'static', - 'configuration' => ['version' => ''], - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function getType() { - return $this->type; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/LibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/LibraryInterface.php deleted file mode 100644 index ebf43a9b9fdccffc2fd80145265b77c4446c6dc6..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/LibraryInterface.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary; - -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface; - -/** - * Provides an interface for different types of external libraries. - * - * @ingroup libraries - */ -interface LibraryInterface { - - /** - * Creates an instance of the library from its definition. - * - * @param string $id - * The library ID. - * @param array $definition - * The library definition array. - * @param \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface $type - * The library type of this library. - * - * @return static - */ - public static function create($id, array $definition, LibraryTypeInterface $type); - - /** - * Returns the ID of the library. - * - * @return string - * The library ID. This must be unique among all known libraries. - */ - public function getId(); - - /** - * Returns the library type of the library. - * - * @return \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface - * The library of the library. - */ - public function getType(); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/LibraryManager.php b/web/modules/libraries/src/ExternalLibrary/LibraryManager.php deleted file mode 100644 index 17a62236e292b2ddf0b2a71e3914bf97c080bb9e..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/LibraryManager.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\Exception\LibraryTypeNotFoundException; -use Drupal\libraries\ExternalLibrary\Type\LibraryCreationListenerInterface; -use Drupal\libraries\ExternalLibrary\Type\LibraryLoadingListenerInterface; -use Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface; - -/** - * Provides a manager for external libraries. - * - * @todo Dispatch events at various points in the library lifecycle. - * @todo Automatically load PHP file libraries that are required by modules or - * themes. - */ -class LibraryManager implements LibraryManagerInterface { - - /** - * The library definition discovery. - * - * @var \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface - */ - protected $definitionDiscovery; - - /** - * The library type factory. - * - * @var \Drupal\Component\Plugin\Factory\FactoryInterface - */ - protected $libraryTypeFactory; - - /** - * Constructs an external library manager. - * - * @param \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface $definition_disovery - * The library registry. - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $library_type_factory - * The library type factory. - */ - public function __construct( - DefinitionDiscoveryInterface $definition_disovery, - FactoryInterface $library_type_factory - ) { - $this->definitionDiscovery = $definition_disovery; - $this->libraryTypeFactory = $library_type_factory; - } - - /** - * {@inheritdoc} - */ - public function getLibrary($id) { - $definition = $this->definitionDiscovery->getDefinition($id); - return $this->getLibraryFromDefinition($id, $definition); - } - - /** - * {@inheritdoc} - */ - public function getRequiredLibraryIds() { - $library_ids = []; - foreach (['module', 'theme'] as $type) { - foreach (system_get_info($type) as $info) { - if (isset($info['library_dependencies'])) { - $library_ids = array_merge($library_ids, $info['library_dependencies']); - } - } - } - return array_unique($library_ids); - } - - /** - * {@inheritdoc} - */ - public function load($id) { - $definition = $this->definitionDiscovery->getDefinition($id); - $library_type = $this->getLibraryType($id, $definition); - // @todo Throw an exception instead of silently failing. - if ($library_type instanceof LibraryLoadingListenerInterface) { - $library_type->onLibraryLoad($this->getLibraryFromDefinition($id, $definition)); - } - } - - /** - * @param $id - * @param $definition - * @return mixed - */ - protected function getLibraryFromDefinition($id, $definition) { - $library_type = $this->getLibraryType($id, $definition); - - // @todo Make this alter-able. - $class = $library_type->getLibraryClass(); - - // @todo Make sure that the library class implements the correct interface. - $library = $class::create($id, $definition, $library_type); - - if ($library_type instanceof LibraryCreationListenerInterface) { - $library_type->onLibraryCreate($library); - return $library; - } - return $library; - } - - /** - * @param string $id - * @param array $definition - * - * @return \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface - */ - protected function getLibraryType($id, $definition) { - // @todo Validate that the type is a string. - if (!isset($definition['type'])) { - throw new LibraryTypeNotFoundException($id); - } - return $this->libraryTypeFactory->createInstance($definition['type']); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/LibraryManagerInterface.php b/web/modules/libraries/src/ExternalLibrary/LibraryManagerInterface.php deleted file mode 100644 index 0c4383f37ae3efc8625089098f1d0c806183e13d..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/LibraryManagerInterface.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary; - -/** - * Provides an interface for external library managers. - */ -interface LibraryManagerInterface { - - /** - * Gets a library by its ID. - * - * @param string $id - * The library ID. - * - * @return \Drupal\libraries\ExternalLibrary\LibraryInterface - * The library object. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryTypeNotFoundException - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function getLibrary($id); - - /** - * Gets the list of libraries that are required by enabled extensions. - * - * Modules, themes, and installation profiles can declare library dependencies - * by specifying a 'library_dependencies' key in their info files. - * - * @return string[] - * An array of library IDs. - */ - public function getRequiredLibraryIds(); - - /** - * Loads library files for a library. - * - * Note that not all library types support explicit loading. Asset libraries, - * in particular, are declared to Drupal core's library system and are then - * loaded using that. - * - * @param string $id - * The ID of the library. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException - */ - public function load($id); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Local/LocalLibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/Local/LocalLibraryInterface.php deleted file mode 100644 index f8c1fbe5730f04b6f6e1f1183d98179ab741d049..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Local/LocalLibraryInterface.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Local; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\LibraryInterface; - -/** - * Provides an interface for local libraries. - * - * Local libraries are libraries that can be found on the filesystem. If the - * library files can be found in the filesystem a library is considered - * installed and its library path can be retrieved. - * - * Because determining whether or not the library is available locally is not - * the responsibility of the library itself, but of a designated locator, this - * interface declares setter methods, as well. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - */ -interface LocalLibraryInterface extends LibraryInterface { - - /** - * Checks whether the library is installed. - * - * @return bool - * TRUE if the library is installed; FALSE otherwise; - */ - public function isInstalled(); - - /** - * Marks the library as uninstalled. - * - * A corresponding method to mark the library as installed is not provided as - * an installed library should have a library path, so that - * LocalLibraryInterface::setLibraryPath() can be used instead. - * - * @return $this - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::isInstalled() - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::setLocalPath() - */ - public function setUninstalled(); - - /** - * Gets the local path to the library. - * - * @return string - * The absolute path to the library on the filesystem. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::setLocalPath() - */ - public function getLocalPath(); - - /** - * Sets the local path of the library. - * - * @param string $path - * The path to the library. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::getLocalPath() - */ - public function setLocalPath($path); - - /** - * Gets the locator of this library using the locator factory. - * - * Because determining the installation status and library path of a library - * is not specific to any library or even any library type, this logic is - * offloaded to separate locator objects. - * - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory - * - * @return \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - */ - public function getLocator(FactoryInterface $locator_factory); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Local/LocalLibraryTrait.php b/web/modules/libraries/src/ExternalLibrary/Local/LocalLibraryTrait.php deleted file mode 100644 index 3f08e4ba4c1f2d346aa6158f6594e56ea3034cba..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Local/LocalLibraryTrait.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Local; -use Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException; - -/** - * Provides a trait for local libraries utilizing a stream wrapper. - * - * It assumes that the library files can be accessed using a specified stream - * wrapper and that the first component of the file URIs are the library IDs. - * Thus, file URIs are of the form: - * stream-wrapper-scheme://library-id/path/to/file/within/the/library/filename - * - * This trait should only be used by classes implementing LocalLibraryInterface. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface - */ -trait LocalLibraryTrait { - - /** - * Whether or not the library is installed. - * - * A library being installed means its files can be found on the filesystem. - * - * @var bool - */ - protected $installed = FALSE; - - /** - * The local path to the library relative to the app root. - * - * @var string - */ - protected $localPath; - - /** - * Checks whether the library is installed. - * - * @return bool - * TRUE if the library is installed; FALSE otherwise; - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::isInstalled() - */ - public function isInstalled() { - return $this->installed; - } - - /** - * Marks the library as uninstalled. - * - * A corresponding method to mark the library as installed is not provided as - * an installed library should have a library path, so that - * LocalLibraryInterface::setLibraryPath() can be used instead. - * - * @return $this - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::setUninstalled() - */ - public function setUninstalled() { - $this->installed = FALSE; - return $this; - } - - /** - * Gets the path to the library. - * - * @return string - * The path to the library relative to the app root. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::getLocalPath() - */ - public function getLocalPath() { - if (!$this->isInstalled()) { - /** @var \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $this */ - throw new LibraryNotInstalledException($this); - } - - return $this->localPath; - } - - /** - * Sets the library path of the library. - * - * @param string $path - * The path to the library. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::getLocalPath() - */ - public function setLocalPath($path) { - $this->installed = TRUE; - $this->localPath = (string) $path; - - assert('$this->localPath !== ""'); - assert('$this->localPath[0] !== "/"'); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Local/LocatorInterface.php b/web/modules/libraries/src/ExternalLibrary/Local/LocatorInterface.php deleted file mode 100644 index a1be89440c07d4f540de456b67f0cede16a4ff5d..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Local/LocatorInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Local; - -/** - * Provides an interface for library locators. - * - * Because determining the installation status and library path of a library - * is not specific to any library or even any library type, this logic can be - * implemented generically in form of a locator. - */ -interface LocatorInterface { - - /** - * Locates a library. - * - * @param \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library - * The library to locate. - */ - public function locate(LocalLibraryInterface $library); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Local/LocatorManager.php b/web/modules/libraries/src/ExternalLibrary/Local/LocatorManager.php deleted file mode 100644 index 2f377ff06542a1e2b90e06a4a9d0946beb804fd9..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Local/LocatorManager.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Local; - -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Plugin\DefaultPluginManager; -use Drupal\libraries\Annotation\Locator; - -/** - * Provides a plugin manager for library locator plugins. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - */ -class LocatorManager extends DefaultPluginManager { - - /** - * Constructs a locator manager. - * - * @param \Traversable $namespaces - * An object that implements \Traversable which contains the root paths - * keyed by the corresponding namespace to look for plugin implementations. - * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend - * Cache backend instance to use. - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler to invoke the alter hook with. - */ - public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { - parent::__construct('Plugin/libraries/Locator', $namespaces, $module_handler, LocatorInterface::class, Locator::class); - $this->alterInfo('libraries_locator_info'); - $this->setCacheBackend($cache_backend, 'libraries_locator_info'); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLibrary.php b/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLibrary.php deleted file mode 100644 index bf3c68328c205225920ebb79e6770d0f6e7b88fd..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLibrary.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\PhpFile; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException; -use Drupal\libraries\ExternalLibrary\LibraryBase; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryTrait; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface; - -/** - * Provides a base PHP file library implementation. - */ -class PhpFileLibrary extends LibraryBase implements PhpFileLibraryInterface { - - use LocalLibraryTrait; - - /** - * An array of PHP files for this library. - * - * @var array - */ - protected $files = []; - - /** - * Constructs a PHP file library. - * - * @param string $id - * The library ID. - * @param array $definition - * The library definition array. - * @param \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface $type - * The library type of this library. - */ - public function __construct($id, array $definition, LibraryTypeInterface $type) { - parent::__construct($id, $definition, $type); - $this->files = $definition['files']; - } - - /** - * {@inheritdoc} - */ - protected static function processDefinition(array &$definition) { - parent::processDefinition($definition); - $definition += [ - 'files' => [], - ]; - } - - /** - * {@inheritdoc} - */ - public function getPhpFiles() { - if (!$this->isInstalled()) { - throw new LibraryNotInstalledException($this); - } - - $processed_files = []; - foreach ($this->files as $file) { - $processed_files[] = $this->getLocalPath() . '/' . $file; - } - return $processed_files; - } - - /** - * {@inheritdoc} - */ - public function getLocator(FactoryInterface $locator_factory) { - // @todo Consider refining the stream wrapper used here. - return $locator_factory->createInstance('uri', ['uri' => 'php-file://']); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLibraryInterface.php deleted file mode 100644 index 01ca453713e55045af6947fcb5f39c86c15540fe..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLibraryInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\PhpFile; - -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; - -/** - * Provides an interface for libraries with PHP files. - * - * @see \Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLoaderInterface - */ -interface PhpFileLibraryInterface extends LocalLibraryInterface { - - /** - * Returns the PHP files of this library. - * - * @return string[] - * An array of absolute file paths of PHP files. - */ - public function getPhpFiles(); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLoaderInterface.php b/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLoaderInterface.php deleted file mode 100644 index 52c1c620f5182ab6baa8d754bb756f1c2a087312..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpFileLoaderInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\PhpFile; - -/** - * Provides an interface for PHP file loaders. - * - * @see \Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLibraryInterface - */ -interface PhpFileLoaderInterface { - - /** - * Loads a PHP file. - * - * @param string $file - * The absolute file path to the PHP file. - */ - public function load($file); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpRequireLoader.php b/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpRequireLoader.php deleted file mode 100644 index ef6b695f64ae3aa1a6adc04e3104e0938b59e571..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/PhpFile/PhpRequireLoader.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\PhpFile; - -/** - * Provides a PHP file loader using PHP's require_once. - * - * @todo Provide a separate PhpIncludeOnceLoader. - */ -class PhpRequireLoader implements PhpFileLoaderInterface { - - /** - * {@inheritdoc} - */ - public function load($file) { - // @todo Because libraries cannot be loaded twice it should be possible to - // use 'require' instead of 'require_once'. - /** @noinspection PhpIncludeInspection */ - require_once $file; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Remote/RemoteLibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/Remote/RemoteLibraryInterface.php deleted file mode 100644 index 1fe7016ad020c17ec0081bd1eef48747aa389218..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Remote/RemoteLibraryInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Remote; - -use Drupal\libraries\ExternalLibrary\LibraryInterface; - -/** - * Provides an interface for remote libraries. - * - * Assuming they declare a remote URL, remote libraries are always loaded. It is - * not checked whether or not the Drupal site has network access or the remote - * resource is available. - */ -interface RemoteLibraryInterface extends LibraryInterface { - - /** - * Checks whether the library has a remote URL. - * - * This check allows using the same library class for multiple libraries only - * some of which are available remotely. - * - * @return bool - * TRUE if the library has a remote URL; FALSE otherwise. - * - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface - */ - public function hasRemoteUrl(); - - /** - * Returns the remote URL of the library. - * - * @return string - * The remote URL of the library. - * - * @todo Consider throwing an exception if hasRemoteUrl() return FALSE. - */ - public function getRemoteUrl(); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Remote/RemoteLibraryTrait.php b/web/modules/libraries/src/ExternalLibrary/Remote/RemoteLibraryTrait.php deleted file mode 100644 index d55f3c23891f4f5cb6922889bb5511ef21d4abba..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Remote/RemoteLibraryTrait.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Remote; - -/** - * Provides a trait for remote libraries. - */ -trait RemoteLibraryTrait { - - /** - * The remote library URL. - * - * @var string - */ - protected $remoteUrl; - - /** - * Checks whether the library has a remote URL. - * - * This check allows using the same library class for multiple libraries only - * some of which are available remotely. - * - * @return bool - * TRUE if the library has a remote URL; FALSE otherwise. - * - * @see \Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface::hasRemoteUrl() - */ - public function hasRemoteUrl() { - return !empty($this->remoteUrl); - } - - /** - * Returns the remote URL of the library. - * - * @return string - * The remote URL of the library. - * - * \Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface::getRemoteUrl() - */ - public function getRemoteUrl() { - return $this->remoteUrl; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Type/LibraryCreationListenerInterface.php b/web/modules/libraries/src/ExternalLibrary/Type/LibraryCreationListenerInterface.php deleted file mode 100644 index e86115f26e8ccbad23091abb5f6299ccb0de3bec..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Type/LibraryCreationListenerInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Type; - -use Drupal\libraries\ExternalLibrary\LibraryInterface; - -/** - * An interface for library types that want to react to library instantiation. - */ -interface LibraryCreationListenerInterface { - - /** - * Reacts to the instantiation of a library. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryInterface $library - * The library that is being instantiated. - */ - public function onLibraryCreate(LibraryInterface $library); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Type/LibraryLoadingListenerInterface.php b/web/modules/libraries/src/ExternalLibrary/Type/LibraryLoadingListenerInterface.php deleted file mode 100644 index 962e9dbb1e151c7478d9ebebb814f85224d5d795..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Type/LibraryLoadingListenerInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Type; - -use Drupal\libraries\ExternalLibrary\LibraryInterface; - -/** - * An interface for library types that want to react to library instantiation. - */ -interface LibraryLoadingListenerInterface { - - /** - * Reacts to the instantiation of a library. - * - * @param \Drupal\libraries\ExternalLibrary\LibraryInterface $library - * The library that is being instantiated. - */ - public function onLibraryLoad(LibraryInterface $library); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeBase.php b/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeBase.php deleted file mode 100644 index 6cd9f59d099c8b3d9f88dca4b27297088b595efe..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeBase.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Type; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Utility\IdAccessorTrait; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Provides a base class for library types. - */ -abstract class LibraryTypeBase implements - LibraryTypeInterface, - LibraryCreationListenerInterface, - ContainerFactoryPluginInterface -{ - - use IdAccessorTrait; - - /** - * The locator factory. - * - * @var \Drupal\Component\Plugin\Factory\FactoryInterface - */ - protected $locatorFactory; - - /** - * The version detector factory. - * - * @var \Drupal\Component\Plugin\Factory\FactoryInterface - */ - protected $detectorFactory; - - /** - * Constructs the asset library type. - * - * @param string $plugin_id - * The plugin ID taken from the class annotation. - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory - * The locator factory. - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $detector_factory - * The version detector factory. - */ - public function __construct($plugin_id, FactoryInterface $locator_factory, FactoryInterface $detector_factory) { - $this->id = $plugin_id; - $this->locatorFactory = $locator_factory; - $this->detectorFactory = $detector_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $plugin_id, - $container->get('plugin.manager.libraries.locator'), - $container->get('plugin.manager.libraries.version_detector') - ); - } - - /** - * {@inheritdoc} - */ - public function onLibraryCreate(LibraryInterface $library) { - if ($library instanceof LocalLibraryInterface) { - $library->getLocator($this->locatorFactory)->locate($library); - // Fallback on global locators. - // @todo Consider if global locators should be checked as a fallback or as - // the primary locator source. - if (!$library->isInstalled()) { - $this->locatorFactory->createInstance('global')->locate($library); - } - // Also fetch version information. - if ($library instanceof VersionedLibraryInterface) { - // @todo Consider if this should be wrapped in some conditional logic - // or exception handling so that version detection errors do not - // prevent a library from being loaded. - $library->getVersionDetector($this->detectorFactory)->detectVersion($library); - } - } - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeFactory.php b/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeFactory.php deleted file mode 100644 index 6689f51b8734b56538bd2e12edf6fa68cc6159dd..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeFactory.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Type; - -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Plugin\DefaultPluginManager; -use Drupal\libraries\Annotation\LibraryType; - -/** - * Provides a plugin manager for library type plugins. - */ -class LibraryTypeFactory extends DefaultPluginManager { - - /** - * Constructs a locator manager. - * - * @param \Traversable $namespaces - * An object that implements \Traversable which contains the root paths - * keyed by the corresponding namespace to look for plugin implementations. - * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend - * Cache backend instance to use. - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler to invoke the alter hook with. - */ - public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { - parent::__construct('Plugin/libraries/Type', $namespaces, $module_handler, LibraryTypeInterface::class, LibraryType::class); - $this->alterInfo('libraries_library_type_info'); - $this->setCacheBackend($cache_backend, 'libraries_library_type_info'); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeInterface.php b/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeInterface.php deleted file mode 100644 index d6537fb370f7b4b58afdba199e9a031e30aee8cd..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Type/LibraryTypeInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Type; - -/** - * Provides an interface for library types. - */ -interface LibraryTypeInterface { - - /** - * Returns the ID of the library type. - * - * @return string - * The library type ID. - */ - public function getId(); - - /** - * Returns the class used for libraries of this type. - * - * @return string|\Drupal\libraries\ExternalLibrary\LibraryInterface - * The library class for this library type. - * - * @todo Consider adding a getLibraryInterface() method, as well. - */ - public function getLibraryClass(); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Utility/DependencyAccessorTrait.php b/web/modules/libraries/src/ExternalLibrary/Utility/DependencyAccessorTrait.php deleted file mode 100644 index 3ec56fee7306660996ee4bf29894ade02ab78397..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Utility/DependencyAccessorTrait.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Utility; - -/** - * Provides a trait for classes giving access to a library dependency. - */ -trait DependencyAccessorTrait { - - /** - * The dependency. - * - * @var \Drupal\libraries\ExternalLibrary\LibraryInterface - */ - protected $dependency; - - /** - * Returns the dependency. - * - * @return \Drupal\libraries\ExternalLibrary\LibraryInterface - * The library. - */ - public function getLibrary() { - return $this->dependency; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Utility/IdAccessorTrait.php b/web/modules/libraries/src/ExternalLibrary/Utility/IdAccessorTrait.php deleted file mode 100644 index 34476f2cc4cdae7429eade5694b6214a214b3fe5..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Utility/IdAccessorTrait.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Utility; - -/** - * Provides a trait for classes that have a string identifier. - */ -trait IdAccessorTrait { - - /** - * The ID. - * - * @var string - */ - protected $id; - - /** - * Returns the ID. - * - * @return string - * The ID. - * - * @see \Drupal\libraries\ExternalLibrary\LibraryInterface::getId() - * @see \Drupal\libraries\ExternalLibrary\LibraryType\LibraryTypeInterface::getId() - */ - public function getId() { - return $this->id; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryAccessorInterface.php b/web/modules/libraries/src/ExternalLibrary/Utility/LibraryAccessorInterface.php deleted file mode 100644 index 72b0093c4dcb732ae8f4d21aa03a320408cd9e22..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryAccessorInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Utility; - -/** - * Provides an interface for classes giving access to a library. - */ -interface LibraryAccessorInterface { - - /** - * Returns the library. - * - * @return \Drupal\libraries\ExternalLibrary\LibraryInterface - * The library. - */ - public function getLibrary(); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryAccessorTrait.php b/web/modules/libraries/src/ExternalLibrary/Utility/LibraryAccessorTrait.php deleted file mode 100644 index f8ad92037d479a4167414fb601581151a155fad3..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryAccessorTrait.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Utility; - -/** - * Provides a trait for classes giving access to a library. - */ -trait LibraryAccessorTrait { - - /** - * The library. - * - * @var \Drupal\libraries\ExternalLibrary\LibraryInterface - */ - protected $library; - - /** - * Returns the library. - * - * @return \Drupal\libraries\ExternalLibrary\LibraryInterface - * The library. - */ - public function getLibrary() { - return $this->library; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryIdAccessorInterface.php b/web/modules/libraries/src/ExternalLibrary/Utility/LibraryIdAccessorInterface.php deleted file mode 100644 index 98928e9deccd67a28b7734199456885bf43087c0..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryIdAccessorInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Utility; - -/** - * Provides an interface for classes giving access to a library ID. - */ -interface LibraryAccessorIdInterface { - - /** - * Returns the ID of the library. - * - * @return string - * The library ID. - */ - public function getLibraryId(); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryIdAccessorTrait.php b/web/modules/libraries/src/ExternalLibrary/Utility/LibraryIdAccessorTrait.php deleted file mode 100644 index 8ec901f534432cc6f2f2e7ed42f5a653ddb4b243..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Utility/LibraryIdAccessorTrait.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Utility; - -/** - * Provides a trait for classes giving access to a library ID. - */ -trait LibraryIdAccessorTrait { - - /** - * The ID of the library. - * - * @var string - */ - protected $libraryId; - - /** - * Returns the ID of the library. - * - * @return string - * The library ID. - */ - public function getLibraryId() { - return $this->libraryId; - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Version/VersionDetectorInterface.php b/web/modules/libraries/src/ExternalLibrary/Version/VersionDetectorInterface.php deleted file mode 100644 index 8b6d2a5bd04a2661ce569aeca00e78ae3d635295..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Version/VersionDetectorInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Version; - -/** - * Provides an interface for version detectors. - * - * @ingroup libraries - */ -interface VersionDetectorInterface { - - /** - * Detects the version of a library. - * - * @param \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface $library - * The library whose version to detect. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException - * - * @todo Provide a mechanism for version detectors to provide a reason for - * failing. - */ - public function detectVersion(VersionedLibraryInterface $library); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Version/VersionDetectorManager.php b/web/modules/libraries/src/ExternalLibrary/Version/VersionDetectorManager.php deleted file mode 100644 index 6272c5a263c8b5fb7a5ec6e32a7e052d873187d9..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Version/VersionDetectorManager.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Version; - -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Plugin\DefaultPluginManager; -use Drupal\libraries\Annotation\VersionDetector; - -/** - * Provides a plugin manager for library version detector plugins. - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface - */ -class VersionDetectorManager extends DefaultPluginManager { - - /** - * Constructs a version detector manager. - * - * @param \Traversable $namespaces - * An object that implements \Traversable which contains the root paths - * keyed by the corresponding namespace to look for plugin implementations. - * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend - * Cache backend instance to use. - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler to invoke the alter hook with. - */ - public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { - parent::__construct('Plugin/libraries/VersionDetector', $namespaces, $module_handler, VersionDetectorInterface::class, VersionDetector::class); - $this->alterInfo('libraries_version_detector_info'); - $this->setCacheBackend($cache_backend, 'libraries_version_detector_info'); - } - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Version/VersionedLibraryInterface.php b/web/modules/libraries/src/ExternalLibrary/Version/VersionedLibraryInterface.php deleted file mode 100644 index abeb758cd2974a3a2a50b94d1eef673c54a86d95..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Version/VersionedLibraryInterface.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Version; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\LibraryInterface; - -/** - * Provides an interface for versioned libraries. - * - * Version detection and negotiation is a key aspect of Libraries API's - * functionality so most libraries should implement this interface. In theory, - * however, it might be possible for the same library to be available in - * multiple versions and, for example, different versions being loaded on - * different pages. In this case, a simple getVersion() method, does not make - * sense. To support such advanced version detection behavior in the future or - * in a separate module, version detection is split into a separate interface. - * - * @ingroup libraries - * - * @todo Support versioned metadata, i.e. different library file names or - * locations for different library versions. - */ -interface VersionedLibraryInterface extends LibraryInterface { - - /** - * Gets the version of the library. - * - * @return string - * The version string, for example 1.0, 2.1.4, or 3.0.0-alpha5. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface::setVersion() - */ - public function getVersion(); - - /** - * Sets the version of the library. - * - * @param string $version - * The version of the library. - * - * @reutrn $this - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface::getVersion() - */ - public function setVersion($version); - - /** - * Gets the version detector of this library using the detector factory. - * - * Because determining the installation version of a library is not specific - * to any library or even any library type, this logic is offloaded to - * separate detector objects. - * - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $detector_factory - * - * @return \Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface - */ - public function getVersionDetector(FactoryInterface $detector_factory); - -} diff --git a/web/modules/libraries/src/ExternalLibrary/Version/VersionedLibraryTrait.php b/web/modules/libraries/src/ExternalLibrary/Version/VersionedLibraryTrait.php deleted file mode 100644 index 2404a109ca29f6506672b3c9da9d8a1fd86bcb4e..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/ExternalLibrary/Version/VersionedLibraryTrait.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -namespace Drupal\libraries\ExternalLibrary\Version; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException; - -/** - * Provides a trait for versioned libraries. - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface - */ -trait VersionedLibraryTrait { - - /** - * The library version. - * - * @var string - */ - protected $version; - - /** - * Information about the version detector to use fo rthis library. - * - * Contains the following keys: - * id: The plugin ID of the version detector. - * configuration: The plugin configuration of the version detector. - * - * @var array - */ - protected $versionDetector = [ - 'id' => NULL, - 'configuration' => [], - ]; - - /** - * Gets the version of the library. - * - * @return string - * The version string, for example 1.0, 2.1.4, or 3.0.0-alpha5. - * - * @throws \Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface::getVersion() - */ - public function getVersion() { - if (!isset($this->version)) { - throw new UnknownLibraryVersionException($this); - } - return $this->version; - } - - /** - * Sets the version of the library. - * - * @param string $version - * The version of the library. - * - * @return $this - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface::setVersion() - */ - public function setVersion($version) { - $this->version = (string) $version; - return $this; - } - - /** - * Gets the version detector of this library using the detector factory. - * - * Because determining the installation version of a library is not specific - * to any library or even any library type, this logic is offloaded to - * separate detector objects. - * - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $detector_factory - * - * @return \Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface - * - * @see \Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface - */ - public function getVersionDetector(FactoryInterface $detector_factory) { - return $detector_factory->createInstance($this->versionDetector['id'], $this->versionDetector['configuration']); - } - -} diff --git a/web/modules/libraries/src/Plugin/MissingPluginConfigurationException.php b/web/modules/libraries/src/Plugin/MissingPluginConfigurationException.php deleted file mode 100644 index 515f133405ffb4e29ab8607c74e0eb288bc43af4..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/MissingPluginConfigurationException.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin; - -use Drupal\Component\Plugin\Exception\PluginException; - -/** - * Provides an exception class for missing plugin configuration. - * - * The plugin system allows passing arbitrary data to plugins in form of the - * $configuration array. Some plugins, however, may depend on certain keys to - * be present in $configuration. This exception class can be used if such keys - * are missing. - * - * @todo Provide accessors for the passed-in information. - */ -class MissingPluginConfigurationException extends PluginException { - - /** - * Constructs an exception for a missing plugin configuration value. - * - * @param string $plugin_id - * The plugin ID. - * @param $plugin_definition - * The plugin definition - * @param array $configuration - * The plugin configuration. - * @param $missing_key - * The missing key in the configuration. - * @param string $message - * (optional) The exception message. - * @param int $code - * (optional) The error code. - * @param \Exception $previous - * (optional) The previous exception. - */ - public function __construct( - $plugin_id, - $plugin_definition, - array $configuration, - $missing_key, - $message = '', - $code = 0, - \Exception $previous = NULL - ) { - $message = $message ?: "The '{$missing_key}' key is missing in the configuration of the '{$plugin_id}' plugin."; - parent::__construct($message, $code, $previous); - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/Locator/ChainLocator.php b/web/modules/libraries/src/Plugin/libraries/Locator/ChainLocator.php deleted file mode 100644 index 4e0acff84e1630c44e5552e2114e32b7eb9538de..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/Locator/ChainLocator.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\Locator; - -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Local\LocatorInterface; - -/** - * Provides a locator utilizing a chain of other individual locators. - * - * @Locator("chain") - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - */ -class ChainLocator implements LocatorInterface { - - /** - * The locators to check. - * - * @var \Drupal\libraries\ExternalLibrary\Local\LocatorInterface[] - */ - protected $locators = []; - - /** - * Add a locator to the chain. - * - * @param \Drupal\libraries\ExternalLibrary\Local\LocatorInterface $locator - * A locator to add to the chain. - */ - public function addLocator(LocatorInterface $locator) { - $this->locators[] = $locator; - return $this; - } - - /** - * Locates a library. - * - * @param \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library - * The library to locate. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface::locate() - */ - public function locate(LocalLibraryInterface $library) { - foreach ($this->locators as $locator) { - $locator->locate($library); - if ($library->isInstalled()) { - return; - } - } - $library->setUninstalled(); - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/Locator/GlobalLocator.php b/web/modules/libraries/src/Plugin/libraries/Locator/GlobalLocator.php deleted file mode 100644 index 3501338d4f66133e9c2d49ecb32ec9b70ef45650..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/Locator/GlobalLocator.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\Locator; - -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Local\LocatorInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Provides a locator based on global configuration. - * - * @Locator("global") - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - */ -class GlobalLocator implements LocatorInterface, ContainerFactoryPluginInterface { - - /** - * The Drupal config factory service. - * - * @var \Drupal\Core\Config\ConfigFactoryInterface - */ - protected $configFactory; - - /** - * The locator factory. - * - * @var \Drupal\Component\Plugin\Factory\FactoryInterface - */ - protected $locatorFactory; - - /** - * Constructs a global locator. - * - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The Drupal config factory service. - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory - * The locator factory. - */ - public function __construct(ConfigFactoryInterface $config_factory, FactoryInterface $locator_factory) { - $this->configFactory = $config_factory; - $this->locatorFactory = $locator_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $container->get('config.factory'), - $container->get('plugin.manager.libraries.locator') - ); - } - - /** - * Locates a library. - * - * @param \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library - * The library to locate. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface::locate() - */ - public function locate(LocalLibraryInterface $library) { - foreach ($this->configFactory->get('libraries.settings')->get('global_locators') as $locator) { - $this->locatorFactory->createInstance($locator['id'], $locator['configuration'])->locate($library); - if ($library->isInstalled()) { - return; - } - } - $library->setUninstalled(); - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/Locator/UriLocator.php b/web/modules/libraries/src/Plugin/libraries/Locator/UriLocator.php deleted file mode 100644 index 348be0c247c8aec40cbba68e28c132437b9c0938..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/Locator/UriLocator.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\Locator; - -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Local\LocatorInterface; -use Drupal\libraries\Plugin\MissingPluginConfigurationException; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Provides a locator utilizing a URI. - * - * It makes the following assumptions: - * - The library files can be accessed using a specified stream. - * - The stream wrapper is local (i.e. it is a subclass of - * \Drupal\Core\StreamWrapper\LocalStream). - * - The first component of the file URIs are the library IDs (i.e. file URIs - * are of the form: scheme://library-id/path/to/file/filename). - * - * @Locator("uri") - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface - */ -class UriLocator implements LocatorInterface, ContainerFactoryPluginInterface { - - /** - * The stream wrapper manager. - * - * @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface - */ - protected $streamWrapperManager; - - /** - * The URI to check. - * - * @var string - */ - protected $uri; - - /** - * Constructs a URI locator. - * - * @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager - * The stream wrapper manager. - * @param string $uri - * The URI to check. - */ - public function __construct(StreamWrapperManagerInterface $stream_wrapper_manager, $uri) { - $this->streamWrapperManager = $stream_wrapper_manager; - $this->uri = (string) $uri; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - if (!isset($configuration['uri'])) { - throw new MissingPluginConfigurationException($plugin_id, $plugin_definition, $configuration, 'uri'); - } - return new static($container->get('stream_wrapper_manager'), $configuration['uri']); - } - - /** - * Locates a library. - * - * @param \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library - * The library to locate. - * - * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface::locate() - */ - public function locate(LocalLibraryInterface $library) { - /** @var \Drupal\Core\StreamWrapper\LocalStream $stream_wrapper */ - $stream_wrapper = $this->streamWrapperManager->getViaUri($this->uri); - assert('$stream_wrapper instanceof \Drupal\Core\StreamWrapper\LocalStream'); - // Calling LocalStream::getDirectoryPath() explicitly avoids the realpath() - // usage in LocalStream::getLocalPath(), which breaks if Libraries API is - // symbolically linked into the Drupal installation. - list($scheme, $target) = explode('://', $this->uri, 2); - $base_path = str_replace('//', '/', $stream_wrapper->getDirectoryPath() . '/' . $target . '/' . $library->getId()); - if (is_dir($base_path) && is_readable($base_path)) { - $library->setLocalPath($base_path); - return; - } - $library->setUninstalled(); - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/Type/AssetLibraryType.php b/web/modules/libraries/src/Plugin/libraries/Type/AssetLibraryType.php deleted file mode 100644 index ce0b276b17eb58aa46789392ae6eb6fb92e1c866..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/Type/AssetLibraryType.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\Type; - -use Drupal\libraries\ExternalLibrary\Asset\AssetLibrary; -use Drupal\libraries\ExternalLibrary\Asset\AttachableAssetLibraryRegistrationInterface; -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\LibraryManagerInterface; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeBase; - -/** - * @LibraryType("asset") - */ -class AssetLibraryType extends LibraryTypeBase implements AttachableAssetLibraryRegistrationInterface { - - /** - * {@inheritdoc} - */ - public function getLibraryClass() { - return AssetLibrary::class; - } - - /** - * {@inheritdoc} - */ - public function getAttachableAssetLibraries(LibraryInterface $library, LibraryManagerInterface $library_manager) { - assert('$library instanceof \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface'); - /** @var \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface $library */ - return [$library->getId() => $library->getAttachableAssetLibrary($library_manager)]; - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/Type/MultipleAssetLibraryType.php b/web/modules/libraries/src/Plugin/libraries/Type/MultipleAssetLibraryType.php deleted file mode 100644 index 31ec6a62c6c41aace30735496788f4f85118900d..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/Type/MultipleAssetLibraryType.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\Type; - -use Drupal\libraries\ExternalLibrary\Asset\AttachableAssetLibraryRegistrationInterface; -use Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibrary; -use Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface; -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\LibraryManagerInterface; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeBase; - -/** - * @LibraryType("asset_multiple") - */ -class MultipleAssetLibraryType extends LibraryTypeBase implements AttachableAssetLibraryRegistrationInterface { - - /** - * {@inheritdoc} - */ - public function getLibraryClass() { - return MultipleAssetLibrary::class; - } - - /** - * {@inheritdoc} - */ - public function getAttachableAssetLibraries(LibraryInterface $external_library, LibraryManagerInterface $library_manager) { - assert('$external_library instanceof \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface'); - /** @var \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface $external_library */ - $attachable_libraries = []; - foreach ($external_library->getAttachableAssetLibraries($library_manager) as $component_name => $attachable_library) { - $attachable_library_id = $this->getAttachableLibraryId($external_library, $component_name); - $attachable_libraries[$attachable_library_id] = $attachable_library; - } - return $attachable_libraries; - } - - /** - * @param \Drupal\libraries\ExternalLibrary\LibraryInterface $external_library - * @param string $component_name - * - * @return string - */ - protected function getAttachableLibraryId(LibraryInterface $external_library, $component_name) { - return $external_library->getId() . MultipleAssetLibraryInterface::SEPARATOR . $component_name; - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/Type/PhpFileLibraryType.php b/web/modules/libraries/src/Plugin/libraries/Type/PhpFileLibraryType.php deleted file mode 100644 index aa93b003c2976c84935cb04afb770a8b88c22d33..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/Type/PhpFileLibraryType.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\Type; - -use Drupal\Component\Plugin\Factory\FactoryInterface; -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\Type\LibraryLoadingListenerInterface; -use Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLibrary; -use Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLoaderInterface; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeBase; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * @LibraryType("php_file") - */ -class PhpFileLibraryType extends LibraryTypeBase implements LibraryLoadingListenerInterface { - - /** - * The PHP file loader. - * - * @var \Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLoaderInterface - */ - protected $phpFileLoader; - - /** - * Constructs the PHP file library type. - * - * @param string $plugin_id - * The plugin ID taken from the class annotation. - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory - * The locator factory. - * @param \Drupal\Component\Plugin\Factory\FactoryInterface $detector_factory - * The version detector factory. - * @param \Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLoaderInterface $php_file_loader - * The PHP file loader. - */ - public function __construct($plugin_id, FactoryInterface $locator_factory, FactoryInterface $detector_factory, PhpFileLoaderInterface $php_file_loader) { - parent::__construct($plugin_id, $locator_factory, $detector_factory); - $this->phpFileLoader = $php_file_loader; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $plugin_id, - $container->get('plugin.manager.libraries.locator'), - $container->get('plugin.manager.libraries.version_detector'), - $container->get('libraries.php_file_loader') - ); - } - - /** - * {@inheritdoc} - */ - public function getLibraryClass() { - return PhpFileLibrary::class; - } - - /** - * {@inheritdoc} - */ - public function onLibraryLoad(LibraryInterface $library) { - /** @var \Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLibraryInterface $library */ - // @todo Prevent loading a library multiple times. - foreach ($library->getPhpFiles() as $file) { - $this->phpFileLoader->load($file); - } - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/VersionDetector/LinePatternDetector.php b/web/modules/libraries/src/Plugin/libraries/VersionDetector/LinePatternDetector.php deleted file mode 100644 index 25a799c536d344e105400274e6ce2de5924a60d5..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/VersionDetector/LinePatternDetector.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\VersionDetector; - -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\Plugin\PluginBase; -use Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException; -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Detects the version by matching lines in a file against a specified pattern. - * - * This version detector can be used if the library version is denoted in a - * particular format in a changelog or readme file, for example. - * - * @VersionDetector("line_pattern") - * - * @ingroup libraries - */ -class LinePatternDetector extends PluginBase implements VersionDetectorInterface, ContainerFactoryPluginInterface { - - /** - * The app root. - * - * @var string - */ - protected $appRoot; - - /** - * Constructs a line pattern version detector. - * - * @param array $configuration - * @param string $plugin_id - * @param array $plugin_definition - * @param string $app_root - */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, $app_root) { - $configuration += [ - 'file' => '', - 'pattern' => '', - 'lines' => 20, - 'columns' => 200, - ]; - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->appRoot = $app_root; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('app.root') - ); - } - - /** - * {@inheritdoc} - */ - public function detectVersion(VersionedLibraryInterface $library) { - if (!($library instanceof LocalLibraryInterface)) { - throw new UnknownLibraryVersionException($library); - } - - $filepath = $this->appRoot . '/' . $library->getLocalPath() . '/' . $this->configuration['file']; - if (!file_exists($filepath)) { - throw new UnknownLibraryVersionException($library); - } - - $file = fopen($filepath, 'r'); - $lines = $this->configuration['lines']; - while ($lines && $line = fgets($file, $this->configuration['columns'])) { - if (preg_match($this->configuration['pattern'], $line, $version)) { - fclose($file); - $library->setVersion($version[1]); - return; - } - $lines--; - } - fclose($file); - } - -} diff --git a/web/modules/libraries/src/Plugin/libraries/VersionDetector/StaticDetector.php b/web/modules/libraries/src/Plugin/libraries/VersionDetector/StaticDetector.php deleted file mode 100644 index ed697de50b07452f1178adbdd12631657130b5c7..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Plugin/libraries/VersionDetector/StaticDetector.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Drupal\libraries\Plugin\libraries\VersionDetector; - -use Drupal\Core\Plugin\PluginBase; -use Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException; -use Drupal\libraries\ExternalLibrary\Version\VersionDetectorInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; - -/** - * Detects the version by returning a static string. - * - * As this does not perform any actual detection and, thus, circumvents any - * negotiation of versions by Libraries API it should only be used for testing - * or when the version of a library cannot be determined from the source code - * itself. - * - * @VersionDetector("static") - */ -class StaticDetector extends PluginBase implements VersionDetectorInterface { - - /** - * Constructs a static version detector. - * - * @param array $configuration - * @param string $plugin_id - * @param array $plugin_definition - */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition) { - $configuration += [ - 'version' => NULL, - ]; - parent::__construct($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public function detectVersion(VersionedLibraryInterface $library) { - if (!isset($this->configuration['version'])) { - throw new UnknownLibraryVersionException($library); - } - $library->setVersion($this->configuration['version']); - } - -} diff --git a/web/modules/libraries/src/StreamWrapper/AssetLibrariesStream.php b/web/modules/libraries/src/StreamWrapper/AssetLibrariesStream.php deleted file mode 100644 index 54893a7d04a82d53365f0afb6a0348c852e0903b..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/StreamWrapper/AssetLibrariesStream.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Drupal\libraries\StreamWrapper; - -use Drupal\Core\StreamWrapper\LocalStream; - -/** - * Provides a stream wrapper for asset libraries. - * - * Can be used with the 'asset://' scheme, for example - * 'asset://jquery/jquery.js'. - */ -class AssetLibrariesStream extends LocalStream { - - use LocalHiddenStreamTrait; - use PrivateStreamTrait; - - /** - * {@inheritdoc} - */ - public function getName() { - return t('Assets'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return t('Provides access to asset library files.'); - } - - /** - * {@inheritdoc} - */ - public function getDirectoryPath() { - // @todo Provide support for site-specific directories, etc. - return 'sites/all/assets/vendor'; - } - -} diff --git a/web/modules/libraries/src/StreamWrapper/LibraryDefinitionsStream.php b/web/modules/libraries/src/StreamWrapper/LibraryDefinitionsStream.php deleted file mode 100644 index 7cf0764ec0c75d3cd9cc2d0384c15f395c2811cd..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/StreamWrapper/LibraryDefinitionsStream.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -namespace Drupal\libraries\StreamWrapper; - -use Drupal\Core\StreamWrapper\LocalStream; - -/** - * Provides a stream wrapper for library definitions. - * - * Can be used with the 'library-definitions' scheme, for example - * 'library-definitions://example.json' for a library ID of 'example'. - * - * By default this stream wrapper reads from a single directory that is - * configurable and points to the 'library-definitions' directory within the - * public files directory by default. This makes library definitions writable - * by the webserver by default, which is in anticipation of a user interface - * that fetches definitions from a remote repository and stores them locally. - * For improved security the library definitions can be managed manually (or put - * under version control) and placed in a directory that is not writable by the - * webserver. - * - * The idea of using a stream wrapper for this as well as the default location - * is taken from the 'translations' stream wrapper provided by the Interface - * Translation module. - * - * @see \Drupal\locale\StreamWrapper\TranslationsStream - * - * @todo Use a setting instead of configuration for the directory. - */ -class LibraryDefinitionsStream extends LocalStream { - - use LocalHiddenStreamTrait; - use PrivateStreamTrait; - - /** - * The config factory - * - * @var \Drupal\Core\Config\ConfigFactoryInterface - */ - protected $configFactory; - - /** - * Constructs an external library registry. - * - * @todo Dependency injection. - */ - public function __construct() { - $this->configFactory = \Drupal::configFactory(); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return t('Library definitions'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return t('Provides access to library definition files.'); - } - - /** - * {@inheritdoc} - */ - public function getDirectoryPath() { - return $this->getConfig('local.path'); - } - - /** - * Fetches a configuration value from the library definitions configuration. - * @param $key - * The configuration key to fetch. - * - * @return array|mixed|null - * The configuration value. - */ - protected function getConfig($key) { - return $this->configFactory - ->get('libraries.settings') - ->get("definitions.$key"); - } - -} diff --git a/web/modules/libraries/src/StreamWrapper/LocalHiddenStreamTrait.php b/web/modules/libraries/src/StreamWrapper/LocalHiddenStreamTrait.php deleted file mode 100644 index f71c0de99c735dc3cae2c0062c8f78e5267602c1..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/StreamWrapper/LocalHiddenStreamTrait.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\libraries\StreamWrapper; - -use Drupal\Core\StreamWrapper\StreamWrapperInterface; - -/** - * Provides a trait for local hidden streams. - */ -trait LocalHiddenStreamTrait { - - /** - * Returns the type of stream wrapper. - * - * @return int - * - * @see \Drupal\Core\StreamWrapper\StreamWrapperInterface::getType() - */ - public static function getType() { - return StreamWrapperInterface::LOCAL_HIDDEN; - } - -} diff --git a/web/modules/libraries/src/StreamWrapper/PhpFileLibrariesStream.php b/web/modules/libraries/src/StreamWrapper/PhpFileLibrariesStream.php deleted file mode 100644 index a4933858e106d5f63129f2c3956420abe82ff2e1..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/StreamWrapper/PhpFileLibrariesStream.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Drupal\libraries\StreamWrapper; - -use Drupal\Core\StreamWrapper\LocalStream; - -/** - * Provides a stream wrapper for PHP file libraries. - * - * Can be used with the 'php-file://' scheme, for example - * 'php-file-library://guzzle/src/functions_include.php'. - */ -class PhpFileLibrariesStream extends LocalStream { - - use LocalHiddenStreamTrait; - use PrivateStreamTrait; - - /** - * {@inheritdoc} - */ - public function getName() { - return t('PHP library files'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return t('Provides access to PHP library files.'); - } - - /** - * {@inheritdoc} - */ - public function getDirectoryPath() { - // @todo Provide support for site-specific directories, etc. - return 'sites/all/libraries'; - } - -} diff --git a/web/modules/libraries/src/StreamWrapper/PrivateStreamTrait.php b/web/modules/libraries/src/StreamWrapper/PrivateStreamTrait.php deleted file mode 100644 index 4690551b9bcb26de73b42c9bf9ffb5a59bde3d9b..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/StreamWrapper/PrivateStreamTrait.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\libraries\StreamWrapper; - -/** - * Provides a trait for local streams that are not publicly accessible. - * - * @see \Drupal\locale\StreamWrapper\TranslationsStream - */ -trait PrivateStreamTrait { - - /** - * Returns a web accessible URL for the resource. - * - * This function should return a URL that can be embedded in a web page - * and accessed from a browser. For example, the external URL of - * "youtube://xIpLd0WQKCY" might be - * "http://www.youtube.com/watch?v=xIpLd0WQKCY". - * - * @return string - * Returns a string containing a web accessible URL for the resource. - * - * @see \Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl() - */ - function getExternalUrl() { - throw new \LogicException("{$this->getName()} should not be public."); - } - - /** - * Returns the name of the stream wrapper for use in the UI. - * - * @return string - * The stream wrapper name. - * - * @see \Drupal\Core\StreamWrapper\StreamWrapperInterface::getName() - */ - abstract public function getName(); - -} diff --git a/web/modules/libraries/src/Tests/LibrariesUnitTest.php b/web/modules/libraries/src/Tests/LibrariesUnitTest.php deleted file mode 100644 index f616a92b8ea4caa3855b53244a81fa65f2b7ed0a..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Tests/LibrariesUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Drupal\libraries\Tests; - -use Drupal\simpletest\KernelTestBase; - -/** - * Tests basic Libraries API functions. - * - * @group libraries - */ -class LibrariesUnitTest extends KernelTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = array('libraries'); - - /** - * Tests libraries_get_path(). - */ - function testLibrariesGetPath() { - // Note that, even though libraries_get_path() doesn't find the 'example' - // library, we are able to make it 'installed' by specifying the 'library - // path' up-front. This is only used for testing purposed and is strongly - // discouraged as it defeats the purpose of Libraries API in the first - // place. - $this->assertEqual(libraries_get_path('example'), FALSE, 'libraries_get_path() returns FALSE for a missing library.'); - } - - /** - * Tests libraries_prepare_files(). - */ - function testLibrariesPrepareFiles() { - $expected = array( - 'files' => array( - 'js' => array('example.js' => array()), - 'css' => array('example.css' => array()), - 'php' => array('example.php' => array()), - ), - ); - $library = array( - 'files' => array( - 'js' => array('example.js'), - 'css' => array('example.css'), - 'php' => array('example.php'), - ), - ); - libraries_prepare_files($library, NULL, NULL); - $this->assertEqual($expected, $library, 'libraries_prepare_files() works correctly.'); - } - -} diff --git a/web/modules/libraries/src/Tests/LibrariesWebTest.php b/web/modules/libraries/src/Tests/LibrariesWebTest.php deleted file mode 100644 index 2c9254c45323010c0145c28f58785d39e4e46f81..0000000000000000000000000000000000000000 --- a/web/modules/libraries/src/Tests/LibrariesWebTest.php +++ /dev/null @@ -1,525 +0,0 @@ -<?php - -namespace Drupal\libraries\Tests; - -use Drupal\Component\Utility\Html; -use Drupal\simpletest\WebTestBase; - -/** - * Tests basic detection and loading of libraries. - * - * @group libraries - */ -class LibrariesWebTest extends WebTestBase { - - /** - * {@inheritdoc} - */ - protected $profile = 'testing'; - - /** - * Modules to install. - * - * @var array - */ - public static $modules = array('libraries', 'libraries_test'); - - /** - * The URL generator used in this test. - * - * @var \Drupal\Core\Utility\UnroutedUrlAssemblerInterface - */ - protected $urlAssembler; - - /** - * The state service used in this test. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $this->urlAssembler = $this->container->get('unrouted_url_assembler'); - $this->state = $this->container->get('state'); - } - - /** - * Tests libraries_detect_dependencies(). - */ - function testLibrariesDetectDependencies() { - $library = array( - 'name' => 'Example', - 'dependencies' => array('example_missing'), - ); - libraries_detect_dependencies($library); - $this->assertEqual($library['error'], 'missing dependency', 'libraries_detect_dependencies() detects missing dependency'); - $error_message = t('The %dependency library, which the %library library depends on, is not installed.', array( - '%dependency' => 'Example missing', - '%library' => $library['name'], - )); - $this->verbose("Expected:<br>$error_message"); - $this->verbose('Actual:<br>' . $library['error message']); - $this->assertEqual($library['error message'], $error_message, 'Correct error message for a missing dependency'); - // Test versioned dependencies. - $version = '1.1'; - $compatible = array( - '1.1', - '<=1.1', - '>=1.1', - '<1.2', - '<2.0', - '>1.0', - '>1.0-rc1', - '>1.0-beta2', - '>1.0-alpha3', - '>0.1', - '<1.2, >1.0', - '>0.1, <=1.1', - ); - $incompatible = array( - '1.2', - '2.0', - '<1.1', - '>1.1', - '<=1.0', - '<=1.0-rc1', - '<=1.0-beta2', - '<=1.0-alpha3', - '>=1.2', - '<1.1, >0.9', - '>=0.1, <1.1', - ); - $library = array( - 'name' => 'Example', - ); - foreach ($compatible as $version_string) { - $library['dependencies'][0] = "example_dependency ($version_string)"; - // libraries_detect_dependencies() is a post-detect callback, so - // 'installed' is already set, when it is called. It sets the value to - // FALSE for missing or incompatible dependencies. - $library['installed'] = TRUE; - libraries_detect_dependencies($library); - $this->assertTrue($library['installed'], "libraries_detect_dependencies() detects compatible version string: '$version_string' is compatible with '$version'"); - } - foreach ($incompatible as $version_string) { - $library['dependencies'][0] = "example_dependency ($version_string)"; - $library['installed'] = TRUE; - unset($library['error'], $library['error message']); - libraries_detect_dependencies($library); - $this->assertEqual($library['error'], 'incompatible dependency', "libraries_detect_dependencies() detects incompatible version strings: '$version_string' is incompatible with '$version'"); - } - // Instead of repeating this assertion for each version string, we just - // re-use the $library variable from the foreach loop. - $error_message = t('The version %dependency_version of the %dependency library is not compatible with the %library library.', array( - '%dependency_version' => $version, - '%dependency' => 'Example dependency', - '%library' => $library['name'], - )); - $this->verbose("Expected:<br>$error_message"); - $this->verbose('Actual:<br>' . $library['error message']); - $this->assertEqual($library['error message'], $error_message, 'Correct error message for an incompatible dependency'); - } - - /** - * Tests libraries_scan_info_files(). - */ - function testLibrariesScanInfoFiles() { - $expected = array('example_info_file' => (object) array( - 'uri' => drupal_get_path('module', 'libraries') . '/tests/example/example_info_file.libraries.info.yml', - 'filename' => 'example_info_file.libraries.info.yml', - 'name' => 'example_info_file.libraries.info', - )); - $actual = libraries_scan_info_files(); - $this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); - $this->verbose('Actual:<pre>' . var_export($actual, TRUE) . '</pre>'); - $this->assertEqual($actual, $expected, 'libraries_scan_info_files() correctly finds the example info file.'); - $this->verbose('<pre>' . var_export(libraries_scan_info_files(), TRUE) . '</pre>'); - } - - /** - * Tests libraries_info(). - */ - function testLibrariesInfo() { - // Test that library information is found correctly. - $expected = array( - 'name' => 'Example files', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'files' => array( - 'js' => array('example_1.js' => array()), - 'css' => array('example_1.css' => array()), - 'php' => array('example_1.php' => array()), - ), - 'module' => 'libraries_test', - ); - libraries_info_defaults($expected, 'example_files'); - $library = libraries_info('example_files'); - $this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); - $this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library, $expected, 'Library information is correctly gathered.'); - - // Test a library specified with an .info file gets detected. - $expected = array( - 'name' => 'Example info file', - 'info file' => drupal_get_path('module', 'libraries') . '/tests/example/example_info_file.libraries.info.yml', - ); - libraries_info_defaults($expected, 'example_info_file'); - $library = libraries_info('example_info_file'); - // If this module was downloaded from Drupal.org, the Drupal.org packaging - // system has corrupted the test info file. - // @see http://drupal.org/node/1606606 - unset($library['core'], $library['datestamp'], $library['project'], $library['version']); - $this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); - $this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library, $expected, 'Library specified with an .info file found'); - } - - /** - * Tests libraries_detect(). - */ - function testLibrariesDetect() { - // Test missing library. - $library = libraries_detect('example_missing'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['error'], 'not found', 'Missing library not found.'); - $error_message = t('The %library library could not be found.', array( - '%library' => $library['name'], - )); - $this->assertEqual($library['error message'], $error_message, 'Correct error message for a missing library.'); - - // Test unknown library version. - $library = libraries_detect('example_undetected_version'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['error'], 'not detected', 'Undetected version detected as such.'); - $error_message = t('The version of the %library library could not be detected.', array( - '%library' => $library['name'], - )); - $this->assertEqual($library['error message'], $error_message, 'Correct error message for a library with an undetected version.'); - - // Test unsupported library version. - $library = libraries_detect('example_unsupported_version'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['error'], 'not supported', 'Unsupported version detected as such.'); - $error_message = t('The installed version %version of the %library library is not supported.', array( - '%version' => $library['version'], - '%library' => $library['name'], - )); - $this->assertEqual($library['error message'], $error_message, 'Correct error message for a library with an unsupported version.'); - - // Test supported library version. - $library = libraries_detect('example_supported_version'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['installed'], TRUE, 'Supported library version found.'); - - // Test libraries_get_version(). - $library = libraries_detect('example_default_version_callback'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['version'], '1', 'Expected version returned by default version callback.'); - - // Test a multiple-parameter version callback. - $library = libraries_detect('example_multiple_parameter_version_callback'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['version'], '1', 'Expected version returned by multiple parameter version callback.'); - - // Test a top-level files property. - $library = libraries_detect('example_files'); - $files = array( - 'js' => array('example_1.js' => array()), - 'css' => array('example_1.css' => array()), - 'php' => array('example_1.php' => array()), - ); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['files'], $files, 'Top-level files property works.'); - - // Test version-specific library files. - $library = libraries_detect('example_versions'); - $files = array( - 'js' => array('example_2.js' => array()), - 'css' => array('example_2.css' => array()), - 'php' => array('example_2.php' => array()), - ); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['files'], $files, 'Version-specific library files found.'); - - // Test missing variant. - $library = libraries_detect('example_variant_missing'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['variants']['example_variant']['error'], 'not found', 'Missing variant not found'); - $error_message = t('The %variant variant of the %library library could not be found.', array( - '%variant' => 'example_variant', - '%library' => 'Example variant missing', - )); - $this->assertEqual($library['variants']['example_variant']['error message'], $error_message, 'Correct error message for a missing variant.'); - - // Test existing variant. - $library = libraries_detect('example_variant'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['variants']['example_variant']['installed'], TRUE, 'Existing variant found.'); - } - - /** - * Tests libraries_load(). - * - * @todo Remove or rewrite to accomodate integration with core Libraries. - */ - function _testLibrariesLoad() { - // Test dependencies. - $library = libraries_load('example_dependency_missing'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertFalse($library['loaded'], 'Library with missing dependency cannot be loaded'); - $library = libraries_load('example_dependency_incompatible'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertFalse($library['loaded'], 'Library with incompatible dependency cannot be loaded'); - $library = libraries_load('example_dependency_compatible'); - $this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library['loaded'], 1, 'Library with compatible dependency is loaded'); - $loaded = &drupal_static('libraries_load'); - $this->verbose('<pre>' . var_export($loaded, TRUE) . '</pre>'); - $this->assertEqual($loaded['example_dependency']['loaded'], 1, 'Dependency library is also loaded'); - } - - /** - * Tests the applying of callbacks. - */ - function testCallbacks() { - $expected = array( - 'name' => 'Example callback', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'versions' => array( - '1' => array( - 'variants' => array( - 'example_variant' => array( - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - ), - ), - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - ), - ), - 'variants' => array( - 'example_variant' => array( - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - ), - ), - 'callbacks' => array( - 'info' => array('_libraries_test_info_callback'), - 'pre-detect' => array('_libraries_test_pre_detect_callback'), - 'post-detect' => array('_libraries_test_post_detect_callback'), - 'pre-load' => array('_libraries_test_pre_load_callback'), - 'post-load' => array('_libraries_test_post_load_callback'), - ), - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - 'module' => 'libraries_test', - ); - libraries_info_defaults($expected, 'example_callback'); - - // Test a callback in the 'info' group. - $expected['info callback'] = 'applied (top-level)'; - $expected['versions']['1']['info callback'] = 'applied (version 1)'; - $expected['versions']['1']['variants']['example_variant']['info callback'] = 'applied (version 1, variant example_variant)'; - $expected['variants']['example_variant']['info callback'] = 'applied (variant example_variant)'; - $library = libraries_info('example_callback'); - $this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); - $this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library, $expected, 'Prepare callback was applied correctly.'); - - // Test a callback in the 'pre-detect' and 'post-detect' phases. - // Successfully detected libraries should only contain version information - // for the detected version and thus, be marked as installed. - unset($expected['versions']); - $expected['installed'] = TRUE; - // Additionally, version-specific properties of the detected version are - // supposed to override the corresponding top-level properties. - $expected['info callback'] = 'applied (version 1)'; - $expected['variants']['example_variant']['installed'] = TRUE; - $expected['variants']['example_variant']['info callback'] = 'applied (version 1, variant example_variant)'; - // Version-overloading takes place after the 'pre-detect' callbacks have - // been applied. - $expected['pre-detect callback'] = 'applied (version 1)'; - $expected['post-detect callback'] = 'applied (top-level)'; - $expected['variants']['example_variant']['pre-detect callback'] = 'applied (version 1, variant example_variant)'; - $expected['variants']['example_variant']['post-detect callback'] = 'applied (variant example_variant)'; - $library = libraries_detect('example_callback'); - $this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); - $this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library, $expected, 'Detect callback was applied correctly.'); - - // Test a callback in the 'pre-load' and 'post-load' phases. - // Successfully loaded libraries should only contain information about the - // already loaded variant. - unset($expected['variants']); - $expected['loaded'] = 0; - $expected['pre-load callback'] = 'applied (top-level)'; - $expected['post-load callback'] = 'applied (top-level)'; - $library = libraries_load('example_callback'); - $this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); - $this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library, $expected, 'Pre-load and post-load callbacks were applied correctly.'); - // This is not recommended usually and is only used for testing purposes. - drupal_static_reset('libraries_load'); - // Successfully loaded library variants are supposed to contain the specific - // variant information only. - $expected['info callback'] = 'applied (version 1, variant example_variant)'; - $expected['pre-detect callback'] = 'applied (version 1, variant example_variant)'; - $expected['post-detect callback'] = 'applied (variant example_variant)'; - $library = libraries_load('example_callback', 'example_variant'); - $this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); - $this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); - $this->assertEqual($library, $expected, 'Pre-detect and post-detect callbacks were applied correctly to a variant.'); - } - - /** - * Tests that library files are properly added to the page output. - * - * We check for JavaScript and CSS files directly in the DOM and add a list of - * included PHP files manually to the page output. - * - * @todo Remove or rewrite to accomodate integration with core Libraries. - * @see _libraries_test_load() - */ - function _testLibrariesOutput() { - // Test loading of a simple library with a top-level files property. - $this->drupalGet('libraries_test/files'); - $this->assertLibraryFiles('example_1', 'File loading'); - - // Test loading of integration files. - $this->drupalGet('libraries_test/integration_files'); - $this->assertRaw('libraries_test.js', 'Integration file loading: libraries_test.js found'); - $this->assertRaw('libraries_test.css', 'Integration file loading: libraries_test.css found'); - $this->assertRaw('libraries_test.inc', 'Integration file loading: libraries_test.inc found'); - - // Test version overloading. - $this->drupalGet('libraries_test/versions'); - $this->assertLibraryFiles('example_2', 'Version overloading'); - - // Test variant loading. - $this->drupalGet('libraries_test/variant'); - $this->assertLibraryFiles('example_3', 'Variant loading'); - - // Test version overloading and variant loading. - $this->drupalGet('libraries_test/versions_and_variants'); - $this->assertLibraryFiles('example_4', 'Concurrent version and variant overloading'); - - // Test caching. - \Drupal::state()->set('libraries_test.cache', TRUE); - \Drupal::cache('libraries')->delete('example_callback'); - // When the library information is not cached, all callback groups should be - // invoked. - $this->drupalGet('libraries_test/cache'); - $this->assertRaw('The <em>info</em> callback group was invoked.', 'Info callback invoked for uncached libraries.'); - $this->assertRaw('The <em>pre-detect</em> callback group was invoked.', 'Pre-detect callback invoked for uncached libraries.'); - $this->assertRaw('The <em>post-detect</em> callback group was invoked.', 'Post-detect callback invoked for uncached libraries.'); - $this->assertRaw('The <em>pre-load</em> callback group was invoked.', 'Pre-load callback invoked for uncached libraries.'); - $this->assertRaw('The <em>post-load</em> callback group was invoked.', 'Post-load callback invoked for uncached libraries.'); - // When the library information is cached only the 'pre-load' and - // 'post-load' callback groups should be invoked. - $this->drupalGet('libraries_test/cache'); - $this->assertNoRaw('The <em>info</em> callback group was not invoked.', 'Info callback not invoked for cached libraries.'); - $this->assertNoRaw('The <em>pre-detect</em> callback group was not invoked.', 'Pre-detect callback not invoked for cached libraries.'); - $this->assertNoRaw('The <em>post-detect</em> callback group was not invoked.', 'Post-detect callback not invoked for cached libraries.'); - $this->assertRaw('The <em>pre-load</em> callback group was invoked.', 'Pre-load callback invoked for cached libraries.'); - $this->assertRaw('The <em>post-load</em> callback group was invoked.', 'Post-load callback invoked for cached libraries.'); - \Drupal::state()->set('libraries_test.cache', FALSE); - } - - /** - * Helper function to assert that a library was correctly loaded. - * - * Asserts that all the correct files were loaded and all the incorrect ones - * were not. - * - * @param $name - * The name of the files that should be loaded. The current testing system - * knows of 'example_1', 'example_2', 'example_3' and 'example_4'. Each name - * has an associated JavaScript, CSS and PHP file that will be asserted. All - * other files will be asserted to not be loaded. See - * tests/example/README.txt for more information on how the loading of the - * files is tested. - * @param $label - * (optional) A label to prepend to the assertion messages, to make them - * less ambiguous. - * @param $extensions - * (optional) The expected file extensions of $name. Defaults to - * array('js', 'css', 'php'). - */ - function assertLibraryFiles($name, $label = '', $extensions = array('js', 'css', 'php')) { - $label = ($label !== '' ? "$label: " : ''); - - // Test that the wrong files are not loaded... - $names = array( - 'example_1' => FALSE, - 'example_2' => FALSE, - 'example_3' => FALSE, - 'example_4' => FALSE, - ); - // ...and the correct ones are. - $names[$name] = TRUE; - - // Test for the specific HTML that the different file types appear as in the - // DOM. - $html = array( - 'js' => array('<script src="', '"></script>'), - 'css' => array('<link rel="stylesheet" href="', '" media="all" />'), - // PHP files do not get added to the DOM directly. - // @see _libraries_test_load() - 'php' => array('<li>', '</li>'), - ); - - $html_expected = array(); - $html_not_expected = array(); - - foreach ($names as $name => $expected) { - foreach ($extensions as $extension) { - $filepath = drupal_get_path('module', 'libraries') . "/tests/example/$name.$extension"; - // JavaScript and CSS files appear as full URLs and with an appended - // query string. - if (in_array($extension, array('js', 'css'))) { - $filepath = $this->urlAssembler->assemble("base://$filepath", [ - 'query' => [ - $this->state->get('system.css_js_query_string') ?: '0' => NULL, - ], - 'absolute' => TRUE, - ]); - // If index.php is part of the generated URLs, we need to strip it. - //$filepath = str_replace('index.php/', '', $filepath); - } - list($prefix, $suffix) = $html[$extension]; - $raw = $prefix . $filepath . $suffix; - if ($expected) { - $html_expected[] = Html::escape($raw); - $this->assertRaw($raw, "$label$name.$extension found."); - } - else { - $html_not_expected[] = Html::escape($raw); - $this->assertNoRaw($raw, "$label$name.$extension not found."); - } - } - } - - $html_expected = '<ul><li><pre>' . implode('</pre></li><li><pre>', $html_expected) . '</pre></li></ul>'; - $html_not_expected = '<ul><li><pre>' . implode('</pre></li><li><pre>', $html_not_expected) . '</pre></li></ul>'; - $this->verbose("Strings of HTML that are expected to be present:{$html_expected}Strings of HTML that are expected to not be present:{$html_not_expected}"); - } - -} diff --git a/web/modules/libraries/tests/assets/vendor/test_asset_library/example.css b/web/modules/libraries/tests/assets/vendor/test_asset_library/example.css deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/web/modules/libraries/tests/assets/vendor/test_asset_library/example.js b/web/modules/libraries/tests/assets/vendor/test_asset_library/example.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.first.css b/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.first.css deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.first.js b/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.first.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.second.css b/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.second.css deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.second.js b/web/modules/libraries/tests/assets/vendor/test_asset_multiple_library/example.second.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/web/modules/libraries/tests/example/README.txt b/web/modules/libraries/tests/example/README.txt deleted file mode 100644 index e3582c2abbbb822f47fc834c058ad87d88c50265..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/README.txt +++ /dev/null @@ -1,42 +0,0 @@ - -Example library - -Version 1 - -This file is an example file to test version detection. - -The various other files in this directory are to test the loading of JavaScript, -CSS and PHP files. -- JavaScript: The filenames of the JavaScript files are asserted to be in the - raw HTML via SimpleTest. Since the filename could appear, for instance, in an - error message, this is not very robust. Explicit testing of JavaScript, - though, is not yet possible with SimpleTest. To allow for easier debugging, we - place the following text on the page: - "If this text shows up, no JavaScript test file was loaded." - This text is replaced via JavaScript by a text of the form: - "If this text shows up, [[file] was loaded successfully." - [file] is either 'example_1.js', 'example_2.js', 'example_3.js', - 'example_4.js' or 'libraries_test.js'. If you have SimpleTest's verbose mode - enabled and see the above text in one of the debug pages, the noted JavaScript - file was loaded successfully. -- CSS: The filenames of the CSS files are asserted to be in the raw HTML via - SimpleTest. Since the filename could appear, for instance, in an error - message, this is not very robust. Explicit testing of CSS, though, is not yet - possible with SimpleTest. Hence, the CSS files, if loaded, make the following - text a certain color: - "If one of the CSS test files has been loaded, this text will be colored: - - example_1: red - - example_2: green - - example_3: orange - - example_4: blue - - libraries_test: purple" - If you have SimpleTest's verbose mode enabled, and see the above text in a - certain color (i.e. not in black), a CSS file was loaded successfully. Which - file depends on the color as referenced in the text above. -- PHP: The loading of PHP files is tested by defining a dummy function in the - PHP files and then checking whether this function was defined using - function_exists(). This can be checked programatically with SimpleTest. -The loading of integration files is tested with the same method. The integration -files are libraries_test.js, libraries_test.css, libraries_test.inc and are -located in the tests directory alongside libraries_test.module (i.e. they are -not in the same directory as this file). diff --git a/web/modules/libraries/tests/example/example_1.css b/web/modules/libraries/tests/example/example_1.css deleted file mode 100644 index a732bda5fca4cfcc1734b46a16cb8ac84e6856a2..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_1.css +++ /dev/null @@ -1,11 +0,0 @@ - -/** - * @file - * Test CSS file for Libraries loading. - * - * Color the 'libraries-test-css' div red. See README.txt for more information. - */ - -.libraries-test-css { - color: red; -} diff --git a/web/modules/libraries/tests/example/example_1.js b/web/modules/libraries/tests/example/example_1.js deleted file mode 100644 index 8a1b9a27f45fc82535cddf79569848b8edcfd6c5..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_1.js +++ /dev/null @@ -1,18 +0,0 @@ - -/** - * @file - * Test JavaScript file for Libraries loading. - * - * Replace the text in the 'libraries-test-javascript' div. See README.txt for - * more information. - */ - -(function ($) { - -Drupal.behaviors.librariesTest = { - attach: function(context, settings) { - $('.libraries-test-javascript').text('If this text shows up, example_1.js was loaded successfully.') - } -}; - -})(jQuery); diff --git a/web/modules/libraries/tests/example/example_1.php b/web/modules/libraries/tests/example/example_1.php deleted file mode 100644 index 92e6711a792fee3acac339a8c79c8227ac6ba393..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_1.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * @file - * Test PHP file for Libraries loading. - */ - -/** - * Dummy function to see if this file was loaded. - */ -function _libraries_test_example_1() { -} diff --git a/web/modules/libraries/tests/example/example_2.css b/web/modules/libraries/tests/example/example_2.css deleted file mode 100644 index c8f92899de569ec1caf4ee44e720f0e604d24c59..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_2.css +++ /dev/null @@ -1,11 +0,0 @@ - -/** - * @file - * Test CSS file for Libraries loading. - * - * Color the 'libraries-test-css' div green. See README.txt for more information. - */ - -.libraries-test-css { - color: green; -} diff --git a/web/modules/libraries/tests/example/example_2.js b/web/modules/libraries/tests/example/example_2.js deleted file mode 100644 index 1b744bb166754c8320a19822c5b05c8ed3a9c7ca..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_2.js +++ /dev/null @@ -1,18 +0,0 @@ - -/** - * @file - * Test JavaScript file for Libraries loading. - * - * Replace the text in the 'libraries-test-javascript' div. See README.txt for - * more information. - */ - -(function ($) { - -Drupal.behaviors.librariesTest = { - attach: function(context, settings) { - $('.libraries-test-javascript').text('If this text shows up, example_2.js was loaded successfully.') - } -}; - -})(jQuery); diff --git a/web/modules/libraries/tests/example/example_2.php b/web/modules/libraries/tests/example/example_2.php deleted file mode 100644 index ddded40c3c3c65fff4bc488b5f69b0fc54e879cc..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_2.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * @file - * Test PHP file for Libraries loading. - */ - -/** - * Dummy function to see if this file was loaded. - */ -function _libraries_test_example_2() { -} diff --git a/web/modules/libraries/tests/example/example_3.css b/web/modules/libraries/tests/example/example_3.css deleted file mode 100644 index ffef054a43d8aa575bdbed0b722c0ee7064780b4..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_3.css +++ /dev/null @@ -1,11 +0,0 @@ - -/** - * @file - * Test CSS file for Libraries loading. - * - * Color the 'libraries-test-css' div orange. See README.txt for more information. - */ - -.libraries-test-css { - color: orange; -} diff --git a/web/modules/libraries/tests/example/example_3.js b/web/modules/libraries/tests/example/example_3.js deleted file mode 100644 index d6a3fa4e5b0f1623fc318f360324f1302c382ada..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_3.js +++ /dev/null @@ -1,18 +0,0 @@ - -/** - * @file - * Test JavaScript file for Libraries loading. - * - * Replace the text in the 'libraries-test-javascript' div. See README.txt for - * more information. - */ - -(function ($) { - -Drupal.behaviors.librariesTest = { - attach: function(context, settings) { - $('.libraries-test-javascript').text('If this text shows up, example_3.js was loaded successfully.') - } -}; - -})(jQuery); diff --git a/web/modules/libraries/tests/example/example_3.php b/web/modules/libraries/tests/example/example_3.php deleted file mode 100644 index cf74cf0811bda306b39a22dda9d13fa11cfbf580..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_3.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * @file - * Test PHP file for Libraries loading. - */ - -/** - * Dummy function to see if this file was loaded. - */ -function _libraries_test_example_3() { -} diff --git a/web/modules/libraries/tests/example/example_4.css b/web/modules/libraries/tests/example/example_4.css deleted file mode 100644 index 5030a614808ba266727b8f7a2ee55b935752aa8b..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_4.css +++ /dev/null @@ -1,11 +0,0 @@ - -/** - * @file - * Test CSS file for Libraries loading. - * - * Color the 'libraries-test-css' div blue. See README.txt for more information. - */ - -.libraries-test-css { - color: blue; -} diff --git a/web/modules/libraries/tests/example/example_4.js b/web/modules/libraries/tests/example/example_4.js deleted file mode 100644 index ce5dc26e31fd6e22c721cb5cb378153553306c50..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_4.js +++ /dev/null @@ -1,18 +0,0 @@ - -/** - * @file - * Test JavaScript file for Libraries loading. - * - * Replace the text in the 'libraries-test-javascript' div. See README.txt for - * more information. - */ - -(function ($) { - -Drupal.behaviors.librariesTest = { - attach: function(context, settings) { - $('.libraries-test-javascript').text('If this text shows up, example_4.js was loaded successfully.') - } -}; - -})(jQuery); diff --git a/web/modules/libraries/tests/example/example_4.php b/web/modules/libraries/tests/example/example_4.php deleted file mode 100644 index b46507f540551ef2c07ac17eb7c871fcabf57e8d..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_4.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * @file - * Test PHP file for Libraries loading. - */ - -/** - * Dummy function to see if this file was loaded. - */ -function _libraries_test_example_4() { -} diff --git a/web/modules/libraries/tests/example/example_info_file.libraries.info.yml b/web/modules/libraries/tests/example/example_info_file.libraries.info.yml deleted file mode 100644 index 529af045cf3d5cfce7fb74a9ce74dc98aaec9c88..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/example/example_info_file.libraries.info.yml +++ /dev/null @@ -1,8 +0,0 @@ -# This is an example info file of a library used for testing purposes. -name: Example info file - -# Information added by Drupal.org packaging script on 2018-01-27 -version: '8.x-3.0-alpha1' -core: '8.x' -project: 'libraries' -datestamp: 1517046488 diff --git a/web/modules/libraries/tests/libraries/test_php_file_library/test_php_file_library.php b/web/modules/libraries/tests/libraries/test_php_file_library/test_php_file_library.php deleted file mode 100644 index 8ef69fb553bde2f4d725e3205feb9c62a012a810..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/libraries/test_php_file_library/test_php_file_library.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * @file - * Test PHP file. - * - * This file is part of the 'test_php_file_library' test library. - * - * @see \Drupal\Tests\libraries\Kernel\ExternalLibrary\PhpFile\PhpFileLibraryTest - */ - -/** - * A test function to be able to test whether this file was loaded or not. - */ -function _libraries_test_php_function() { -} diff --git a/web/modules/libraries/tests/library_definitions/test_asset_library.json b/web/modules/libraries/tests/library_definitions/test_asset_library.json deleted file mode 100644 index aca82a39a796efb25bf2908d4ccfdaf67b029615..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/library_definitions/test_asset_library.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "asset", - "version_detector": { - "id": "static", - "configuration": { - "version": "1.0.0" - } - }, - "remote_url": "http://example.com", - "css": { - "base": { - "example.css": {} - } - }, - "js": { - "example.js": {} - } -} diff --git a/web/modules/libraries/tests/library_definitions/test_asset_multiple_library.json b/web/modules/libraries/tests/library_definitions/test_asset_multiple_library.json deleted file mode 100644 index 8bcff3c1c538aa964358593e41b5bdcdb5971ae8..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/library_definitions/test_asset_multiple_library.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "type": "asset_multiple", - "version_detector": { - "id": "static", - "configuration": { - "version": "1.0.0" - } - }, - "remote_url": "http://example.com", - "libraries": { - "first": { - "css": { - "base": { - "example.first.css": {} - } - }, - "js": { - "example.first.js": {} - } - }, - "second": { - "css": { - "base": { - "example.second.css": {} - } - }, - "js": { - "example.second.js": {} - } - } - } -} diff --git a/web/modules/libraries/tests/library_definitions/test_php_file_library.json b/web/modules/libraries/tests/library_definitions/test_php_file_library.json deleted file mode 100644 index 61cb28c9c5f3242fae474328e94fdcb37cce7cb2..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/library_definitions/test_php_file_library.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "php_file", - "files": [ - "test_php_file_library.php" - ] -} diff --git a/web/modules/libraries/tests/modules/libraries_test/libraries_test.css b/web/modules/libraries/tests/modules/libraries_test/libraries_test.css deleted file mode 100644 index 350528129c69498a52f749ffb07f9c323fd3b850..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/modules/libraries_test/libraries_test.css +++ /dev/null @@ -1,12 +0,0 @@ - -/** - * @file - * Test CSS file for Libraries loading. - * - * Color the 'libraries-test-css' div purple. See README.txt for more - * information. - */ - -.libraries-test-css { - color: purple; -} diff --git a/web/modules/libraries/tests/modules/libraries_test/libraries_test.inc b/web/modules/libraries/tests/modules/libraries_test/libraries_test.inc deleted file mode 100644 index 68e2d2eab37071cca089b18010f21b68e8495ac6..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/modules/libraries_test/libraries_test.inc +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * @file - * Test PHP file for Libraries loading. - */ - -/** - * Dummy function to see if this file was loaded. - */ -function _libraries_test_integration_file() { -} diff --git a/web/modules/libraries/tests/modules/libraries_test/libraries_test.info.yml b/web/modules/libraries/tests/modules/libraries_test/libraries_test.info.yml deleted file mode 100644 index be54ba548ffeeb66d574293940fbcbdb06524972..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/modules/libraries_test/libraries_test.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Libraries test module -type: module -description: Tests library detection and loading. -# core: 8.x -dependencies: - - libraries -hidden: TRUE -library_dependencies: - - test_asset_library - - test_asset_multiple_library - -# Information added by Drupal.org packaging script on 2018-01-27 -version: '8.x-3.0-alpha1' -core: '8.x' -project: 'libraries' -datestamp: 1517046488 diff --git a/web/modules/libraries/tests/modules/libraries_test/libraries_test.js b/web/modules/libraries/tests/modules/libraries_test/libraries_test.js deleted file mode 100644 index 25ac3ec7de2cdcb4ca0545ac7cdb88bb0bccaf20..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/modules/libraries_test/libraries_test.js +++ /dev/null @@ -1,18 +0,0 @@ - -/** - * @file - * Test JavaScript file for Libraries loading. - * - * Replace the text in the 'libraries-test-javascript' div. See README.txt for - * more information. - */ - -(function ($) { - -Drupal.behaviors.librariesTest = { - attach: function(context, settings) { - $('.libraries-test-javascript').text('If this text shows up, libraries_test.js was loaded successfully.') - } -}; - -})(jQuery); diff --git a/web/modules/libraries/tests/modules/libraries_test/libraries_test.module b/web/modules/libraries/tests/modules/libraries_test/libraries_test.module deleted file mode 100644 index 1a30ebc1c3c78ffab668b0b0a848bb370a2307cd..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/modules/libraries_test/libraries_test.module +++ /dev/null @@ -1,497 +0,0 @@ -<?php - -/** - * @file - * Tests the library detection and loading. - */ - -use Drupal\Component\Utility\SafeMarkup; - -/** - * Implements hook_libraries_info(). - */ -function libraries_test_libraries_info() { - // Test library detection. - $libraries['example_missing'] = array( - 'name' => 'Example missing', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/missing', - ); - $libraries['example_undetected_version'] = array( - 'name' => 'Example undetected version', - 'library path' => drupal_get_path('module', 'libraries') . '/tests', - 'version callback' => '_libraries_test_return_version', - 'version arguments' => array(FALSE), - ); - $libraries['example_unsupported_version'] = array( - 'name' => 'Example unsupported version', - 'library path' => drupal_get_path('module', 'libraries') . '/tests', - 'version callback' => '_libraries_test_return_version', - 'version arguments' => array('1'), - 'versions' => array( - '2' => array(), - ), - ); - - $libraries['example_supported_version'] = array( - 'name' => 'Example supported version', - 'library path' => drupal_get_path('module', 'libraries') . '/tests', - 'version callback' => '_libraries_test_return_version', - 'version arguments' => array('1'), - 'versions' => array( - '1' => array(), - ), - ); - - // Test the default version callback. - $libraries['example_default_version_callback'] = array( - 'name' => 'Example default version callback', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version arguments' => array( - 'file' => 'README.txt', - // Version 1 - 'pattern' => '/Version (\d+)/', - 'lines' => 5, - ), - ); - - // Test a multiple-parameter version callback. - $libraries['example_multiple_parameter_version_callback'] = array( - 'name' => 'Example multiple parameter version callback', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - // Version 1 - 'version callback' => '_libraries_test_get_version', - 'version arguments' => array('README.txt', '/Version (\d+)/', 5), - ); - - // Test a top-level files property. - $libraries['example_files'] = array( - 'name' => 'Example files', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'files' => array( - 'js' => array('example_1.js'), - 'css' => array('example_1.css'), - 'php' => array('example_1.php'), - ), - ); - - // Test loading of integration files. - // Normally added by the corresponding module via hook_libraries_info_alter(), - // these files should be automatically loaded when the library is loaded. - $libraries['example_integration_files'] = array( - 'name' => 'Example integration files', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'integration files' => array( - 'libraries_test' => array( - 'js' => array('libraries_test.js'), - 'css' => array('libraries_test.css'), - 'php' => array('libraries_test.inc'), - ), - ), - ); - - // Test version overloading. - $libraries['example_versions'] = array( - 'name' => 'Example versions', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '2', - 'versions' => array( - '1' => array( - 'files' => array( - 'js' => array('example_1.js'), - 'css' => array('example_1.css'), - 'php' => array('example_1.php'), - ), - ), - '2' => array( - 'files' => array( - 'js' => array('example_2.js'), - 'css' => array('example_2.css'), - 'php' => array('example_2.php'), - ), - ), - ), - ); - - // Test variant detection. - $libraries['example_variant_missing'] = array( - 'name' => 'Example variant missing', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'variants' => array( - 'example_variant' => array( - 'files' => array( - 'js' => array('example_3.js'), - 'css' => array('example_3.css'), - 'php' => array('example_3.php'), - ), - 'variant callback' => '_libraries_test_return_installed', - 'variant arguments' => array(FALSE), - ), - ), - ); - - $libraries['example_variant'] = array( - 'name' => 'Example variant', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'variants' => array( - 'example_variant' => array( - 'files' => array( - 'js' => array('example_3.js'), - 'css' => array('example_3.css'), - 'php' => array('example_3.php'), - ), - 'variant callback' => '_libraries_test_return_installed', - 'variant arguments' => array(TRUE), - ), - ), - ); - - // Test correct behaviour with multiple versions and multiple variants. - $libraries['example_versions_and_variants'] = array( - 'name' => 'Example versions and variants', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '2', - 'versions' => array( - '1' => array( - 'variants' => array( - 'example_variant_1' => array( - 'files' => array( - 'js' => array('example_1.js'), - 'css' => array('example_1.css'), - 'php' => array('example_1.php'), - ), - 'variant callback' => '_libraries_test_return_installed', - 'variant arguments' => array(TRUE), - ), - 'example_variant_2' => array( - 'files' => array( - 'js' => array('example_2.js'), - 'css' => array('example_2.css'), - 'php' => array('example_2.php'), - ), - 'variant callback' => '_libraries_test_return_installed', - 'variant arguments' => array(TRUE), - ), - ), - ), - '2' => array( - 'variants' => array( - 'example_variant_1' => array( - 'files' => array( - 'js' => array('example_3.js'), - 'css' => array('example_3.css'), - 'php' => array('example_3.php'), - ), - 'variant callback' => '_libraries_test_return_installed', - 'variant arguments' => array(TRUE), - ), - 'example_variant_2' => array( - 'files' => array( - 'js' => array('example_4.js'), - 'css' => array('example_4.css'), - 'php' => array('example_4.php'), - ), - 'variant callback' => '_libraries_test_return_installed', - 'variant arguments' => array(TRUE), - ), - ), - ), - ), - ); - - // Test dependency loading. - // We add one file to each library to be able to verify if it was loaded with - // libraries_load(). - // This library acts as a dependency for the libraries below. - $libraries['example_dependency'] = array( - 'name' => 'Example dependency', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1.1', - 'files' => array('js' => array('example_1.js')), - ); - $libraries['example_dependency_missing'] = array( - 'name' => 'Example dependency missing', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'dependencies' => array('example_missing'), - 'files' => array('js' => array('example_1.js')), - ); - $libraries['example_dependency_incompatible'] = array( - 'name' => 'Example dependency incompatible', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'dependencies' => array('example_dependency (>1.1)'), - 'files' => array('js' => array('example_1.js')), - ); - $libraries['example_dependency_compatible'] = array( - 'name' => 'Example dependency compatible', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'dependencies' => array('example_dependency (>=1.1)'), - 'files' => array('js' => array('example_1.js')), - ); - - // Test the applying of callbacks. - $libraries['example_callback'] = array( - 'name' => 'Example callback', - 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', - 'version' => '1', - 'versions' => array( - '1' => array( - 'variants' => array( - 'example_variant' => array( - // These keys are for testing purposes only. - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - ), - ), - // These keys are for testing purposes only. - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - ), - ), - 'variants' => array( - 'example_variant' => array( - // These keys are for testing purposes only. - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - ), - ), - 'callbacks' => array( - 'info' => array('_libraries_test_info_callback'), - 'pre-detect' => array('_libraries_test_pre_detect_callback'), - 'post-detect' => array('_libraries_test_post_detect_callback'), - 'pre-load' => array('_libraries_test_pre_load_callback'), - 'post-load' => array('_libraries_test_post_load_callback'), - ), - // These keys are for testing purposes only. - 'info callback' => 'not applied', - 'pre-detect callback' => 'not applied', - 'post-detect callback' => 'not applied', - 'pre-load callback' => 'not applied', - 'post-load callback' => 'not applied', - ); - - return $libraries; -} - -/** - * Implements hook_libraries_info_file_paths() - */ -function libraries_test_libraries_info_file_paths() { - return array(drupal_get_path('module', 'libraries') . '/tests/example'); -} - -/** - * Gets the version of an example library. - * - * Returns exactly the version string entered as the $version parameter. This - * function cannot be collapsed with _libraries_test_return_installed(), because - * of the different arguments that are passed automatically. - */ -function _libraries_test_return_version($library, $version) { - return $version; -} - -/** - * Gets the version information from an arbitrary library. - * - * Test function for a version callback with multiple arguments. This is an - * exact copy of libraries_get_version(), which uses a single $option argument, - * except for the fact that it uses multiple arguments. Since we support both - * type of version callbacks, detecting the version of a test library with this - * function ensures that the arguments are passed correctly. This function might - * be a useful reference for a custom version callback that uses multiple - * parameters. - * - * @param $library - * An associative array containing all information about the library. - * @param $file - * The filename to parse for the version, relative to the library path. For - * example: 'docs/changelog.txt'. - * @param pattern - * A string containing a regular expression (PCRE) to match the library - * version. For example: '/@version (\d+)\.(\d+)/'. - * @param lines - * (optional) The maximum number of lines to search the pattern in. Defaults - * to 20. - * @param cols - * (optional) The maximum number of characters per line to take into account. - * Defaults to 200. In case of minified or compressed files, this prevents - * reading the entire file into memory. - * - * @return - * A string containing the version of the library. - * - * @see libraries_get_version() - */ -function _libraries_test_get_version($library, $file, $pattern, $lines = 20, $cols = 200) { - - $file = DRUPAL_ROOT . '/' . $library['library path'] . '/' . $file; - if (!file_exists($file)) { - return; - } - $file = fopen($file, 'r'); - while ($lines && $line = fgets($file, $cols)) { - if (preg_match($pattern, $line, $version)) { - fclose($file); - return $version[1]; - } - $lines--; - } - fclose($file); -} - -/** - * Detects the variant of an example library. - * - * Returns exactly the value of $installed, either TRUE or FALSE. This function - * cannot be collapsed with _libraries_test_return_version(), because of the - * different arguments that are passed automatically. - */ -function _libraries_test_return_installed($library, $name, $installed) { - return $installed; -} - -/** - * Sets the 'info callback' key. - * - * This function is used as a test callback for the 'info' callback group. - * - * @see _libraries_test_callback() - */ -function _libraries_test_info_callback(&$library, $version, $variant) { - _libraries_test_callback($library, $version, $variant, 'info'); -} - -/** - * Sets the 'pre-detect callback' key. - * - * This function is used as a test callback for the 'pre-detect' callback group. - * - * @see _libraries_test_callback() - */ -function _libraries_test_pre_detect_callback(&$library, $version, $variant) { - _libraries_test_callback($library, $version, $variant, 'pre-detect'); -} - -/** - * Sets the 'post-detect callback' key. - * - * This function is used as a test callback for the 'post-detect callback group. - * - * @see _libraries_test_callback() - */ -function _libraries_test_post_detect_callback(&$library, $version, $variant) { - _libraries_test_callback($library, $version, $variant, 'post-detect'); -} - -/** - * Sets the 'pre-load callback' key. - * - * This function is used as a test callback for the 'pre-load' callback group. - * - * @see _libraries_test_callback() - */ -function _libraries_test_pre_load_callback(&$library, $version, $variant) { - _libraries_test_callback($library, $version, $variant, 'pre-load'); -} - -/** - * Sets the 'post-load callback' key. - * - * This function is used as a test callback for the 'post-load' callback group. - * - * @see _libraries_test_callback() - */ -function _libraries_test_post_load_callback(&$library, $version, $variant) { - _libraries_test_callback($library, $version, $variant, 'post-load'); -} - -/** - * Sets the '[group] callback' key, where [group] is prepare, detect, or load. - * - * This function is used as a test callback for the all callback groups. - * - * It sets the '[group] callback' (see above) key to 'applied ([part])' where - * [part] is either 'top-level', 'version x.y' (where x.y is the passed-in - * version string), 'variant example' (where example is the passed-in variant - * name), or 'version x.y, variant example' (see above), depending on the part - * of the library the passed-in library information belongs to. - * - * @param $library - * An array of library information, which may be version- or variant-specific. - * Passed by reference. - * @param $version - * The version the library information passed in $library belongs to, or NULL - * if the passed library information is not version-specific. - * @param $variant - * The variant the library information passed in $library belongs to, or NULL - * if the passed library information is not variant-specific. - */ -function _libraries_test_callback(&$library, $version, $variant, $group) { - $string = 'applied'; - if (isset($version) && isset($variant)) { - $string .= " (version $version, variant $variant)"; - } - elseif (isset($version)) { - $string .= " (version $version)"; - } - elseif (isset($variant)) { - $string .= " (variant $variant)"; - } - else { - $string .= ' (top-level)'; - } - $library["$group callback"] = $string; - - // The following is used to test caching of library information. - // Only set the message for the top-level library to prevent confusing, - // duplicate messages. - if (!isset($version) && !isset($variant) && \Drupal::state()->get('libraries_test.cache', FALSE)) { - drupal_set_message(SafeMarkup::set("The <em>$group</em> callback group was invoked.")); - } -} - -/** - * Implements hook_menu(). - */ -function libraries_test_menu() { - $items['libraries_test/files'] = array( - 'title' => 'Test files', - 'route_name' => 'libraries_test_files', - ); - $items['libraries_test/integration_files'] = array( - 'title' => 'Test integration files', - 'route_name' => 'libraries_test_integration_files', - ); - $items['libraries_test/versions'] = array( - 'title' => 'Test version loading', - 'route_name' => 'libraries_test_versions', - ); - $items['libraries_test/variant'] = array( - 'title' => 'Test variant loading', - 'route_name' => 'libraries_test_variant', - ); - $items['libraries_test/versions_and_variants'] = array( - 'title' => 'Test concurrent version and variant loading', - 'route_name' => 'libraries_test_versions_and_variants', - ); - $items['libraries_test/cache'] = array( - 'title' => 'Test caching of library information', - 'route_name' => 'libraries_test_cache', - ); - return $items; -} diff --git a/web/modules/libraries/tests/modules/libraries_test/libraries_test.routing.yml b/web/modules/libraries/tests/modules/libraries_test/libraries_test.routing.yml deleted file mode 100644 index a11f0bececf331cf93796d8a6031eaa6aff2c4e5..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/modules/libraries_test/libraries_test.routing.yml +++ /dev/null @@ -1,36 +0,0 @@ -libraries_test_files: - path: '/libraries_test/files' - defaults: - _controller: Drupal\libraries_test\Controller\ExampleController::files - requirements: - _access: 'TRUE' -libraries_test_integration_files: - path: '/libraries_test/integration_files' - defaults: - _controller: Drupal\libraries_test\Controller\ExampleController::integration - requirements: - _access: 'TRUE' -libraries_test_versions: - path: '/libraries_test/versions' - defaults: - _controller: Drupal\libraries_test\Controller\ExampleController::versions - requirements: - _access: 'TRUE' -libraries_test_variant: - path: '/libraries_test/variant' - defaults: - _controller: Drupal\libraries_test\Controller\ExampleController::variant - requirements: - _access: 'TRUE' -libraries_test_versions_and_variants: - path: '/libraries_test/versions_and_variants' - defaults: - _controller: Drupal\libraries_test\Controller\ExampleController::versionsAndVariants - requirements: - _access: 'TRUE' -libraries_test_cache: - path: '/libraries_test/cache' - defaults: - _controller: Drupal\libraries_test\Controller\ExampleController::cache - requirements: - _access: 'TRUE' diff --git a/web/modules/libraries/tests/modules/libraries_test/src/Controller/ExampleController.php b/web/modules/libraries/tests/modules/libraries_test/src/Controller/ExampleController.php deleted file mode 100644 index 217ebf2f8ab4028aff545bd7560818355f602957..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/modules/libraries_test/src/Controller/ExampleController.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php - -namespace Drupal\libraries_test\Controller; - -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -class ExampleController implements ContainerInjectionInterface { - - /** - * Injects BookManager Service. - */ - public static function create(ContainerInterface $container) { - return new static(); - } - - /** - * Loads a specified library (variant) for testing. - * - * JavaScript and CSS files can be checked directly by SimpleTest, so we only - * need to manually check for PHP files. We provide information about the loaded - * JavaScript and CSS files for easier debugging. See example/README.txt for - * more information. - */ - private function buildPage($library, $variant = NULL) { - libraries_load($library, $variant); - // JavaScript and CSS files can be checked directly by SimpleTest, so we only - // need to manually check for PHP files. - $output = ''; - - // For easer debugging of JS loading, a text is shown that the JavaScript will - // replace. - $output .= '<h2>JavaScript</h2>'; - $output .= '<div class="libraries-test-javascript">'; - $output .= 'If this text shows up, no JavaScript test file was loaded.'; - $output .= '</div>'; - - // For easier debugging of CSS loading, the loaded CSS files will color the - // following text. - $output .= '<h2>CSS</h2>'; - $output .= '<div class="libraries-test-css">'; - $output .= 'If one of the CSS test files has been loaded, this text will be colored:'; - $output .= '<ul>'; - // Do not reference the actual CSS files (i.e. including '.css'), because that - // breaks testing. - $output .= '<li>example_1: red</li>'; - $output .= '<li>example_2: green</li>'; - $output .= '<li>example_3: orange</li>'; - $output .= '<li>example_4: blue</li>'; - $output .= '<li>libraries_test: purple</li>'; - $output .= '</ul>'; - $output .= '</div>'; - - $output .= '<h2>PHP</h2>'; - $output .= '<div class="libraries-test-php">'; - $output .= 'The following is a list of all loaded test PHP files:'; - $output .= '<ul>'; - $files = get_included_files(); - foreach ($files as $file) { - if ((strpos($file, 'libraries/test') || strpos($file, 'libraries_test')) && !strpos($file, 'libraries_test.module') && !strpos($file, 'lib/Drupal/libraries_test')) { - $output .= '<li>' . str_replace(DRUPAL_ROOT . '/', '', $file) . '</li>'; - } - } - $output .= '</ul>'; - $output .= '</div>'; - - return ['#markup' => $output]; - } - - public function files() { - return $this->buildPage('example_files'); - } - - public function integration() { - return $this->buildPage('example_integration_files'); - } - - public function versions() { - return $this->buildPage('example_versions'); - } - - public function variant() { - return $this->buildPage('example_variant', 'example_variant'); - } - - public function versionsAndVariants() { - return $this->buildPage('example_versions_and_variants', 'example_variant_2'); - } - - public function cache() { - return $this->buildPage('example_callback'); - } - -} diff --git a/web/modules/libraries/tests/src/Functional/ExternalLibrary/Definition/DefinitionDiscoveryFactoryTest.php b/web/modules/libraries/tests/src/Functional/ExternalLibrary/Definition/DefinitionDiscoveryFactoryTest.php deleted file mode 100644 index 14bf74e4f6ecfbbd5e1a7a693c4a88349af084be..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Functional/ExternalLibrary/Definition/DefinitionDiscoveryFactoryTest.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Functional\ExternalLibrary\Definition; - -use Drupal\Tests\BrowserTestBase; - -/** - * Tests that remote library definitions are found and downloaded. - * - * This is a browser test because Guzzle is not usable from a kernel test. - * - * @group libraries - * - * @todo Make this a kernel test when https://www.drupal.org/node/2571475 is in. - */ -class DefinitionDiscoveryFactoryTest extends BrowserTestBase { - - /** - * The 'libraries.settings' configuration object. - * - * @var \Drupal\Core\Config\Config - */ - protected $config; - - /** - * The path to the test library definitions. - * - * @var string - */ - protected $definitionPath; - - /** - * {@inheritdoc} - */ - public static $modules = ['libraries']; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */ - $config_factory = $this->container->get('config.factory'); - $this->config = $config_factory->getEditable('libraries.settings'); - - // Set up the remote library definition URL to point to the local website. - /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ - $module_handler = $this->container->get('module_handler'); - $module_path = $module_handler->getModule('libraries')->getPath(); - $this->definitionPath = "$module_path/tests/library_definitions"; - } - - /** - * Tests that the discovery works according to the configuration. - */ - public function testDiscovery() { - $library_id = 'test_asset_library'; - $expected_definition = [ - 'type' => 'asset', - 'version_detector' => [ - 'id' => 'static', - 'configuration' => [ - 'version' => '1.0.0' - ], - ], - 'remote_url' => 'http://example.com', - 'css' => [ - 'base' => [ - 'example.css' => [], - ], - ], - 'js' => [ - 'example.js' => [], - ], - ]; - $discovery_service_id = 'libraries.definition.discovery'; - - // Test the local discovery with an incorrect path. - $this->config - ->set('definition.local.path', 'path/that/does/not/exist') - ->set('definition.remote.enable', FALSE) - ->save(); - $discovery = $this->container->get($discovery_service_id); - $this->assertFalse($discovery->hasDefinition($library_id)); - - // Test the local discovery with a proper path. - $this->config - ->set('definition.local.path', $this->definitionPath) - ->save(); - $discovery = $this->container->get($discovery_service_id); - $this->assertTrue($discovery->hasDefinition($library_id)); - - // Test a remote discovery with an incorrect path. - $definitions_directory = 'public://library-definitions'; - $this->config - ->set('definition.local.path', $definitions_directory) - ->set('definition.remote.enable', TRUE) - ->set('definition.remote.urls', ["$this->baseUrl/path/that/does/not/exist"]) - ->save(); - $discovery = $this->container->get($discovery_service_id); - $this->assertFalse($discovery->hasDefinition($library_id)); - - // Test a remote discovery with a proper path. - $this->config - ->set('definition.remote.urls', ["$this->baseUrl/$this->definitionPath"]) - ->save(); - /** @var \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface $discovery */ - $discovery = $this->container->get($discovery_service_id); - $definition_file = "$definitions_directory/$library_id.json"; - $this->assertFalse(file_exists($definition_file)); - $this->assertTrue($discovery->hasDefinition($library_id)); - $this->assertFalse(file_exists($definition_file)); - $this->assertEquals($discovery->getDefinition($library_id), $expected_definition); - $this->assertTrue(file_exists($definition_file)); - } - -} diff --git a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/AssetLibraryTest.php b/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/AssetLibraryTest.php deleted file mode 100644 index cb2551e22fcd2132a1b8b1b8f267c246be1d67b8..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/AssetLibraryTest.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Kernel\ExternalLibrary\Asset; - -use Drupal\Tests\libraries\Kernel\ExternalLibrary\TestLibraryFilesStream; - -/** - * Tests that external asset libraries are registered as core asset libraries. - * - * @group libraries - */ -class AssetLibraryTest extends AssetLibraryTestBase { - - /** - * {@inheritdoc} - */ - protected function getLibraryTypeId() { - return 'asset'; - } - - /** - * Tests that attachable asset library info is correctly gathered. - */ - public function testAttachableAssetInfo() { - /** @var \Drupal\libraries\ExternalLibrary\Asset\AttachableAssetLibraryRegistrationInterface $library_type */ - $library_type = $this->getLibraryType(); - $library = $this->getLibrary(); - $expected = [ - 'test_asset_library' => [ - 'version' => '1.0.0', - 'css' => ['base' => ['http://example.com/example.css' => []]], - 'js' => ['http://example.com/example.js' => []], - 'dependencies' => [], - ], - ]; - $this->assertEquals($expected, $library_type->getAttachableAssetLibraries($library, $this->libraryManager)); - } - - /** - * Tests that a remote asset library is registered as a core asset library. - * - * @see \Drupal\libraries\Extension\Extension - * @see \Drupal\libraries\Extension\ExtensionHandler - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibrary - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryTrait - * @see \Drupal\libraries\ExternalLibrary\ExternalLibraryManager - * @see \Drupal\libraries\ExternalLibrary\ExternalLibraryTrait - * @see \Drupal\libraries\ExternalLibrary\Registry\ExternalLibraryRegistry - */ - public function testAssetLibraryRemote() { - $library = $this->coreLibraryDiscovery->getLibraryByName('libraries', 'test_asset_library'); - $expected = [ - 'version' => '1.0.0', - 'css' => [[ - 'weight' => -200, - 'group' => 0, - 'type' => 'external', - 'data' => 'http://example.com/example.css', - 'version' => '1.0.0', - ]], - 'js' => [[ - 'group' => -100, - 'type' => 'external', - 'data' => 'http://example.com/example.js', - 'version' => '1.0.0', - ]], - 'dependencies' => [], - 'license' => [ - 'name' => 'GNU-GPL-2.0-or-later', - 'url' => 'https://www.drupal.org/licensing/faq', - 'gpl-compatible' => TRUE, - ] - ]; - $this->assertEquals($expected, $library); - } - - /** - * Tests that a local asset library is registered as a core asset library. - */ - public function testAssetLibraryLocal() { - $this->container->set('stream_wrapper.asset_libraries', new TestLibraryFilesStream( - $this->container->get('module_handler'), - $this->container->get('string_translation'), - 'assets/vendor' - )); - $this->coreLibraryDiscovery->clearCachedDefinitions(); - $library = $this->coreLibraryDiscovery->getLibraryByName('libraries', 'test_asset_library'); - $expected = [ - 'version' => '1.0.0', - 'css' => [[ - 'weight' => -200, - 'group' => 0, - 'type' => 'file', - 'data' => $this->modulePath . '/tests/assets/vendor/test_asset_library/example.css', - 'version' => '1.0.0', - ]], - 'js' => [[ - 'group' => -100, - 'type' => 'file', - 'data' => $this->modulePath . '/tests/assets/vendor/test_asset_library/example.js', - 'version' => '1.0.0', - 'minified' => FALSE, - ]], - 'dependencies' => [], - 'license' => [ - 'name' => 'GNU-GPL-2.0-or-later', - 'url' => 'https://www.drupal.org/licensing/faq', - 'gpl-compatible' => TRUE, - ] - ]; - $this->assertEquals($expected, $library); - } - -} diff --git a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/AssetLibraryTestBase.php b/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/AssetLibraryTestBase.php deleted file mode 100644 index 4f835b72550fd0bf5909aeb5d0d6667b13af9978..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/AssetLibraryTestBase.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Kernel\ExternalLibrary\Asset; - -use Drupal\Tests\libraries\Kernel\LibraryTypeKernelTestBase; - -/** - * Provides a base test class for asset library type tests. - */ -abstract class AssetLibraryTestBase extends LibraryTypeKernelTestBase { - - /** - * {@inheritdoc} - * - * LibraryManager requires system_get_info() which is in system.module. - * - * @see \Drupal\libraries\ExternalLibrary\LibraryManager::getRequiredLibraryIds() - */ - public static $modules = ['system']; - - /** - * The Drupal core library discovery. - * - * @var \Drupal\Core\Asset\LibraryDiscoveryInterface - */ - protected $coreLibraryDiscovery; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - $this->coreLibraryDiscovery = $this->container->get('library.discovery'); - } - -} diff --git a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/MultipleAssetLibraryTest.php b/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/MultipleAssetLibraryTest.php deleted file mode 100644 index 4a2af5c3d7a7424a13dd1d30faa93c0d040be8fe..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/Asset/MultipleAssetLibraryTest.php +++ /dev/null @@ -1,172 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Kernel\ExternalLibrary\Asset; - -use Drupal\Tests\libraries\Kernel\ExternalLibrary\TestLibraryFilesStream; - -/** - * Tests that external asset libraries can register multiple core libraries. - * - * @group libraries - */ -class MultipleAssetLibraryTest extends AssetLibraryTestBase { - - /** - * {@inheritdoc} - */ - protected function getLibraryTypeId() { - return 'asset_multiple'; - } - - /** - * Tests that attachable asset library info is correctly gathered. - */ - public function testAttachableAssetInfo() { - /** @var \Drupal\libraries\ExternalLibrary\Asset\AttachableAssetLibraryRegistrationInterface $library_type */ - $library_type = $this->getLibraryType(); - $library = $this->getLibrary(); - $expected = [ - 'test_asset_multiple_library.first' => [ - 'version' => '1.0.0', - 'css' => ['base' => ['http://example.com/example.first.css' => []]], - 'js' => ['http://example.com/example.first.js' => []], - 'dependencies' => [], - ], - 'test_asset_multiple_library.second' => [ - 'version' => '1.0.0', - 'css' => ['base' => ['http://example.com/example.second.css' => []]], - 'js' => ['http://example.com/example.second.js' => []], - 'dependencies' => [], - ], - ]; - $this->assertEquals($expected, $library_type->getAttachableAssetLibraries($library, $this->libraryManager)); - } - - /** - * Tests that a remote asset library is registered as a core asset library. - * - * @see \Drupal\libraries\Extension\Extension - * @see \Drupal\libraries\Extension\ExtensionHandler - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibrary - * @see \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryTrait - * @see \Drupal\libraries\ExternalLibrary\ExternalLibraryManager - * @see \Drupal\libraries\ExternalLibrary\ExternalLibraryTrait - * @see \Drupal\libraries\ExternalLibrary\Registry\ExternalLibraryRegistry - */ - public function testAssetLibraryRemote() { - $library = $this->coreLibraryDiscovery->getLibraryByName('libraries', 'test_asset_multiple_library.first'); - $expected = [ - 'version' => '1.0.0', - 'css' => [[ - 'weight' => -200, - 'group' => 0, - 'type' => 'external', - 'data' => 'http://example.com/example.first.css', - 'version' => '1.0.0', - ]], - 'js' => [[ - 'group' => -100, - 'type' => 'external', - 'data' => 'http://example.com/example.first.js', - 'version' => '1.0.0', - ]], - 'dependencies' => [], - 'license' => [ - 'name' => 'GNU-GPL-2.0-or-later', - 'url' => 'https://www.drupal.org/licensing/faq', - 'gpl-compatible' => TRUE, - ] - ]; - $this->assertEquals($expected, $library); - - $library = $this->coreLibraryDiscovery->getLibraryByName('libraries', 'test_asset_multiple_library.second'); - $expected = [ - 'version' => '1.0.0', - 'css' => [[ - 'weight' => -200, - 'group' => 0, - 'type' => 'external', - 'data' => 'http://example.com/example.second.css', - 'version' => '1.0.0', - ]], - 'js' => [[ - 'group' => -100, - 'type' => 'external', - 'data' => 'http://example.com/example.second.js', - 'version' => '1.0.0', - ]], - 'dependencies' => [], - 'license' => [ - 'name' => 'GNU-GPL-2.0-or-later', - 'url' => 'https://www.drupal.org/licensing/faq', - 'gpl-compatible' => TRUE, - ] - ]; - $this->assertEquals($expected, $library); - } - - /** - * Tests that a local asset library is registered as a core asset library. - */ - public function testAssetLibraryLocal() { - $this->container->set('stream_wrapper.asset_libraries', new TestLibraryFilesStream( - $this->container->get('module_handler'), - $this->container->get('string_translation'), - 'assets/vendor' - )); - $this->coreLibraryDiscovery->clearCachedDefinitions(); - - $library = $this->coreLibraryDiscovery->getLibraryByName('libraries', 'test_asset_multiple_library.first'); - $expected = [ - 'version' => '1.0.0', - 'css' => [[ - 'weight' => -200, - 'group' => 0, - 'type' => 'file', - 'data' => $this->modulePath . '/tests/assets/vendor/test_asset_multiple_library/example.first.css', - 'version' => '1.0.0', - ]], - 'js' => [[ - 'group' => -100, - 'type' => 'file', - 'data' => $this->modulePath . '/tests/assets/vendor/test_asset_multiple_library/example.first.js', - 'version' => '1.0.0', - 'minified' => FALSE, - ]], - 'dependencies' => [], - 'license' => [ - 'name' => 'GNU-GPL-2.0-or-later', - 'url' => 'https://www.drupal.org/licensing/faq', - 'gpl-compatible' => TRUE, - ] - ]; - $this->assertEquals($expected, $library); - - $library = $this->coreLibraryDiscovery->getLibraryByName('libraries', 'test_asset_multiple_library.second'); - $expected = [ - 'version' => '1.0.0', - 'css' => [[ - 'weight' => -200, - 'group' => 0, - 'type' => 'file', - 'data' => $this->modulePath . '/tests/assets/vendor/test_asset_multiple_library/example.second.css', - 'version' => '1.0.0', - ]], - 'js' => [[ - 'group' => -100, - 'type' => 'file', - 'data' => $this->modulePath . '/tests/assets/vendor/test_asset_multiple_library/example.second.js', - 'version' => '1.0.0', - 'minified' => FALSE, - ]], - 'dependencies' => [], - 'license' => [ - 'name' => 'GNU-GPL-2.0-or-later', - 'url' => 'https://www.drupal.org/licensing/faq', - 'gpl-compatible' => TRUE, - ] - ]; - $this->assertEquals($expected, $library); - } - -} diff --git a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/GlobalLocatorTest.php b/web/modules/libraries/tests/src/Kernel/ExternalLibrary/GlobalLocatorTest.php deleted file mode 100644 index 84eb86eb1e532f06e8ded013c6f9b6da93587d34..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/GlobalLocatorTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Kernel\ExternalLibrary; - -use Drupal\Tests\libraries\Kernel\ExternalLibrary\TestLibraryFilesStream; -use Drupal\Tests\libraries\Kernel\LibraryTypeKernelTestBase; - -/** - * Tests that a global locator can be properly used to load a libraries. - * - * @group libraries - */ -class GlobalLocatorTest extends LibraryTypeKernelTestBase { - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - // Assign our test stream (which points to the test php lib) to the asset - // scheme. This gives us a scheme to work with in the test that is not - // used to locate a php lib by default. - $this->container->set('stream_wrapper.asset_libraries', new TestLibraryFilesStream( - $this->container->get('module_handler'), - $this->container->get('string_translation'), - 'libraries' - )); - } - - /** - * {@inheritdoc} - */ - protected function getLibraryTypeId() { - return 'php_file'; - } - - /** - * Tests that the library is located via the global loactor. - */ - public function testGlobalLocator() { - // By default the library will not be locatable (control assertion) until we - // add the asset stream to the global loctors conf list. - $library = $this->getLibrary(); - $this->assertFalse($library->isInstalled()); - $config_factory = $this->container->get('config.factory'); - $config_factory->getEditable('libraries.settings') - ->set('global_locators', [['id' => 'uri', 'configuration' => ['uri' => 'asset://']]]) - ->save(); - $library = $this->getLibrary(); - $this->assertTrue($library->isInstalled()); - } - -} diff --git a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/PhpFile/PhpFileLibraryTest.php b/web/modules/libraries/tests/src/Kernel/ExternalLibrary/PhpFile/PhpFileLibraryTest.php deleted file mode 100644 index 10c1d2cfee45cc789d1632925badba861e15391a..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/PhpFile/PhpFileLibraryTest.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Kernel\ExternalLibrary\PhpFile; - -use Drupal\Tests\libraries\Kernel\ExternalLibrary\TestLibraryFilesStream; -use Drupal\Tests\libraries\Kernel\LibraryTypeKernelTestBase; - -/** - * Tests that the external library manager properly loads PHP file libraries. - * - * @group libraries - */ -class PhpFileLibraryTest extends LibraryTypeKernelTestBase { - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $this->container->set('stream_wrapper.php_file_libraries', new TestLibraryFilesStream( - $this->container->get('module_handler'), - $this->container->get('string_translation'), - 'libraries' - )); - } - - /** - * {@inheritdoc} - */ - protected function getLibraryTypeId() { - return 'php_file'; - } - - /** - * Tests that the list of PHP files is correctly gathered. - */ - public function testPhpFileInfo() { - /** @var \Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLibrary $library */ - $library = $this->getLibrary(); - $this->assertTrue($library->isInstalled()); - $library_path = $this->modulePath . '/tests/libraries/test_php_file_library'; - $this->assertEquals($library_path, $library->getLocalPath()); - $this->assertEquals(["$library_path/test_php_file_library.php"], $library->getPhpFiles()); - } - - /** - * Tests that the external library manager properly loads PHP files. - * - * @see \Drupal\libraries\ExternalLibrary\ExternalLibraryManager - * @see \Drupal\libraries\ExternalLibrary\ExternalLibraryTrait - * @see \Drupal\libraries\ExternalLibrary\PhpFile\PhpRequireLoader - */ - public function testFileLoading() { - $function_name = '_libraries_test_php_function'; - if (function_exists($function_name)) { - $this->markTestSkipped('Cannot test file inclusion if the file to be included has already been included prior.'); - return; - } - - $this->assertFalse(function_exists($function_name)); - $this->libraryManager->load('test_php_file_library'); - $this->assertTrue(function_exists($function_name)); - } - -} diff --git a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/TestLibraryFilesStream.php b/web/modules/libraries/tests/src/Kernel/ExternalLibrary/TestLibraryFilesStream.php deleted file mode 100644 index ec20647ead3187b8a3cee8a35cd5dfc9d101adb4..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Kernel/ExternalLibrary/TestLibraryFilesStream.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Kernel\ExternalLibrary; - -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\StreamWrapper\LocalStream; -use Drupal\Core\StringTranslation\StringTranslationTrait; -use Drupal\Core\StringTranslation\TranslationInterface; -use Drupal\libraries\StreamWrapper\LocalHiddenStreamTrait; -use Drupal\libraries\StreamWrapper\PrivateStreamTrait; - -/** - * Provides a stream wrapper for accessing test library files. - */ -class TestLibraryFilesStream extends LocalStream { - - use LocalHiddenStreamTrait; - use PrivateStreamTrait; - use StringTranslationTrait; - - /** - * The module handler. - * - * @var \Drupal\Core\Extension\ModuleHandlerInterface - */ - protected $moduleHandler; - - /** - * The test directory. - * - * @var string - */ - protected $directory; - - /** - * Constructs a stream wrapper for test library files. - * - * Dependency injection is generally not possible to implement for stream - * wrappers, because stream wrappers are initialized before the container is - * booted, but this stream wrapper is only registered explicitly from tests - * so it is possible here. - * - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler. - * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation - * The string translation handler. - * @param string $directory - * The directory within the Libraries API's tests directory that is to be - * searched for test library files. - */ - public function __construct(ModuleHandlerInterface $module_handler, TranslationInterface $string_translation, $directory) { - $this->moduleHandler = $module_handler; - $this->directory = (string) $directory; - - $this->setStringTranslation($string_translation); - } - - /** - * {@inheritdoc} - */ - public function getName() { - $this->t('Test library files'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - $this->t('Provides access to test library files.'); - } - - /** - * {@inheritdoc} - */ - public function getDirectoryPath() { - $module_path = $this->moduleHandler->getModule('libraries')->getPath(); - return $module_path . '/tests/' . $this->directory; - } - -} diff --git a/web/modules/libraries/tests/src/Kernel/LibraryTypeKernelTestBase.php b/web/modules/libraries/tests/src/Kernel/LibraryTypeKernelTestBase.php deleted file mode 100644 index 8185794763c2cb88df2c3479805987cf2a02e68e..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Kernel/LibraryTypeKernelTestBase.php +++ /dev/null @@ -1,171 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Kernel; - -use Drupal\Component\Plugin\Exception\PluginException; -use Drupal\KernelTests\KernelTestBase; -use Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException; -use Drupal\libraries\ExternalLibrary\Exception\LibraryTypeNotFoundException; -use Drupal\libraries\ExternalLibrary\LibraryInterface; -use Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface; - -/** - * Provides an improved version of the core kernel test base class. - */ -abstract class LibraryTypeKernelTestBase extends KernelTestBase { - - /** - * The external library manager. - * - * @var \Drupal\libraries\ExternalLibrary\LibraryManagerInterface - */ - protected $libraryManager; - - /** - * The library type factory. - * - * @var \Drupal\Component\Plugin\Factory\FactoryInterface - */ - protected $libraryTypeFactory; - - /** - * The absolute path to the Libraries API module. - * - * @var string - */ - protected $modulePath; - - /** - * {@inheritdoc} - */ - public static $modules = ['libraries', 'libraries_test']; - - /** - * Gets the ID of the library type that is being tested. - * - * @return string - */ - abstract protected function getLibraryTypeId(); - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ - $module_handler = $this->container->get('module_handler'); - $this->modulePath = $module_handler->getModule('libraries')->getPath(); - - $this->installConfig('libraries'); - // Disable remote definition fetching and set the local definitions path to - // the module directory. - /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */ - $config_factory = $this->container->get('config.factory'); - $config_factory->getEditable('libraries.settings') - ->set('definition.local.path', "{$this->modulePath}/tests/library_definitions") - ->set('definition.remote.enable', FALSE) - ->save(); - - // LibrariesConfigSubscriber::onConfigSave() invalidates the container so - // that it is rebuilt on the next request. We need the container rebuilt - // immediately, however. - /** @var \Drupal\Core\DrupalKernelInterface $kernel */ - $kernel = $this->container->get('kernel'); - $this->container = $kernel->rebuildContainer(); - - $this->libraryManager = $this->container->get('libraries.manager'); - $this->libraryTypeFactory = $this->container->get('plugin.manager.libraries.library_type'); - } - - /** - * Tests that the library type can be instantiated. - */ - public function testLibraryType() { - $type_id = $this->getLibraryTypeId(); - try { - $this->libraryTypeFactory->createInstance($type_id); - $this->assertTrue(TRUE, "Library type '$type_id' can be instantiated."); - } - catch (PluginException $exception) { - $this->fail("Library type '$type_id' cannot be instantiated."); - } - } - - /** - * Tests that the test library can be instantiated. - */ - public function testLibrary() { - $type_id = $this->getLibraryTypeId(); - $id = $this->getLibraryId(); - try { - $library = $this->libraryManager->getLibrary($id); - $this->assertTrue(TRUE, "Test $type_id library can be instantiated."); - $this->assertInstanceOf($this->getLibraryType()->getLibraryClass(), $library); - $this->assertEquals($this->getLibraryId(), $library->getId()); - - } - catch (LibraryDefinitionNotFoundException $exception) { - $this->fail("Missing library definition for test $type_id library."); - } - catch (LibraryTypeNotFoundException $exception) { - $this->fail("Missing library type declaration for test $type_id library."); - } - } - - /** - * Returns the library type that is being tested. - * - * @return \Drupal\libraries\ExternalLibrary\Type\LibraryTypeInterface - * The test library type. - */ - protected function getLibraryType() { - try { - $library_type = $this->libraryTypeFactory->createInstance($this->getLibraryTypeId()); - } - catch (PluginException $exception) { - $library_type = $this->prophesize(LibraryTypeInterface::class)->reveal(); - } - finally { - return $library_type; - } - } - - /** - * Retuns the library ID of the library used in the test. - * - * Defaults to 'test_[library_type]_library', where [library_type] is the - * ID of the library type being tested. - * - * @return string - */ - protected function getLibraryId() { - $type_id = $this->getLibraryTypeId(); - return "test_{$type_id}_library"; - } - - /** - * Returns the test library for this library type. - * - * @return \Drupal\libraries\ExternalLibrary\LibraryInterface - * The test library. - */ - protected function getLibrary() { - try { - $library = $this->libraryManager->getLibrary($this->getLibraryId()); - } - catch (LibraryDefinitionNotFoundException $exception) { - $library = $this->prophesize(LibraryInterface::class)->reveal(); - } - catch (LibraryTypeNotFoundException $exception) { - $library = $this->prophesize(LibraryInterface::class)->reveal(); - } - catch (PluginException $exception) { - $library = $this->prophesize(LibraryInterface::class)->reveal(); - } - finally { - return $library; - } - } - -} diff --git a/web/modules/libraries/tests/src/Unit/Plugin/libraries/VersionDetector/LinePatternDetectorTest.php b/web/modules/libraries/tests/src/Unit/Plugin/libraries/VersionDetector/LinePatternDetectorTest.php deleted file mode 100644 index 5e4e34b93148f7b195e3bae014ac18db940870c5..0000000000000000000000000000000000000000 --- a/web/modules/libraries/tests/src/Unit/Plugin/libraries/VersionDetector/LinePatternDetectorTest.php +++ /dev/null @@ -1,197 +0,0 @@ -<?php - -namespace Drupal\Tests\libraries\Unit\Plugin\libraries\VersionDetector; - -use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface; -use Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface; -use Drupal\libraries\Plugin\libraries\VersionDetector\LinePatternDetector; -use Drupal\Tests\UnitTestCase; -use org\bovigo\vfs\vfsStream; - -/** - * Tests the line pattern version detector. - * - * @group libraries - * - * @coversDefaultClass \Drupal\libraries\Plugin\libraries\VersionDetector\LinePatternDetector - */ -class LinePatternDetectorTest extends UnitTestCase { - - protected $libraryId = 'test_library'; - - /** - * Tests that version detection fails for a non-local library. - * - * @expectedException \Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException - * - * @covers ::detectVersion - */ - public function testDetectVersionNonLocal() { - $library = $this->prophesize(VersionedLibraryInterface::class); - $detector = $this->setupDetector(); - $detector->detectVersion($library->reveal()); - } - - /** - * Tests that version detection fails for a missing file. - * - * @expectedException \Drupal\libraries\ExternalLibrary\Exception\UnknownLibraryVersionException - * - * @covers ::detectVersion - */ - public function testDetectVersionMissingFile() { - $library = $this->setupLibrary(); - - $detector = $this->setupDetector(['file' => 'CHANGELOG.txt']); - $detector->detectVersion($library->reveal()); - } - - /** - * Tests that version detection fails without a version in the file. - * - * @dataProvider providerTestDetectVersionNoVersion - * - * @covers ::detectVersion - */ - public function testDetectVersionNoVersion($configuration, $file_contents) { - $library = $this->setupLibrary(); - - $detector = $this->setupDetector($configuration); - $this->setupFile($configuration['file'], $file_contents); - - $library->setVersion()->shouldNotBeCalled(); - $detector->detectVersion($library->reveal()); - } - - /** - * @return array - */ - public function providerTestDetectVersionNoVersion() { - $test_cases = []; - - $configuration = [ - 'file' => 'CHANGELOG.txt', - 'pattern' => '/@version (\d+\.\d+\.\d+)/' - ]; - - $test_cases['empty_file'] = [$configuration, '']; - - $test_cases['no_version'] = [$configuration, <<<EOF -This is a file with -multiple lines that does -not contain a version. -EOF - ]; - - $configuration['lines'] = 3; - $test_cases['long_file'] = [$configuration, <<<EOF -This is a file that -contains the version after -the maximum number of lines -to test has been surpassed. - -@version 1.2.3 -EOF - ]; - - $configuration['columns'] = 10; - // @todo Document why this is necessary. - $configuration['lines'] = 2; - $test_cases['long_column'] = [$configuration, <<<EOF -This is a file that contains the version after -the maximum number of columns to test has been surpassed. @version 1.2.3 -EOF - ]; - - return $test_cases; - } - - /** - * Tests that version detection succeeds with a version in the file. - * - * @dataProvider providerTestDetectVersion - * - * @covers ::detectVersion - */ - public function testDetectVersion($configuration, $file_contents, $version) { - $library = $this->setupLibrary(); - - $detector = $this->setupDetector($configuration); - $this->setupFile($configuration['file'], $file_contents); - - $library->setVersion($version)->shouldBeCalled(); - $detector->detectVersion($library->reveal()); - } - - /** - * @return array - */ - public function providerTestDetectVersion() { - $test_cases = []; - - $configuration = [ - 'file' => 'CHANGELOG.txt', - 'pattern' => '/@version (\d+\.\d+\.\d+)/' - ]; - $version = '1.2.3'; - - $test_cases['version'] = [$configuration, <<<EOF -This a file with a version - -@version $version -EOF - , $version]; - - return $test_cases; - } - - /** - * Sets up the library prophecy and returns it. - * - * @return \Prophecy\Prophecy\ObjectProphecy - */ - protected function setupLibrary() { - $library = $this->prophesize(VersionedLibraryInterface::class); - $library->willImplement(LocalLibraryInterface::class); - $library->getId()->willReturn($this->libraryId); - $library->getLocalPath()->willReturn('libraries/' . $this->libraryId); - return $library; - } - - /** - * Sets up the version detector for testing and returns it. - * - * @param array $configuration - * The plugin configuration to set the version detector up with. - * - * @return \Drupal\libraries\Plugin\libraries\VersionDetector\LinePatternDetector - * The line pattern version detector to test. - */ - protected function setupDetector(array $configuration = []) { - $app_root = 'root'; - vfsStream::setup($app_root); - - $plugin_id = 'line_pattern'; - $plugin_definition = [ - 'id' => $plugin_id, - 'class' => LinePatternDetector::class, - 'provider' => 'libraries', - ]; - return new LinePatternDetector($configuration, $plugin_id, $plugin_definition, 'vfs://' . $app_root); - } - - /** - * @param $file - * @param $file_contents - */ - protected function setupFile($file, $file_contents) { - vfsStream::create([ - 'libraries' => [ - $this->libraryId => [ - $file => $file_contents, - ], - ], - ]); - } - -}