diff --git a/profiles/wcm_base/build-wcm_base-dev.make b/profiles/wcm_base/build-wcm_base-dev.make index 9a4fa7c891620ecf85a2dcd32861e006800c4acd..fe5521e43e9d2950289084b923bdd5dab9a6e8b9 100644 --- a/profiles/wcm_base/build-wcm_base-dev.make +++ b/profiles/wcm_base/build-wcm_base-dev.make @@ -40,6 +40,7 @@ projects[ocio_user_directory][options][working-copy] = TRUE projects[ocio_uuid_settings][options][working-copy] = TRUE projects[ocio_workbench][options][working-copy] = TRUE projects[ocio_wysiwyg][options][working-copy] = TRUE +projects[wcm_tile_panes][options][working-copy] = TRUE ;themes projects[ocio_omega_base][options][working-copy] = TRUE diff --git a/profiles/wcm_base/libraries/jquery.isotope/README.mdown b/profiles/wcm_base/libraries/jquery.isotope/README.mdown index e406703d74189bd6919c04962dee6bdd762b8a43..2b0385c5848e3908d3e9626e66a958259107b32d 100644 --- a/profiles/wcm_base/libraries/jquery.isotope/README.mdown +++ b/profiles/wcm_base/libraries/jquery.isotope/README.mdown @@ -41,40 +41,41 @@ If you are creating an open source application under a license compatible with t ## Initialize -### In JavaScript +With jQuery ``` js -// jQuery -$('#container').isotope({ +$('.grid').isotope({ // options... - itemSelector: '.item', + itemSelector: '.grid-item', masonry: { columnWidth: 200 } }); ``` +With vanilla JavaScript + ``` js // vanilla JS -var container = document.querySelector('#container'); -var iso = new Isotope( container, { +var grid = document.querySelector('.grid'); +var iso = new Isotope( grid, { // options... - itemSelector: '.item', + itemSelector: '.grid-item', masonry: { columnWidth: 200 } }); ``` -### In HTML +With HTML Add a class of `js-isotope` to your element. Options can be set in JSON in `data-isotope-options`. ``` html -<div id="container" class="js-isotope" - data-isotope-options='{ "itemSelector": ".item", "masonry": { "columnWidth": 200 } }'> - <div class="item"></div> - <div class="item"></div> +<div class="grid js-isotope" + data-isotope-options='{ "itemSelector": ".grid-item", "masonry": { "columnWidth": 200 } }'> + <div class="grid-item"></div> + <div class="grid-item"></div> ... </div> ``` diff --git a/profiles/wcm_base/libraries/jquery.isotope/sandbox/bottom-up.html b/profiles/wcm_base/libraries/jquery.isotope/sandbox/bottom-up.html index 9fde2ffd6e9775b614333036b9e15599a2af28f5..b03ce8ac540cdff01a2fff9213fe606423f5303a 100644 --- a/profiles/wcm_base/libraries/jquery.isotope/sandbox/bottom-up.html +++ b/profiles/wcm_base/libraries/jquery.isotope/sandbox/bottom-up.html @@ -78,7 +78,6 @@ <div class="item"></div> </div> -<script src="../bower_components/classie/classie.js"></script> <script src="../bower_components/eventEmitter/EventEmitter.js"></script> <script src="../bower_components/eventEmitter/EventEmitter.min.js"></script> <script src="../bower_components/eventie/eventie.js"></script> @@ -90,26 +89,35 @@ <script src="../bower_components/fizzy-ui-utils/utils.js"></script> <script src="../bower_components/outlayer/item.js"></script> <script src="../bower_components/outlayer/outlayer.js"></script> +<script src="../bower_components/masonry/masonry.js"></script> -<script src="../masonry.js"></script> +<script src="../js/item.js"></script> +<script src="../js/layout-mode.js"></script> +<script src="../js/isotope.js"></script> +<script src="../js/layout-modes/masonry.js"></script> +<script src="../js/layout-modes/fit-rows.js"></script> <script> docReady( function() { ( function() { var container = document.querySelector('#basic'); - var msnry = new Masonry( container, { + var iso = new Isotope( container, { isOriginTop: false, - columnWidth: 60 + masonry: { + columnWidth: 60 + } }); })(); ( function() { var container = document.querySelector('#stamped'); - var msnry = new Masonry( container, { + var iso = new Isotope( container, { itemSelector: '.item', isOriginTop: false, - columnWidth: 60, - gutter: 10, + masonry: { + columnWidth: 60, + gutter: 10, + }, stamp: '.stamp' }); })(); diff --git a/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters-inclusive.html b/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters-inclusive.html index 7e42a5a521a73eba00f9ac929799140b5ebfdbf9..8bf55ede245f92efe7b9fd305e1b0905e6e394c3 100644 --- a/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters-inclusive.html +++ b/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters-inclusive.html @@ -196,7 +196,8 @@ </div> -<script src="../bower_components/jquery/jquery.js"></script> +<script src="../bower_components/jquery/dist/jquery.js"></script> + <script src="../bower_components/eventEmitter/EventEmitter.js"></script> <script src="../bower_components/eventie/eventie.js"></script> <script src="../bower_components/doc-ready/doc-ready.js"></script> diff --git a/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters.html b/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters.html index 9747292be7f9a20a57e397a0f8298763dcb750ea..7b77210a82aa639e0fd716b6330e52623a2664a1 100644 --- a/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters.html +++ b/profiles/wcm_base/libraries/jquery.isotope/sandbox/combination-filters.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> - <title>masonry</title> + <title>combination filters</title> <link rel="stylesheet" href="sandbox.css" /> <style> @@ -196,7 +196,8 @@ </div> -<script src="../bower_components/jquery/jquery.js"></script> +<script src="../bower_components/jquery/dist/jquery.js"></script> + <script src="../bower_components/eventEmitter/EventEmitter.js"></script> <script src="../bower_components/eventie/eventie.js"></script> <script src="../bower_components/doc-ready/doc-ready.js"></script> @@ -204,6 +205,7 @@ <script src="../bower_components/get-size/get-size.js"></script> <script src="../bower_components/jquery-bridget/jquery.bridget.js"></script> <script src="../bower_components/matches-selector/matches-selector.js"></script> +<script src="../bower_components/fizzy-ui-utils/utils.js"></script> <script src="../bower_components/outlayer/item.js"></script> <script src="../bower_components/outlayer/outlayer.js"></script> <script src="../bower_components/masonry/masonry.js"></script> diff --git a/profiles/wcm_base/libraries/jquery.isotope/sandbox/sorting.html b/profiles/wcm_base/libraries/jquery.isotope/sandbox/sorting.html index ac047cb60f9ea414c7d924e62613fb2b5498330f..af7490e7df08cace1d3b422074b6d3944aa5ee24 100644 --- a/profiles/wcm_base/libraries/jquery.isotope/sandbox/sorting.html +++ b/profiles/wcm_base/libraries/jquery.isotope/sandbox/sorting.html @@ -143,9 +143,9 @@ <script src="../bower_components/outlayer/item.js"></script> <script src="../bower_components/outlayer/outlayer.js"></script> +<script src="../js/layout-mode.js"></script> <script src="../js/item.js"></script> <script src="../js/isotope.js"></script> -<script src="../js/layout-mode.js"></script> <script src="../js/layout-modes/fit-rows.js"></script> <script> diff --git a/profiles/wcm_base/libraries/jquery.isotope/sandbox/transition-bug.html b/profiles/wcm_base/libraries/jquery.isotope/sandbox/transition-bug.html index 1a78a5c735a1c59fc22f9e98b7d31c8230f8a237..d8eb37a36663880d6e088e42387682c1aff29d8e 100644 --- a/profiles/wcm_base/libraries/jquery.isotope/sandbox/transition-bug.html +++ b/profiles/wcm_base/libraries/jquery.isotope/sandbox/transition-bug.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> - <title>filter sort</title> + <title>transition bug</title> <link rel="stylesheet" href="sandbox.css" /> <style> @@ -12,7 +12,7 @@ </head> <body> - <h1>filter sort</h1> + <h1>transition bug</h1> <div> <button id="bug-me">Bug me</button> @@ -50,7 +50,6 @@ <script src="../js/layout-mode.js"></script> <script src="../js/isotope.js"></script> <script src="../js/layout-modes/fit-rows.js"></script> -<script src="../js/layout-modes/cells-by-row.js"></script> <script src="../js/layout-modes/vertical.js"></script> <script> diff --git a/profiles/wcm_base/modules/contrib/date_popup_authored/date_popup_authored.info b/profiles/wcm_base/modules/contrib/date_popup_authored/date_popup_authored.info index bd506d7fd3b823ef3007eadd2dfee8b48dcc6fd5..42aecace615c162daee537ccf0b265b90a2133f6 100644 --- a/profiles/wcm_base/modules/contrib/date_popup_authored/date_popup_authored.info +++ b/profiles/wcm_base/modules/contrib/date_popup_authored/date_popup_authored.info @@ -3,4 +3,11 @@ description = "Provides a datepicker for the 'Authored on' field on node forms." core = 7.x files[] = date_popup_authored.test package = Date/Time -dependencies[] = date_popup \ No newline at end of file +dependencies[] = date_popup + +; Information added by drush on 2015-06-10 +version = "7.x-1.1+2-dev" +core = "7.x" +project = "date_popup_authored" +datestamp = "1433897628" + diff --git a/profiles/wcm_base/modules/contrib/file_entity/file_entity.info b/profiles/wcm_base/modules/contrib/file_entity/file_entity.info index 62f966f000faa309ae12ff5a2e6ec3c8c07d0ff7..de9ddaf860063440d9637603d3ec19509697e63d 100644 --- a/profiles/wcm_base/modules/contrib/file_entity/file_entity.info +++ b/profiles/wcm_base/modules/contrib/file_entity/file_entity.info @@ -24,3 +24,11 @@ configure = admin/config/media/file-settings ; We have to add a fake version so Git checkouts do not fail Media dependencies version = 7.x-2.x-dev + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+29-dev" +core = "7.x" +project = "file_entity" +datestamp = "1433897625" + diff --git a/profiles/wcm_base/modules/contrib/file_entity/tests/file_entity_test.info b/profiles/wcm_base/modules/contrib/file_entity/tests/file_entity_test.info index 35eaf29c9a7851fc79c19d25ff9cd78cd7594af8..9d85695d8aa0335ddf66ee48d83319f4ef075f3b 100644 --- a/profiles/wcm_base/modules/contrib/file_entity/tests/file_entity_test.info +++ b/profiles/wcm_base/modules/contrib/file_entity/tests/file_entity_test.info @@ -4,3 +4,11 @@ package = Testing core = 7.x dependencies[] = file_entity hidden = TRUE + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+29-dev" +core = "7.x" +project = "file_entity" +datestamp = "1433897625" + diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/LICENSE.txt b/profiles/wcm_base/modules/contrib/fpp_bundles/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/LICENSE.txt @@ -0,0 +1,339 @@ + 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/profiles/wcm_base/modules/contrib/fpp_bundles/README.md b/profiles/wcm_base/modules/contrib/fpp_bundles/README.md new file mode 100644 index 0000000000000000000000000000000000000000..58d82b8323d996bf3039a375488dc774497cc8ad --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/README.md @@ -0,0 +1,126 @@ +# FPP Bundles (Fieldable Panels Panes UI) + +**Fieldable Panel Panes Bundles (Fieldable Panel Panes UI)** - module that helps to create bundles of the [Fieldable Panels Panes](https://www.drupal.org/project/fieldable_panels_panes) entity. The project aims to simplify developers life by way of refraining of writing the code for panels creation. + +The module has an integration with [Features](https://www.drupal.org/project/features) and allows to export an existing bundles with automatically adding their dependencies (fields, field groups, etc). + +## Installation + +**Drush:** +``` +drush en fpp_bundles -y +``` + +**Manual:** +- Download the release from [drupal.org](https://www.drupal.org/project/fpp_bundles); +- Put the unpacked folder into your Drupal installation "modules" directory; +- Go to `/admin/modules` and enable the module. + +## Documentation + +### API hooks + +See all hooks and their description in [fpp_bundles.api.php](fpp_bundles.api.php). + +### Helper functions + +Programmatically creation of a bundle: + +```php +// If the value of "$status" variable will be TRUE, then bundle was +// created successfully. In another case, when machine name is +// already exist, the error message will be stored in the Dblog +// and the value will be FALSE. +$status = fpp_bundles_save(array( + // The "name" is required. + 'name' => 'Video', + // By default it set to "0", + 'level' => 1, + // By default it set to "1". + 'assets' => 0, + // By default it is empty. + 'category' => 'Media', +)); +``` + +Programmatically update the bundle: + +```php +// Change only one parameter of the bundle. +$status = fpp_bundles_save(array( + // The ID of created bundle. + 'bid' => 1, + // Change "assets" to "1". + 'assets' => 1, +)); +``` + +Programmatically remove the bundle: + +```php +// Remove the bundle by ID. If bundle with such ID does not exist, +// then error message will be stored in the Dblog and a value +// of "$status" variable will be FALSE. +$status = fpp_bundles_remove(1); +``` + +Append your own assets in `preprocess` hooks: + +```php +/** + * Implements hook_preprocess_HOOK(). + */ +function hook_preprocess_fieldable_panels_pane(&$variables) { + $entity = $variables['elements']['#element']; + + // The "assets" property provided by "FPP Bundles" module + // and allowed only for panels, created from UI. + if (isset($entity->assets)) { + $entity->assets['css'][] = 'path/to/your/own/file.css'; + } +} +``` + +### Best practices + +Creating the new bundle with frontend and backend parts. + +- Create the bundle from UI with name `Media`; + - Correct the machine name of bundle by adding prefix `fpp_` (after changes it should be `fpp_media`); + - If necessary, type the name of category and check/uncheck the box that allow you to see the bundle in general list; + - Do not uncheck the box that indicate that CSS & JS for panel will be included automatically if they are exists; + - Create a bundle and add necessary fields and field groups, configure the displays; +- Create the template, CSS and JS if needed; + - Put your template file in: `path/to/theme/templates/fieldable-panels-panes/fieldable-panels-pane--fpp-media.tpl.php`; + - Put your CSS file in: `path/to/theme/css/fieldable-panels-panes/fpp-media.css`; + - Put your JS file in: `path/to/theme/js/fieldable-panels-panes/fpp-media.js`; + - If needed, put the CSS or/and JS in `path/to/theme/[js/css]/fieldable-panels-panes/admin/fpp-media-admin.[js/css]`; +- Export the bundle via Features; +- Commit created feature and theming files using your VCS system. + +## Changelog + +**Version [1.0](https://github.com/BR0kEN-/fpp_bundles/tree/7.x-1.0)**, December 18, 2014: +- UI CRUD interface for bundles of Fieldable Panels Panes entity. +- Integration with Features. + +**Version [1.1](https://github.com/BR0kEN-/fpp_bundles/tree/7.x-1.1)**, December 23, 2014: +- Fixed an [issue](https://www.drupal.org/node/2397973) with Features integration. + +**Version [1.2](https://github.com/BR0kEN-/fpp_bundles/tree/7.x-1.2)**, December 24, 2014: +- Improved integration with Features. From now, all fields, groups and widgets will be added into the Feature automatically. + +**Version [1.3](https://github.com/BR0kEN-/fpp_bundles/tree/7.x-1.3)**, January 29, 2015: +- Added the API hooks which occurs after successful insert/update/delete operation. +- Added the functions for programmatically creation, validation and deletion the bundles. +- Added an option to automatically load CSS & JS for a panel. +- Added the help section at `/admin/help/fpp_bundles`. +- Improved SimpleTest. + +**Version [1.4](https://github.com/BR0kEN-/fpp_bundles/tree/7.x-1.4)**, February 11, 2015: +- Added the possibility to include CSS & JS for administrative users. +- Updated the documentation. + +## Authors + +- [Sergey Bondarenko (BR0kEN)](https://github.com/BR0kEN-) diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundle.inc b/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundle.inc new file mode 100644 index 0000000000000000000000000000000000000000..457fc3a1b914a442187762b403b2c2f328f4dfe2 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundle.inc @@ -0,0 +1,149 @@ +<?php +/** + * @file + * An object that describes single Fieldable Panels Pane Bundle. + */ + +/** + * Class FppBundle. + */ +class FppBundle { + /** + * The bundle ID. + * + * @var int + */ + private $bid = 0; + + /** + * The human name of bundle. + * + * @var string + */ + private $name = ''; + + /** + * Indicates that the panel should be placed in top level or not. + * + * @var bool + */ + private $level = FALSE; + + /** + * An unique bundle machine name. + * + * @var string + */ + private $machine = ''; + + /** + * Category where was placed the bundle. + * + * @var string + */ + private $category = ''; + + /** + * Indicates the state of automatically load the CSS & JS files for bundle. + * + * @var bool + */ + private $assets = TRUE; + + /** + * Property getter. + */ + public function getBundleId() { + return (int) $this->bid; + } + + /** + * Property getter. + */ + public function getHumanName() { + return $this->name; + } + + /** + * Property getter. + */ + public function isTopLevelPanel() { + return (bool) $this->level; + } + + /** + * Property getter. + */ + public function getMachineName() { + return $this->machine; + } + + /** + * Property getter. + */ + public function getCategoryName() { + return $this->category; + } + + /** + * Property getter. + */ + public function isAssetsLoadAutomatically() { + return (bool) $this->assets; + } + + /** + * Get object representation as an array. + * + * @return array + * Bundle fields, except the ID. + */ + public function getAllFieldsAsArray() { + $parameters = get_object_vars($this); + // Delete the ID from the property set, because + // it is an unique and plays no role. + unset($parameters['bid']); + + return $parameters; + } + + /** + * Method for export object parameters as an keyed array. + * + * @return array + * Representation of the object as an array. + */ + public function export() { + return array($this->machine => $this->getAllFieldsAsArray()); + } + + /** + * Create the bundle object from an array. + * + * @param array $bundle + * Representation of the bundle as array. + * + * @throws \FppBundlesException + * When not all necessary properties was set. + * + * @return $this + * Bundle object. + */ + public function import(array $bundle) { + $fields = get_object_vars($this); + $filled = 0; + + foreach (array_keys($fields) as $field) { + if (isset($bundle[$field])) { + $this->$field = $bundle[$field]; + $filled++; + } + } + + if (count($fields) != $filled) { + throw \FppBundlesException::set(t('The bundle cannot to be imported from an array because the number of items is not equal to the properties number.')); + } + + return $this; + } +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundlesDatabase.inc b/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundlesDatabase.inc new file mode 100644 index 0000000000000000000000000000000000000000..f94a0d888a885124a9ce38c427bd21f2da678541 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundlesDatabase.inc @@ -0,0 +1,521 @@ +<?php +/** + * @file + * Object for working with stored panels in DB. + */ + +/** + * Class FppBundlesDatabase. + */ +class FppBundlesDatabase { + const BUNDLE_CLASS_NAME = '\FppBundle'; + + /** + * An instance of object. + * + * @var \FppBundlesDatabase + */ + private static $instance; + + /** + * Database schema for Drupal "hook_schema" usage. + * + * @var array + */ + private $schema = array(); + + /** + * Table fields names, exclude indexes. + * + * @var array + */ + private $fields = array(); + + /** + * An array where key is name the index and value - field with index. + * + * @var array + */ + private $indexes = array( + 'primary' => '', + 'unique' => '', + ); + + /** + * An array with all bundles created from admin interface. + * + * @var array + */ + private $allBundles = array(); + + /** + * DB table name. + * + * @var string + */ + private $table = ''; + + /** + * Create instance to work with DB table. + * + * @param string $table_name + * The name of table in DB. + */ + private function __construct($table_name) { + $this->table = $table_name; + $not_null_varchar = array( + 'type' => 'varchar', + 'length' => 100, + 'not null' => TRUE, + ); + $not_null_int = array( + 'type' => 'int', + 'not null' => TRUE, + ); + + $indexes = array( + // Primary key - auto increment. + 'bid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'description' => 'Bundle ID', + ), + // Unique key - generated automatically. + 'machine' => $not_null_varchar + array( + 'description' => 'Machine name of the bundle', + ), + ); + + $fields = array( + // Input in UI. Required field on base of which + // will be generated a machine name of the bundle. + 'name' => $not_null_varchar + array( + 'description' => 'Human name of the bundle', + ), + // Checkbox in UI. Needed for the indicated where entity + // will be shown: in category or in general list. + 'level' => $not_null_int + array( + 'description' => 'Indicates that the panel is "top level" or placed into category.', + ), + // Input in UI. + 'category' => $not_null_varchar + array( + 'description' => 'Optional field for store bundles in categories.', + ), + 'assets' => $not_null_int + array( + 'default' => 1, + 'description' => 'Boolean. Indicates the state of automatically load the CSS & JS files.', + ), + ); + + $this->indexes = array_combine(array_keys($this->indexes), array_keys($indexes)); + $this->fields = array_keys($fields); + + // Create DB schema for the storage module data. + $this->schema = array( + $this->table => array( + 'fields' => $indexes + $fields, + 'primary key' => array($this->indexes['primary']), + 'unique keys' => array($this->indexes['unique'] => array($this->indexes['unique'])), + 'description' => 'Storage for Fieldable Panels Panes bundles', + ), + ); + } + + /** + * Property getter. + */ + public function getSchema() { + return $this->schema; + } + + /** + * Get the bundle by one of the indexes in table. + * + * @param string $index_name + * An index name. Must be "primary" or "unique". + * @param int|string $value + * An ID of the bundle. + * + * @return bool|\FppBundle + * False - if nothing was found or existing bundle object. + */ + public function getBundleByDbIndex($index_name, $value) { + if (!isset($this->indexes[$index_name])) { + return FALSE; + } + + return $this->bundleSelectQuery() + ->condition($this->indexes[$index_name], $value, '=') + ->execute() + ->fetchObject(self::BUNDLE_CLASS_NAME); + } + + /** + * Get all bundles from the DB. + * + * @param int $per_page + * Number of items per page. + * + * @return array + * An array where each item is an instance of the \FppBundle; + */ + public function getAllBundles($per_page = 0) { + if (!$this->allBundles) { + $query = $this->bundleSelectQuery(); + + if ($per_page && is_int($per_page)) { + /* @var \PagerDefault $query */ + $query = $query->extend('PagerDefault'); + $query->limit($per_page); + } + + $this->allBundles = $query->execute()->fetchAll( + \PDO::FETCH_CLASS, self::BUNDLE_CLASS_NAME + ); + + /* @var \FppBundle $bundle */ + foreach ($this->allBundles as $i => $bundle) { + $this->allBundles[$bundle->getMachineName()] = $bundle; + unset($this->allBundles[$i]); + } + } + + return $this->allBundles; + } + + /** + * Get the bundle by machine name. + * + * @param string $machine_name + * Machine readable name of the bundle. + * + * @return \FppBundle|bool + * An instance ob the bundle object or false if it does not exist. + */ + public function getBundleByMachineName($machine_name) { + $bundles = $this->getAllBundles(); + + return isset($bundles[$machine_name]) ? $bundles[$machine_name] : FALSE; + } + + /** + * Get machine names of all bundles. + * + * @return array + * An array where each item - an unique machine name of the bundle. + */ + public function getAllBundlesMachineNames() { + return array_keys($this->getAllBundles()); + } + + /** + * Get all field names from DB table where bundles was stored. + * + * @return array + * An array with fields machine names. + */ + public function getAllSchemaFields() { + return array_values($this->fields + $this->indexes); + } + + /** + * Select FPP bundles from DB. + * + * @return \SelectQuery + * Database object for select query. + */ + public function bundleSelectQuery() { + return db_select($this->table)->fields($this->table, $this->getAllSchemaFields()); + } + + /** + * Save values for the bundle and create it. + * + * @param array $bundle + * Bundle data. + * + * @return int + * Last insert ID. + */ + public function insertBundle(array $bundle) { + return $this->performAction(FPP_BUNDLES_CREATE_BUNDLE_ACTION, $bundle); + } + + /** + * Update existing bundle. + * + * @param array $bundle + * Bundle object. + */ + public function updateBundle(array $bundle) { + $this->performAction(FPP_BUNDLES_UPDATE_BUNDLE_ACTION, $bundle); + } + + /** + * Remove existing bundle. + * + * @param array $bundle + * Bundle object. + */ + public function deleteBundle(array $bundle) { + $this->performAction(FPP_BUNDLES_REMOVE_BUNDLE_ACTION, $bundle); + } + + /** + * Perform a database action over the bundle. + * + * @param string $action + * An action name. Can be a value the one of next constants: + * FPP_BUNDLES_CREATE_BUNDLE_ACTION - insert a new entry in DB; + * FPP_BUNDLES_UPDATE_BUNDLE_ACTION - update an existing entry. + * FPP_BUNDLES_REMOVE_BUNDLE_ACTION - delete an existing entry. + * @param array $bundle + * Bundle data. + * + * @see db_insert() + * @see db_update() + * @see db_delete() + * + * @throws \Exception + * When query cannot be performed or an action is incorrect. + * + * @return \DatabaseStatementInterface|int + * An interface on "update" and "delete" actions + * or ID of a new entry on "insert" action. + */ + public function performAction($action, array $bundle) { + $fpp_bundle = FALSE; + $func = "db_$action"; + + if (!function_exists($func)) { + \FppBundlesException::set(t('Action "!action" that was performed over the bundle is incorrect!', array( + '!action' => $action, + ))); + + return 0; + } + + $query = call_user_func($func, $this->table); + $index = $this->indexes['primary']; + $bundle_id = 0; + + if (isset($bundle[$index])) { + $bundle_id = $bundle[$index]; + unset($bundle[$index]); + } + + if ($query instanceof \DeleteQuery) { + $fpp_bundle = $this->getBundleByDbIndex('primary', $bundle_id); + } + else { + /* @var \UpdateQuery|\InsertQuery $query */ + $query->fields($bundle); + } + + if ($bundle_id && !($query instanceof \InsertQuery)) { + /* @var \UpdateQuery|\DeleteQuery $query */ + $query->condition($index, $bundle_id, '='); + } + + $query = $query->execute(); + + if (!$fpp_bundle) { + // The "$bundle_id" will be more than zero for "delete" and "update" + // actions, and for "insert" the ID will be returned by "execute" method. + $bundle['bid'] = $bundle_id ?: $query; + $fpp_bundle = new \FppBundle(); + $fpp_bundle = $fpp_bundle->import($bundle); + } + + module_invoke_all(_fpp_bundles_prefix("bundle_$action"), $fpp_bundle); + + return $query; + } + + /** + * Create an object representation of the bundle. + * + * @param array $data + * Keyed array with information about bundle. + * Required keys are: "name", "level", "machine", "category". + * + * @throws \FppBundlesException + * If property is absent but should be. + * + * @return array + * Bundle information. + */ + public function prepareBundleData(array $data) { + $save = array(); + + foreach ($this->getAllSchemaFields() as $field) { + if (isset($data[$field])) { + $save[$field] = $data[$field]; + } + elseif ($field !== $this->indexes['primary']) { + throw \FppBundlesException::set(t('The property "!property" is not specified or does not exist, but it is necessary to create the bundle.', array( + '!property' => $field, + ))); + } + } + + return $save; + } + + /** + * Validate the bundle before saving into DB. + * + * @param array $values + * The values for creating/updating the bundle. + * + * @throws \FppBundlesException + * When error is occured. + * + * @return array + * An associative array with two items: "action" and "values". + */ + public function validateBundle(array $values) { + $action = FALSE; + $error = FALSE; + + if (empty($values['name'])) { + $error = t('The name of bundle - required parameter.'); + } + else { + // Validate the text fields. + foreach (array('name', 'category') as $field_name) { + if (isset($values[$field_name])) { + $values[$field_name] = trim(filter_xss($values[$field_name])); + + if (empty($values[$field_name])) { + $error = t('The !field of bundle should not be empty and can contain only latin letters.', array( + '!field' => $field_name, + )); + } + elseif (!strlen(preg_replace('/\d+|\s+/', '', $values[$field_name]))) { + $error = t('The !field of bundle should not contain only numbers.', array( + '!field' => $field_name, + )); + } + elseif (strlen($values[$field_name]) < FPP_BUNDLES_MINIMUM_CHARS_FOR_NAME) { + $error = t('The !field of bundle should contain more than !number symbols.', array( + '!number' => FPP_BUNDLES_MINIMUM_CHARS_FOR_NAME, + '!field' => $field_name, + )); + } + } + } + + // If "bid" does not exist, then we try to create a new bundle. + if (empty($values[$this->indexes['primary']])) { + $values[$this->indexes['unique']] = _fpp_bundles_create_machine_name($values['name']); + + if ($this->getBundleByDbIndex('unique', $values[$this->indexes['unique']])) { + $error = t('The bundle with "!machine" machine name is already exist.', array( + '!machine' => $values[$this->indexes['unique']], + )); + } + else { + $action = FPP_BUNDLES_CREATE_BUNDLE_ACTION; + + $empty = new \FppBundle(); + $values += $empty->getAllFieldsAsArray(); + } + } + else { + $existing = $this->getBundleByDbIndex('primary', $values[$this->indexes['primary']]); + + if ($existing) { + $action = FPP_BUNDLES_UPDATE_BUNDLE_ACTION; + $values[$this->indexes['unique']] = $existing->getMachineName(); + $values += $existing->getAllFieldsAsArray(); + } + else { + $error = t('The bundle with ID "!id" was not created and cannot to be updated.', array( + '!id' => $values[$this->indexes['primary']], + )); + } + } + + foreach (array('level', 'assets') as $field_name) { + if (isset($values[$field_name])) { + $values[$field_name] = (int) $values[$field_name]; + } + } + } + + if ($error) { + throw \FppBundlesException::set($error); + } + + return array( + 'values' => $this->prepareBundleData($values), + 'action' => $action, + ); + } + + /** + * Create or update a bundle programmatically. + * + * @param array $bundle + * The values for creating or updating the bundle. If "bid" was not + * specified, then bundle will be created. To read about array keys, + * see the properties of \FppBundle object. + * + * @see \FppBundle + * + * @return bool + * TRUE - if bundle was created/updated, FALSE and watchdog message if not. + */ + public function saveBundle(array $bundle) { + try { + $bundle = $this->validateBundle($bundle); + } + catch (\FppBundlesException $e) { + return FALSE; + } + + $this->performAction($bundle['action'], $bundle['values']); + + return TRUE; + } + + /** + * Remove bundle programmatically. + * + * @param int $bid + * The bundle ID. + * + * @return bool + * TRUE - if a bundle was removed, FALSE and watchdog message if not. + */ + public function removeBundle($bid) { + if ($this->getBundleByDbIndex('primary', $bid)) { + $this->deleteBundle(array($this->indexes['primary'] => $bid)); + + return TRUE; + } + + \FppBundlesException::set(t('Trying to remove the bundle with ID "!id" that does not exist.', array( + '!id' => $bid, + ))); + + return FALSE; + } + + /** + * Create/get an instance of an object. + * + * @see self::__construct() + * + * @return \FppBundlesDatabase + * An object instance. + */ + public static function instance($table_name) { + if (!self::$instance) { + self::$instance = new self($table_name); + } + + return self::$instance; + } +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundlesException.inc b/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundlesException.inc new file mode 100644 index 0000000000000000000000000000000000000000..c180e9400472dda491c20df7678c92e700951e5a --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/classes/FppBundlesException.inc @@ -0,0 +1,27 @@ +<?php +/** + * @file + * FPP Bundles Exception. + */ + +/** + * Class FppBundlesException. + */ +class FppBundlesException extends \Exception { + /** + * Throw Drupal error and store it to "Recent log messages". + * + * @param string $message + * Exception message. + * + * @return self + * Exception, which can be thrown. + */ + public static function set($message) { + $exception = new self($message); + + watchdog_exception('FPP Bundles', $exception, $message); + + return $exception; + } +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.api.php b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.api.php new file mode 100644 index 0000000000000000000000000000000000000000..b61d38d80111d47a9598ad39812e9b1a526b3944 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.api.php @@ -0,0 +1,37 @@ +<?php +/** + * @file + * FPP Bundles (Fieldable Panels Panes UI) API. + */ + +/** + * Called after successful inserting a bundle into DB. + * + * This hook should not return anything, because the data will nowhere used. + * + * @param \FppBundle $bundle + * Bundle object. + */ +function hook_fpp_bundles_bundle_insert(\FppBundle $bundle) { + +} + +/** + * Called after successful updating a bundle in DB. + * + * @param \FppBundle $bundle + * Bundle object. + */ +function hook_fpp_bundles_bundle_update(\FppBundle $bundle) { + +} + +/** + * Called after successful deleting a bundle from DB. + * + * @param \FppBundle $bundle + * Bundle object. + */ +function hook_fpp_bundles_bundle_delete(\FppBundle $bundle) { + +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.info b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.info new file mode 100644 index 0000000000000000000000000000000000000000..f5f1330d0e3c4d7f03f6ebe6c9c744f0f3a9eb13 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.info @@ -0,0 +1,29 @@ +name = FPP Bundles (Fieldable Panels Panes UI) +description = Create your own "Fieldable Panels Pane" entity from admin interface, add fields on it and export it all with "Features". +package = Panels +core = 7.x + +testing_api = 2.x + +files[] = fpp_bundles.test +files[] = classes/FppBundle.inc +files[] = classes/FppBundlesDatabase.inc +files[] = classes/FppBundlesException.inc + +configure = admin/structure/fieldable-panels-panes + +dependencies[] = fieldable_panels_panes + +; Information added by Drupal.org packaging script on 2014-12-24 +version = "7.x-1.2" +core = "7.x" +project = "fpp_bundles" +datestamp = "1419451981" + + +; Information added by Drupal.org packaging script on 2015-02-11 +version = "7.x-1.4" +core = "7.x" +project = "fpp_bundles" +datestamp = "1423654984" + diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.install b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.install new file mode 100644 index 0000000000000000000000000000000000000000..0ae89c945d32fb8a5261feb9198d608ae1da2617 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.install @@ -0,0 +1,27 @@ +<?php +/** + * @file + * Installation file for the FPP Bundles module. + */ + +if (!defined('FPP_BUNDLES_MACHINE_NAME')) { + define('FPP_BUNDLES_MACHINE_NAME', 'fpp_bundles'); +} + +/** + * Implements hook_schema(). + */ +function fpp_bundles_schema() { + module_load_include('module', FPP_BUNDLES_MACHINE_NAME); + + return fpp_bundles_db()->getSchema(); +} + +/** + * Implements hook_update_N(). + */ +function fpp_bundles_update_7100() { + $schema = fpp_bundles_schema(); + + db_add_field(FPP_BUNDLES_MACHINE_NAME, 'assets', $schema[FPP_BUNDLES_MACHINE_NAME]['fields']['assets']); +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.module b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.module new file mode 100644 index 0000000000000000000000000000000000000000..7a4bdfc742d46df95d8e257ef454953fd56e803a --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.module @@ -0,0 +1,583 @@ +<?php +/** + * @file + * Module for creating panels from admin interface. + * + * @author Sergey Bondarenko <broken@propeople.com.ua> + */ + +/** + * Machine name of the module. + */ +define('FPP_BUNDLES_MACHINE_NAME', 'fpp_bundles'); +/** + * An entity machine name. + */ +define('FPP_BUNDLES_ENTITY_TYPE', 'fieldable_panels_pane'); +/** + * An entity access permissions. + */ +define('FPP_BUNDLES_ENTITY_ACCESS', 'administer fieldable panels panes'); +/** + * An entity admin page. + */ +define('FPP_BUNDLES_ADMIN_URL', 'admin/structure/fieldable-panels-panes'); +/** + * Minimum characters number for name of the bundle. + */ +define('FPP_BUNDLES_MINIMUM_CHARS_FOR_NAME', 3); +/** + * Name of an action for create new bundle. Should not be changed. + */ +define('FPP_BUNDLES_CREATE_BUNDLE_ACTION', 'insert'); +/** + * Name of an action for update an existing bundle. Should not be changed. + */ +define('FPP_BUNDLES_UPDATE_BUNDLE_ACTION', 'update'); +/** + * Name of an action for remove an existing bundle. Should not be changed. + */ +define('FPP_BUNDLES_REMOVE_BUNDLE_ACTION', 'delete'); + +/** + * Implements hook_fpp_bundles_bundle_update(). + */ +function fpp_bundles_fpp_bundles_bundle_insert(\FppBundle $bundle) { + $_SESSION['test']['insert'] = $bundle; +} +/** + * Implements hook_fpp_bundles_bundle_update(). + */ +function fpp_bundles_fpp_bundles_bundle_update(\FppBundle $bundle) { + $_SESSION['test']['update'] = $bundle; +} +/** + * Implements hook_fpp_bundles_bundle_update(). + */ +function fpp_bundles_fpp_bundles_bundle_delete(\FppBundle $bundle) { + $_SESSION['test']['delete'] = $bundle; +} + +/** + * Main controller of the module. + * + * @param string $option_name + * Option name, a value of which will be returned. + * + * @return array + * Module settings or an option value. + */ +function fpp_bundles($option_name = '') { + static $settings = array(); + + if (!$settings) { + foreach (array( + 'autocomplete category' => array( + 'type' => MENU_CALLBACK, + 'page callback' => TRUE, + 'page arguments' => array(5), + ), + FPP_BUNDLES_REMOVE_BUNDLE_ACTION => array( + 'title' => t('Remove the bundle'), + ), + FPP_BUNDLES_UPDATE_BUNDLE_ACTION => array( + 'title' => t('Update the bundle'), + ), + FPP_BUNDLES_CREATE_BUNDLE_ACTION => array( + 'type' => MENU_LOCAL_ACTION, + 'title' => t('Create the bundle'), + ), + ) as $human_name => $data) { + $relative_path = str_replace(' ', '/', $human_name); + // All menu routes of the module relative to the next URL: + // "admin/structure/fieldable-panels-panes/list/{module_route}". + // That's necessary to be a part of the FPP module and complement it. + $route_path = FPP_BUNDLES_ADMIN_URL . '/' . $relative_path; + // The suffix of the routing callback function by default is a + // "manage_bundle". Due to this, default callback function name + // is a "_fpp_bundles_manage_bundle". + $callback_suffix = 'manage_bundle'; + + // If we don't want to use the default route function, then we can + // override it, defining the "page callback". Suffix of the callback + // function will be generated automatically from relative route path. + if (isset($data['page callback'])) { + $callback_suffix = str_replace(' ', '_', $human_name); + unset($data['page callback']); + } + + $settings['menu_routes'][$route_path] = $data + array( + 'type' => MENU_VISIBLE_IN_BREADCRUMB, + 'file' => _fpp_bundles_include_file_path('admin'), + 'page callback' => _fpp_bundles_callback_prefix($callback_suffix), + 'page arguments' => array(3), + 'access arguments' => array(FPP_BUNDLES_ENTITY_ACCESS), + ); + + $settings['menu_paths'][$human_name] = $route_path; + + if (isset($data['title'])) { + $settings['action_titles'][$human_name] = $data['title']; + } + } + } + + return isset($settings[$option_name]) ? $settings[$option_name] : $settings; +} + +/** + * Get an object for working with DB. + * + * @return \FppBundlesDatabase + * An object instance. + */ +function fpp_bundles_db() { + return \FppBundlesDatabase::instance(FPP_BUNDLES_MACHINE_NAME); +} + +/** + * Create or update a bundle programmatically. + * + * @see \FppBundlesDatabase::saveBundle() + */ +function fpp_bundles_save(array $values) { + return fpp_bundles_db()->saveBundle($values); +} + +/** + * Remove bundle programmatically. + * + * @see \FppBundlesDatabase::removeBundle() + */ +function fpp_bundles_remove($bid) { + return fpp_bundles_db()->removeBundle($bid); +} + +/** + * Implements hook_help(). + */ +function fpp_bundles_help($path, $arg) { + $output = ''; + + switch ($path) { + case 'admin/help#' . FPP_BUNDLES_MACHINE_NAME: + return theme(_fpp_bundles_prefix('_admin_help'), func_get_args()); + } + + return $output; +} + +/** + * Implements hook_theme(). + */ +function fpp_bundles_theme($existing, $type, $theme, $path) { + $suggestions = array(); + + foreach (array('_admin_help') as $suggestion) { + $suggestion = _fpp_bundles_prefix($suggestion); + $suggestions[$suggestion] = array( + 'template' => str_replace('_', '-', $suggestion), + 'path' => "$path/templates", + ); + } + + return $suggestions; +} + +/** + * Create the module route. + * + * @return array + * An array of menu routes. + */ +function fpp_bundles_menu() { + return fpp_bundles('menu_routes'); +} + +/** + * Implements hook_features_api(). + */ +function fpp_bundles_features_api() { + $integrations = array(); + + $integrations[FPP_BUNDLES_MACHINE_NAME] = array( + 'name' => t('Fieldable Panels Panes Bundles'), + 'file' => drupal_get_path('module', FPP_BUNDLES_MACHINE_NAME) . '/' . _fpp_bundles_include_file_path('features'), + 'default_hook' => FPP_BUNDLES_MACHINE_NAME, + 'default_file' => FEATURES_DEFAULTS_INCLUDED, + 'feature_source' => TRUE, + ); + + return $integrations; +} + +/** + * Implements hook_entity_info_alter(). + */ +function fpp_bundles_entity_info_alter(&$entity_info) { + /* @var \FppBundle $bundle */ + foreach (fpp_bundles_db()->getAllBundles() as $machine_name => $bundle) { + $entity_info[FPP_BUNDLES_ENTITY_TYPE]['bundles'][$machine_name] = array( + 'bid' => $bundle->getBundleId(), + 'label' => $bundle->getHumanName(), + 'pane category' => $bundle->getCategoryName() ?: t('Custom'), + 'pane top level' => $bundle->isTopLevelPanel(), + 'admin' => array( + 'path' => FPP_BUNDLES_ADMIN_URL . '/manage/%fieldable_panels_panes_type', + 'real path' => FPP_BUNDLES_ADMIN_URL . "/manage/$machine_name", + 'bundle argument' => 4, + 'access arguments' => array(FPP_BUNDLES_ENTITY_ACCESS), + ), + ); + } +} + +/** + * Implements hook_entity_load(). + */ +function fpp_bundles_entity_load(array $entities, $type) { + if ($type == FPP_BUNDLES_ENTITY_TYPE) { + $db = fpp_bundles_db(); + + foreach ($entities as $entity) { + $bundle = $db->getBundleByDbIndex('unique', $entity->bundle); + + if ($bundle) { + $entity->assets = array(); + + if ($bundle->isAssetsLoadAutomatically()) { + _fpp_bundles_collect_assets($entity->assets, $entity->bundle); + } + } + } + } +} + +/** + * Implements hook_preprocess_HOOK(). + */ +function fpp_bundles_preprocess_fieldable_panels_pane(&$variables) { + $entity = $variables['elements']['#element']; + + // The "assets" property is provided by this module and set + // only for entities that has been created from UI. + if (isset($entity->assets)) { + // Add additional assets for administrative users. + if ($variables['is_admin']) { + _fpp_bundles_collect_assets($entity->assets, "admin/$entity->bundle-admin"); + } + + foreach ($entity->assets as $type => $files) { + array_map("drupal_add_$type", $files); + } + } +} + +/** + * Implements hook_menu_alter(). + */ +function fpp_bundles_menu_alter(&$items) { + $items[FPP_BUNDLES_ADMIN_URL]['page callback'] = _fpp_bundles_callback_prefix('entities_page'); +} + +/** + * Get the information about entity of the "fieldable_panels_pane" type. + * + * @return \stdClass + * Entity information. + */ +function fpp_bundles_get_fieldable_panels_pane_entity() { + return (object) entity_get_info(FPP_BUNDLES_ENTITY_TYPE); +} + +/** + * Callback function for the FPP Entities page. + * + * @return array + * An array with elements for render. + */ +function _fpp_bundles_entities_page() { + $items = $rows = array(); + + /* @var \FppBundle $bundle */ + foreach (fpp_bundles_db()->getAllBundles(10) as $machine_name => $bundle) { + $manage_entity_url = FPP_BUNDLES_ADMIN_URL . "/manage/$machine_name"; + $actions = array(); + + $actions['entity'] = _fpp_bundles_build_links_for_operations_with_bundle($manage_entity_url); + + foreach (array( + FPP_BUNDLES_UPDATE_BUNDLE_ACTION => t('update'), + FPP_BUNDLES_REMOVE_BUNDLE_ACTION => t('remove'), + ) as $action_type => $action_name) { + $actions['bundle'][$action_type] = array( + 'title' => $action_name, + 'href' => _fpp_bundles_get_menu_path($action_type) . '/' . $bundle->getBundleId(), + ); + } + + foreach (array_keys($actions) as $action_type) { + $actions[$action_type] = _fpp_bundles_theme_links_block($actions[$action_type]); + } + + $rows[] = array( + 'name' => l($bundle->getHumanName(), $manage_entity_url), + 'category' => $bundle->getCategoryName(), + ) + $actions; + } + + $items['bundles'] = array( + '#theme' => 'table', + '#header' => array( + 'name' => t('Name'), + 'category' => t('Category'), + 'entity' => t('Entity actions'), + 'bundle' => t('Bundle actions'), + ), + '#rows' => $rows, + '#empty' => t('Any bundle has not been created.'), + ); + + $items['pager'] = array( + '#theme' => 'pager', + ); + + $items['separator'] = array( + '#tag' => 'h4', + '#type' => 'html_tag', + '#value' => t('Bundles, that has been created programmatically.'), + '#attributes' => array( + 'class' => 'form-item', + ), + ); + + $items['in_code'] = array( + '#theme' => 'table', + '#header' => array( + 'name' => t('Name'), + 'category' => t('Category'), + 'operations' => t('Operations'), + ), + '#rows' => _fpp_bundles_get_bundles_stored_in_code(), + ); + + return $items; +} + +/** + * Get an array with links for entity managing. + * + * @param string $url_prefix + * Admin URL to bundle page. Will be suffixed by action type. + * + * @return array + * An associative array where key is a machine name of link and + * value - an array with two keys: "title" and "href". + */ +function _fpp_bundles_build_links_for_operations_with_bundle($url_prefix) { + $actions = array(); + + foreach (array( + 'add' => t('add panel'), + 'fields' => t('manage fields'), + 'display' => t('manage display'), + ) as $action_type => $action_name) { + $actions[$action_type] = array( + 'title' => $action_name, + 'href' => "$url_prefix/$action_type", + ); + } + + return $actions; +} + +/** + * Wrapper for Drupal "theme()" function. + * + * @param array $links + * An array that can be rendered by Drupal mechanism. + * + * @return string + * HTML markup. + */ +function _fpp_bundles_theme_links_block(array $links) { + return theme('links', array( + 'links' => $links, + 'attributes' => array( + 'class' => array('links', 'inline'), + ), + )); +} + +/** + * Get an array with bundles for render which has been created programmatically. + */ +function _fpp_bundles_get_bundles_stored_in_code() { + $rows = array(); + + foreach (fpp_bundles_get_fieldable_panels_pane_entity()->bundles as $bundle) { + // If the bundle does not have the "bid" it means that it has + // been created programmatically. + if (!isset($bundle['bid'])) { + $rows[] = array( + 'name' => l($bundle['label'], $bundle['admin']['real path']), + 'category' => isset($bundle['pane category']) ? $bundle['pane category'] : '', + 'operations' => _fpp_bundles_theme_links_block(_fpp_bundles_build_links_for_operations_with_bundle($bundle['admin']['real path'])), + ); + } + } + + return $rows; +} + +/** + * Get the URL by action name. + * + * @param string $action_name + * Name of performed action. + * + * @return string + * Relative URL or an empty string if action does not exist. + */ +function _fpp_bundles_get_menu_path($action_name) { + $paths = fpp_bundles('menu_paths'); + return isset($paths[$action_name]) ? $paths[$action_name] : ''; +} + +/** + * Get the title by action name. + * + * @param string $action_name + * Name of performed action. + * + * @return string + * Title for the specified action or an empty string if action does not exist. + */ +function _fpp_bundles_get_action_title($action_name) { + $titles = fpp_bundles('action_titles'); + return isset($titles[$action_name]) ? $titles[$action_name] : ''; +} + +/** + * Clear caches of the Drupal theme and entities. + */ +function _fpp_bundles_clear_caches() { + entity_info_cache_clear(); + drupal_theme_rebuild(); +} + +/** + * Create function name that prefixed by module name. + * + * @see _fpp_bundles_prefix() + */ +function _fpp_bundles_callback_prefix($suffix) { + return '_' . _fpp_bundles_prefix($suffix); +} + +/** + * Prepend module name into a string. + * + * @param string $suffix + * Ending of a string. + * + * @return string + * Prefixed string. + */ +function _fpp_bundles_prefix($suffix) { + return FPP_BUNDLES_MACHINE_NAME . "_$suffix"; +} + +/** + * Get the relative, to the module directory, file path from "includes" dir. + * + * @param string $type + * File extension. + * + * @return string + * Relative path. + */ +function _fpp_bundles_include_file_path($type) { + return 'includes/' . FPP_BUNDLES_MACHINE_NAME . ".$type.inc"; +} + +/** + * Get an action success message. + * + * @param string $action + * An action name. + * @param string $bundle_name + * The bundle name. + * + * @see \FppBundlesDatabase::performAction() + * + * @return string + * Success message. + */ +function _fpp_bundles_get_action_success_message_by_name($action, $bundle_name) { + $status = ''; + + switch ($action) { + case FPP_BUNDLES_CREATE_BUNDLE_ACTION: + $status = t('created'); + break; + + case FPP_BUNDLES_UPDATE_BUNDLE_ACTION: + $status = t('updated'); + break; + + case FPP_BUNDLES_REMOVE_BUNDLE_ACTION: + $status = t('removed'); + break; + } + + if ($status) { + return t('The "!bundle" bundle was successfully !status!', array( + '!bundle' => $bundle_name, + '!status' => $status, + )); + } + + return $status; +} + +/** + * Transform a any string to machine name. + * + * @param string $string + * Input string for transformations. + * + * @example + * String: "__-_ An awe-some manager!#$%^&_+123=-ÆæØä'Ö\"@ (bundle)" + * Will be transformed to: "an_awe_some_manager123_bundle". + * + * @return string + * Generated name. + */ +function _fpp_bundles_create_machine_name($string) { + // Firstly, set to lowercase the input string. Secondly, leave in a + // row only lowercase latin characters, numbers, and single spaces, + // but only between the words. Thirdly, replace spaces to underscores. + return trim(preg_replace('/\s+|-+/', '_', trim(preg_replace('/[^a-z\d\s-]/', '', strtolower($string)))), '_'); +} + +/** + * Collect an assets for a panel. + * + * @param array $assets + * An array with "css" & "js" keys. + * @param string $name + * File name without extension. + */ +function _fpp_bundles_collect_assets(array &$assets, $name) { + $theme_path = path_to_theme(); + + foreach (array('css', 'js') as $extension) { + $file = $theme_path . str_replace('_', '-', "/$extension/fieldable-panels-panes/$name.$extension"); + + if (file_exists(DRUPAL_ROOT . "/$file")) { + $assets[$extension][] = $file; + } + } +} + diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.test b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.test new file mode 100644 index 0000000000000000000000000000000000000000..2b9348beda82b7e94c23c9314fa161255f86619a --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/fpp_bundles.test @@ -0,0 +1,224 @@ +<?php +/** + * @file + * Test the "FPP Bundles" module functionality. + */ + +/** + * Class FppBundlesTestCase. + */ +class FppBundlesTestCase extends \DrupalWebTestCase { + /** + * Module object. + * + * @var \FppBundlesDatabase + */ + protected $db; + + /** + * Give display information to the SimpleTest system. + * + * @return array + * Keyed array with information for SimpleTest. + */ + public static function getInfo() { + $name = 'FPP Bundles'; + + return array( + 'name' => $name, + 'group' => $name, + 'description' => "Ensure that the \"$name\" provided functions properly.", + ); + } + + /** + * Setup the test environment. + */ + public function setUp() { + $this->db = fpp_bundles_db(); + parent::setUp(FPP_BUNDLES_MACHINE_NAME); + $this->drupalLogin($this->drupalCreateUser(array(FPP_BUNDLES_ENTITY_ACCESS))); + } + + /** + * Build an URL to page on that can be performed some action. + * + * @param string $action + * URL suffix. + * + * @return string + * Page URL. + */ + public function getActionUrl($action) { + return '/' . FPP_BUNDLES_ADMIN_URL . "/$action"; + } + + /** + * Programmatically creating the bundle in database. + * + * @param array $bundle + * An array with bundle data. + * + * @return array + * Information about bundle that has been created. + */ + public function createBundleProgrammatically(array $bundle) { + try { + $bundle['bid'] = $this->db->insertBundle($this->db->prepareBundleData($bundle)); + } + catch (\FppBundlesException $e) { + $this->error($e->getMessage()); + + return FALSE; + } + + return $bundle; + } + + /** + * Get the necessary data for creating the bundle. + * + * @param string $human_name + * The bundle name. + * + * @return array + * Information. + */ + public function getRandomBundleData($human_name = '') { + $human_name = $human_name ?: $this->randomString(14); + + $edit = array(); + $edit['name'] = $human_name; + $edit['level'] = 0; + $edit['assets'] = 1; + $edit['machine'] = preg_replace('/[^a-z0-9_]+/', '_', strtolower($human_name)); + $edit['category'] = $this->randomName(8); + + return $edit; + } + + /** + * Creating a new bundle. + */ + public function testCreateBundle() { + $action = FPP_BUNDLES_CREATE_BUNDLE_ACTION; + $url = $this->getActionUrl($action); + + // Go to the creating page. + $this->drupalGet($url); + $this->assertResponse(200, 'User is allowed to see the page for creating a bundle.'); + $this->assertFieldByName('name', '', 'Found the "name" field in creating form.'); + + // Create new bundle. + $edit = $this->getRandomBundleData('Test bundle'); + $message = _fpp_bundles_get_action_success_message_by_name($action, $edit['name']); + $this->drupalPost($url, $edit, _fpp_bundles_get_action_title($action)); + $this->assertResponse(200, 'The request for bundle creation has been successfully sent.'); + $this->assertText($message, $message); + } + + /** + * Test case, when the name consists only from cyrillic letters. + */ + public function testCreateBundleWithCyrillicSymbols() { + $action = FPP_BUNDLES_CREATE_BUNDLE_ACTION; + $message = t('The machine-readable name must contain unique characters.'); + + $this->drupalPost($this->getActionUrl($action), $this->getRandomBundleData('Кириллица'), _fpp_bundles_get_action_title($action)); + $this->assertText($message, $message); + } + + /** + * Test case, when the name consists only from numbers. + */ + public function testCreateBundleWithNumbers() { + $action = FPP_BUNDLES_CREATE_BUNDLE_ACTION; + $message = t('The name of bundle should not contain only numbers.'); + + $this->drupalPost($this->getActionUrl($action), $this->getRandomBundleData(' 22 1212 3432'), _fpp_bundles_get_action_title($action)); + $this->assertText($message, $message); + } + + /** + * Test case, when the name consists less than five symbols. + */ + public function testCreateBundleWithShortName() { + $action = FPP_BUNDLES_CREATE_BUNDLE_ACTION; + $message = t('The name of bundle should contain more than !number symbols.', array( + '!number' => FPP_BUNDLES_MINIMUM_CHARS_FOR_NAME, + )); + + $this->drupalPost($this->getActionUrl($action), $this->getRandomBundleData(' B1'), _fpp_bundles_get_action_title($action)); + $this->assertText($message, $message); + } + + /** + * Editing an existing bundle. + */ + public function testUpdateBundle() { + // Create the bundle. + $action = FPP_BUNDLES_UPDATE_BUNDLE_ACTION; + $bundle = $this->createBundleProgrammatically($this->getRandomBundleData('The bundle name')); + $url = $this->getActionUrl($action . '/' . $bundle['bid']); + + // Go to the editing page. + $this->drupalGet($url); + $this->assertResponse(200, 'User is allowed to see the page for editing a bundle.'); + $this->assertFieldByName('name', $bundle['name'], 'Found filled field "name" on the edit form.'); + + // Update data. + $bundle['name'] = 'Updated bundle'; + unset($bundle['machine']); + + $message = _fpp_bundles_get_action_success_message_by_name($action, $bundle['name']); + $this->drupalPost($url, $bundle, _fpp_bundles_get_action_title($action)); + $this->assertResponse(200, 'The request for bundle updating has been successfully sent.'); + $this->assertText($message, $message); + } + + /** + * Removing an existing bundle. + */ + public function testRemoveBundle() { + // Create the bundle. + $action = FPP_BUNDLES_REMOVE_BUNDLE_ACTION; + $bundle = $this->createBundleProgrammatically($this->getRandomBundleData('The bundle name')); + $url = $this->getActionUrl($action . '/' . $bundle['bid']); + + // Go to the removing page. + $this->drupalGet($url); + $this->assertResponse(200, 'User is allowed to see the page for removing a bundle.'); + $this->assertText($bundle['name'], 'Found filled field "name" on the edit form.'); + + // Remove the bundle. + $message = _fpp_bundles_get_action_success_message_by_name($action, $bundle['name']); + $this->drupalPost($url, array(), _fpp_bundles_get_action_title($action)); + $this->assertResponse(200, 'The request for bundle deletion has been successfully sent.'); + $this->assertText($message, $message); + } + + /** + * Programmatically create/update/remove the bundle. + */ + public function testCreateUpdateRemoveBundleProgrammatically() { + // Create a bundle. + $status = fpp_bundles_save(array( + 'name' => t('New bundle'), + 'category' => t('FPP Bundles'), + )); + $this->assertTrue($status, 'The bundle was created with help of "fpp_bundles_save" function.'); + + // Update the created bundle. + $status = fpp_bundles_save(array( + 'bid' => 1, + 'name' => t('New bundle name'), + 'level' => 1, + 'assets' => 0, + )); + $this->assertTrue($status, 'The bundle was updated with help of "fpp_bundles_save" function.'); + + // Remove the created bundle. + $status = fpp_bundles_remove(1); + $this->assertTrue($status, 'The bundle was removed with help of "fpp_bundles_save" function.'); + } +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/includes/fpp_bundles.admin.inc b/profiles/wcm_base/modules/contrib/fpp_bundles/includes/fpp_bundles.admin.inc new file mode 100644 index 0000000000000000000000000000000000000000..d959932cad8e820fff0d175ad92bf5fa4391c4ee --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/includes/fpp_bundles.admin.inc @@ -0,0 +1,219 @@ +<?php +/** + * @file + * Admin functions. + */ + +/** + * Form for add/edit the FPP bundle. + * + * @param string $action + * An action that been performed. + * @param int $bid + * The bundle ID. + * + * @see fpp_bundles() + * + * @return array + * An array of form items. + */ +function _fpp_bundles_manage_bundle($action, $bid = NULL) { + if ($action == FPP_BUNDLES_CREATE_BUNDLE_ACTION) { + $bundle = new \FppBundle(); + + if (isset($bid)) { + drupal_goto(_fpp_bundles_get_menu_path($action)); + } + } + else { + $bundle = fpp_bundles_db()->getBundleByDbIndex('primary', $bid); + } + + if (!$bundle) { + drupal_goto(FPP_BUNDLES_ADMIN_URL); + } + + return drupal_get_form(__FUNCTION__ . '_form', $bundle, $action, drupal_set_title(_fpp_bundles_get_action_title($action))); +} + +/** + * Callback function for check bundles categories. + * + * @param string $string + * User input. + */ +function _fpp_bundles_autocomplete_category($string) { + $matches = array(); + $result = fpp_bundles_db() + ->bundleSelectQuery() + ->condition('category', "%$string%", 'like') + ->range(0, 15) + ->execute(); + + foreach ($result as $row) { + $matches[$row->category] = $row->category; + } + + drupal_json_output($matches); +} + +/** + * Settings form for the bundles actions. + * + * @param array $form + * Form items and configuration. + * @param array $form_state + * Information about current state of the form. + * @param \FppBundle $bundle + * Bundle object. + * @param string $action + * Performing action. + * @param string $page_title + * Human readable page name. + * + * @see _fpp_bundles_manage_bundle() + * + * @return array + * Drupal form. + */ +function _fpp_bundles_manage_bundle_form(array $form, array &$form_state, \FppBundle $bundle, $action, $page_title) { + $machine_name = $bundle->getMachineName(); + $bundle_name = $bundle->getHumanName(); + $items = array(); + + // Create hidden fields. + foreach (array( + 'bid' => $bundle->getBundleId(), + 'action' => $action, + ) as $name => $value) { + $items[$name] = array( + '#type' => 'hidden', + '#default_value' => $value, + ); + } + + $items['name'] = array( + '#type' => 'textfield', + '#title' => t('Name of the bundle'), + '#required' => TRUE, + '#default_value' => $bundle_name, + ); + + $items['machine'] = array( + '#type' => 'machine_name', + '#disabled' => (bool) $machine_name, + '#maxlength' => 32, + '#default_value' => $machine_name, + '#machine_name' => array( + 'exists' => _fpp_bundles_callback_prefix('check_machine_name_existence'), + ), + ); + + $items['category'] = array( + '#type' => 'textfield', + '#title' => t('Bundle category'), + '#default_value' => $bundle->getCategoryName(), + '#autocomplete_path' => _fpp_bundles_get_menu_path('autocomplete category'), + ); + + $items['level'] = array( + '#type' => 'checkbox', + '#title' => t('An entity will be shown in the general list?'), + '#description' => t('If "checked", bundle will not shown in category.'), + '#default_value' => $bundle->isTopLevelPanel(), + ); + + $items['assets'] = array( + '#type' => 'checkbox', + '#title' => t('Include CSS & JS files for this bundle automatically?'), + '#default_value' => $bundle->isAssetsLoadAutomatically(), + '#description' => t('If "checked", module will attempt to include assets on page on which bundle is used. For additional information see the !url page.', array( + '!url' => l(t('help'), 'admin/help/' . FPP_BUNDLES_MACHINE_NAME, array( + 'attributes' => array( + 'target' => '_blank', + ), + )), + )), + ); + + $form['actions'] = array( + '#type' => 'actions', + ); + + $form['actions']['save'] = array( + '#type' => 'submit', + '#value' => $page_title, + ); + + if ($action == FPP_BUNDLES_REMOVE_BUNDLE_ACTION) { + $items = array_map('hide', $items); + $form['warning'] = array( + '#markup' => t('Do you really want to remove the "!name" FPP bundle? This action can not to be undone!', array( + '!name' => "<b>$bundle_name</b>", + )), + ); + } + + return $items + $form; +} + +/** + * Drupal machine name validation callback. + * + * @param string $machine_name + * Generated machine name. + * + * @return bool + * Status of the name existence. + */ +function _fpp_bundles_check_machine_name_existence($machine_name) { + if (isset(fpp_bundles_get_fieldable_panels_pane_entity()->bundles[$machine_name])) { + return TRUE; + } + + return FALSE; +} + +/** + * Validation handler for _fpp_bundles_manage_bundle_form(). + */ +function _fpp_bundles_manage_bundle_form_validate(array $form, array &$form_state) { + $values = $form_state['values']; + + if (empty($values['category'])) { + unset($values['category']); + } + + try { + $form_state['bundle'] = fpp_bundles_db()->validateBundle($values); + } + catch (\FppBundlesException $e) { + form_set_error('name', $e->getMessage()); + } + + // Set the remove action if needed. + if ($values['action'] == FPP_BUNDLES_REMOVE_BUNDLE_ACTION) { + $form_state['bundle']['action'] = $values['action']; + } +} + +/** + * Submit handler for _fpp_bundles_manage_bundle_form(). + */ +function _fpp_bundles_manage_bundle_form_submit(array $form, array &$form_state) { + $bundle = $form_state['bundle']; + // @todo Remove all fields of the bundle together with it. + $status = fpp_bundles_db()->performAction($bundle['action'], $bundle['values']); + $message = t('Cannot complete the "!action" operation.', array( + '!action' => $bundle['action'], + )); + + if ($status) { + _fpp_bundles_clear_caches(); + $message = _fpp_bundles_get_action_success_message_by_name($bundle['action'], $bundle['values']['name']); + } + + drupal_set_message($message); + + $form_state['redirect'] = FPP_BUNDLES_ADMIN_URL; +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/includes/fpp_bundles.features.inc b/profiles/wcm_base/modules/contrib/fpp_bundles/includes/fpp_bundles.features.inc new file mode 100644 index 0000000000000000000000000000000000000000..67ebfb8588201add8366544d238f6f1717cfd231 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/includes/fpp_bundles.features.inc @@ -0,0 +1,94 @@ +<?php +/** + * @file + * Implements the Features API for export bundles as features. + */ + +/** + * Implements hook_features_export_options(). + */ +function fpp_bundles_features_export_options() { + $options = array(); + + /* @var \FppBundle $bundle */ + foreach (fpp_bundles_db()->getAllBundles() as $machine_name => $bundle) { + $options[$machine_name] = $bundle->getHumanName(); + } + + return $options; +} + +/** + * Implements hook_features_export(). + */ +function fpp_bundles_features_export($data, &$export, $feature_name, $module_name) { + $export['dependencies'][$module_name] = $module_name; + $prop = 'field' . (FEATURES_API >= 2 ? '_instance' : ''); + $pipe = array(); + + foreach ($data as $bundle_machine_name) { + $export['features'][$module_name][$bundle_machine_name] = $bundle_machine_name; + + $bundle_fields = db_select('field_config_instance', 'fci') + ->fields('fci', array('field_name')) + ->condition('bundle', $bundle_machine_name, '=') + ->execute() + ->fetchCol(); + + foreach ($bundle_fields as $field_name) { + $field_instance_args = array(FPP_BUNDLES_ENTITY_TYPE, $bundle_machine_name, $field_name); + $field_instance_id = implode('-', $field_instance_args); + $field_instance = call_user_func_array('field_info_instance', $field_instance_args); + + if ($field_instance) { + $export['dependencies'][$field_instance['widget']['module']] = $field_instance['widget']['module']; + } + + $export['features'][$prop][$field_instance_id] = $field_instance_id; + $pipe['field_base'][$field_name] = $field_name; + } + } + + return $pipe; +} + +/** + * Implements hook_features_export_render(). + */ +function fpp_bundles_features_export_render($feature_name, $data, $export = NULL) { + $code = array(); + + foreach ($data as $bundle_machine_name) { + $bundle = fpp_bundles_db()->getBundleByMachineName($bundle_machine_name); + + if ($bundle) { + $code += $bundle->export(); + } + } + + return array( + FPP_BUNDLES_MACHINE_NAME => ' return ' . features_var_export($code, ' ') . ';', + ); +} + +/** + * Implements hook_features_rebuild(). + */ +function fpp_bundles_features_rebuild($feature_name) { + $db = fpp_bundles_db(); + + foreach (module_invoke($feature_name, FPP_BUNDLES_MACHINE_NAME) as $machine_name => $values) { + if (!$db->getBundleByMachineName($machine_name)) { + $db->insertBundle($values); + } + } + + _fpp_bundles_clear_caches(); +} + +/** + * Implements hook_features_revert(). + */ +function fpp_bundles_features_revert($feature_name) { + fpp_bundles_features_rebuild($feature_name); +} diff --git a/profiles/wcm_base/modules/contrib/fpp_bundles/templates/fpp-bundles--admin-help.tpl.php b/profiles/wcm_base/modules/contrib/fpp_bundles/templates/fpp-bundles--admin-help.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..f1dccc2299c66d2b09535ebc0f953c9ab67e3ca7 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/fpp_bundles/templates/fpp-bundles--admin-help.tpl.php @@ -0,0 +1,143 @@ +<?php +/** + * @file + * Admin help for FPP Bundles. + */ +?> +<section class="assets" role="region"> + <h2 role="heading"> + <?php print t('Automatically include the CSS & JS'); ?> + </h2> + <p> + <?php + print t('If panel has the "!name" machine name, then the module will try to find CSS & JS in following directories:', array( + '!name' => '<b>media_bundle</b>', + )); + ?> + </p> + <ul> + <li>PATH/TO/THEME/css/fieldable-panels-panes/media-bundle.css</li> + <li>PATH/TO/THEME/js/fieldable-panels-panes/media-bundle.js</li> + </ul> + <p> + <?php print t('Also, for <b>administrative users</b> can be added the additional assets. The files should be placed and named the same as in the next example:'); ?> + </p> + <ul> + <li>PATH/TO/THEME/css/fieldable-panels-panes/admin/media-bundle-admin.css</li> + <li>PATH/TO/THEME/js/fieldable-panels-panes/admin/media-bundle-admin.js</li> + </ul> + <h4 role="heading"> + <?php print t('Templates'); ?> + </h4> + <p> + <?php print t('For each panel can be created the template file in "templates" directory of current Drupal theme. But strongly recommended to store the templates in:'); ?> + </p> + <ul> + <li>PATH/TO/THEME/templates/fieldable-panels-panes/fieldable-panels-pane--media-bundle.tpl.php</li> + </ul> +</section> + +<br /> +<hr /> +<br /> + +<section class="api" role="region"> + <h2 role="heading"> + <?php print t('Application programming interface'); ?> + </h2> + <p><?php print t('The module has the next hooks:'); ?></p> + <ul> + <li> + <b>hook_fpp_bundles_bundle_insert</b> + </li> + <li> + <b>hook_fpp_bundles_bundle_update</b> + </li> + <li> + <b>hook_fpp_bundles_bundle_delete</b> + </li> + </ul> + <p><?php print t('Each of this hooks occurs after successfully operation with DB and called only when event happened and cannot affect on the data structure.'); ?></p> + <h6 role="heading"> + <?php print t('Also, the next functions can help for developers:'); ?> + </h6> + <ul> + <li> + <b>fpp_bundles_save</b> - <?php print t('Programmatically save the new bundle;'); ?> + </li> + <li> + <b>fpp_bundles_remove</b> - <?php print t('Programmatically update an existing bundle.'); ?> + </li> + </ul> + <br /> + <div> + <strong> + <?php print t('Creation example:'); ?> + </strong> + <pre> +// If the value of "$status" variable will be TRUE, then bundle was +// created successfully, in another case the error message will be +// stored in the Dblog and the value will be FALSE. +$status = fpp_bundles_save(array( + // The "name" is required. + 'name' => 'Video', + // By default it set to "0", + 'level' => 1, + // By default it set to "1". + 'assets' => 0, + // By default it is empty. + 'category' => 'Media', +)); + </pre> + </div> + <div> + <strong> + <?php print t('Update example:'); ?> + </strong> + <pre> +// Change only one parameter of the bundle. +$status = fpp_bundles_save(array( + // The ID of created bundle. + 'bid' => 1, + // Change "assets" to "1". + 'assets' => 1, +)); + </pre> + </div> + <div> + <strong> + <?php print t('Remove example:'); ?> + </strong> + <pre> +// Remove the bundle by ID. If bundle with such ID does not exist, +// then error message will be stored in the Dblog and a value +// of "$status" variable will be FALSE. +$status = fpp_bundles_remove(1); + </pre> + </div> + <div> + <strong> + <?php print t('Append your own assets in <b>preprocess</b> hooks:'); ?> + </strong> + <pre> +/** + * Implements hook_preprocess_HOOK(). + */ +function hook_preprocess_fieldable_panels_pane(&$variables) { + $entity = $variables['elements']['#element']; + + // The "assets" property provided by "FPP Bundles" module + // and allowed only for panels, created from UI. + if (isset($entity->assets)) { + $entity->assets['css'][] = 'path/to/your/own/file.css'; + } +} + </pre> + </div> + <p> + <?php print t('Highly recomended to create/update/delete the bundles !link and export them with !features.', array( + '!link' => l(t('via UI'), 'admin/structure/fieldable-panels-panes'), + '!features' => l(t('Features'), 'https://www.drupal.org/project/features'), + )); ?> + </p> +</section> diff --git a/profiles/wcm_base/modules/contrib/manualcrop/manualcrop.info b/profiles/wcm_base/modules/contrib/manualcrop/manualcrop.info index f0defad2c46c26897cbd8859c768016a84fb8416..9b25c81fbfcbb5668e853f71ae9e6082d7a8ccfb 100644 --- a/profiles/wcm_base/modules/contrib/manualcrop/manualcrop.info +++ b/profiles/wcm_base/modules/contrib/manualcrop/manualcrop.info @@ -7,3 +7,11 @@ dependencies[] = image (>=7.8) dependencies[] = libraries (>=2.1) files[] = includes/views/manualcrop.views.inc + + +; Information added by drush on 2015-06-10 +version = "7.x-1.4+109-dev" +core = "7.x" +project = "manualcrop" +datestamp = "1433897517" + diff --git a/profiles/wcm_base/modules/contrib/media/media.info b/profiles/wcm_base/modules/contrib/media/media.info index 41db09184664fe27d0a6e5da0020530dacbed1e9..28a854cf704d67ffe263dce089020bfb62a2f74e 100644 --- a/profiles/wcm_base/modules/contrib/media/media.info +++ b/profiles/wcm_base/modules/contrib/media/media.info @@ -23,3 +23,11 @@ configure = admin/config/media/browser ; We have to add a fake version so Git checkouts do not fail Media dependencies version = 7.x-2.x-dev + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media/modules/media_bulk_upload/media_bulk_upload.info b/profiles/wcm_base/modules/contrib/media/modules/media_bulk_upload/media_bulk_upload.info index f930dbc095957093882506d7f09a97958c978ac7..9c10daf164d3779d108d2936ffec15a7b254cbbe 100644 --- a/profiles/wcm_base/modules/contrib/media/modules/media_bulk_upload/media_bulk_upload.info +++ b/profiles/wcm_base/modules/contrib/media/modules/media_bulk_upload/media_bulk_upload.info @@ -8,3 +8,11 @@ dependencies[] = multiform dependencies[] = plupload files[] = includes/MediaBrowserBulkUpload.inc + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media/modules/media_internet/media_internet.info b/profiles/wcm_base/modules/contrib/media/modules/media_internet/media_internet.info index 3ec8936c7ccf1d6c2fb8a4a66968f953d223c75d..8a1b504a6a57c73a239ec39353a602f246b49c01 100644 --- a/profiles/wcm_base/modules/contrib/media/modules/media_internet/media_internet.info +++ b/profiles/wcm_base/modules/contrib/media/modules/media_internet/media_internet.info @@ -10,3 +10,11 @@ files[] = includes/MediaInternetBaseHandler.inc files[] = includes/MediaInternetFileHandler.inc files[] = includes/MediaInternetNoHandlerException.inc files[] = includes/MediaInternetValidationException.inc + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media/modules/media_migrate_file_types/media_migrate_file_types.info b/profiles/wcm_base/modules/contrib/media/modules/media_migrate_file_types/media_migrate_file_types.info index 32c98d119ee2233e7aa56728dd5a99727c9d3043..1c73cb470d881fd5dc1840fe45cee3fe836bc4d2 100644 --- a/profiles/wcm_base/modules/contrib/media/modules/media_migrate_file_types/media_migrate_file_types.info +++ b/profiles/wcm_base/modules/contrib/media/modules/media_migrate_file_types/media_migrate_file_types.info @@ -7,3 +7,11 @@ hidden = TRUE dependencies[] = media configure = admin/structure/file-types/upgrade + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg/media_wysiwyg.info b/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg/media_wysiwyg.info index 93b8a3aa999603137d633e913676c049e03ee69c..d1d88e45afb9d448f591925dc90b39c5a3ea3dc6 100644 --- a/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg/media_wysiwyg.info +++ b/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg/media_wysiwyg.info @@ -14,3 +14,11 @@ files[] = tests/media_wysiwyg.file_usage.test files[] = tests/media_wysiwyg.macro.test configure = admin/config/media/browser + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.info b/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.info index 8fbbdbbd845b6783d9e858faab07b660c30a2792..62d962d3a61ba2aa95d6061bb2f6989a6f8e9d04 100644 --- a/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.info +++ b/profiles/wcm_base/modules/contrib/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.info @@ -8,3 +8,11 @@ dependencies[] = media_wysiwyg configure = admin/config/media/wysiwyg-view-mode files[] = media_wysiwyg_view_mode.test + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media/modules/mediafield/mediafield.info b/profiles/wcm_base/modules/contrib/media/modules/mediafield/mediafield.info index 24022ad7868892076599e81ad06a82f33dffd81a..031ba7be9a54c3b69e16b2dea0044bb4caa1e5a1 100644 --- a/profiles/wcm_base/modules/contrib/media/modules/mediafield/mediafield.info +++ b/profiles/wcm_base/modules/contrib/media/modules/mediafield/mediafield.info @@ -3,3 +3,11 @@ description = "Provides a field type that stores media-specific data. <em>Deprec package = Media core = 7.x dependencies[] = media + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media/tests/media_module_test.info b/profiles/wcm_base/modules/contrib/media/tests/media_module_test.info index de618c2e6b474333832e20d7ab483e7d7b8b4360..47c4f092b27e78a12973b3b98378943164c4b7a6 100644 --- a/profiles/wcm_base/modules/contrib/media/tests/media_module_test.info +++ b/profiles/wcm_base/modules/contrib/media/tests/media_module_test.info @@ -3,3 +3,11 @@ description = Provides hooks for testing Media module functionality. package = Media core = 7.x hidden = TRUE + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-alpha3+98-dev" +core = "7.x" +project = "media" +datestamp = "1433897475" + diff --git a/profiles/wcm_base/modules/contrib/media_youtube/media_youtube.info b/profiles/wcm_base/modules/contrib/media_youtube/media_youtube.info index 49fd9edfa3a26f9b95bec076ddfd7c5fe0fbef23..76804b886c002ff5dfe12f4e2939ef3e850ed91c 100644 --- a/profiles/wcm_base/modules/contrib/media_youtube/media_youtube.info +++ b/profiles/wcm_base/modules/contrib/media_youtube/media_youtube.info @@ -8,3 +8,11 @@ dependencies[] = media_internet files[] = includes/MediaYouTubeStreamWrapper.inc files[] = includes/MediaInternetYouTubeHandler.inc files[] = includes/MediaYouTubeBrowser.inc + + +; Information added by drush on 2015-06-10 +version = "7.x-2.0-rc4+9-dev" +core = "7.x" +project = "media_youtube" +datestamp = "1433897625" + diff --git a/profiles/wcm_base/modules/contrib/uuid_features/includes/uuid_node.features.inc b/profiles/wcm_base/modules/contrib/uuid_features/includes/uuid_node.features.inc old mode 100755 new mode 100644 diff --git a/profiles/wcm_base/modules/contrib/uuid_features/uuid_features.info b/profiles/wcm_base/modules/contrib/uuid_features/uuid_features.info index f76b1acf4ec7220da8f5550cafa6ebc564b684e5..45c835a8bed0ef00f216fb16180cba962ba2a523 100644 --- a/profiles/wcm_base/modules/contrib/uuid_features/uuid_features.info +++ b/profiles/wcm_base/modules/contrib/uuid_features/uuid_features.info @@ -8,9 +8,9 @@ package = Features configure = admin/structure/features/uuid_features -; Information added by Drupal.org packaging script on 2015-05-31 -version = "7.x-1.0-alpha4+64-dev" +; Information added by Drupal.org packaging script on 2015-06-05 +version = "7.x-1.0-alpha4+65-dev" core = "7.x" project = "uuid_features" -datestamp = "1433064182" +datestamp = "1433490481" diff --git a/profiles/wcm_base/modules/contrib/workbench/workbench.info b/profiles/wcm_base/modules/contrib/workbench/workbench.info index d7cbf84f6369778823ff812cc8a73b4f01b89ced..a45e8b40f883fcdc2f92d90b141957b680fa5ec2 100644 --- a/profiles/wcm_base/modules/contrib/workbench/workbench.info +++ b/profiles/wcm_base/modules/contrib/workbench/workbench.info @@ -4,3 +4,11 @@ package = Workbench core = 7.x configure = admin/config/workbench/settings dependencies[] = views + + +; Information added by drush on 2015-06-10 +version = "7.x-1.2" +core = "7.x" +project = "workbench" +datestamp = "1433897574" + diff --git a/profiles/wcm_base/modules/contrib/workbench_media/workbench_media.info b/profiles/wcm_base/modules/contrib/workbench_media/workbench_media.info index 9eed11b0890ef272579ddb4f41cb6ca4aaae667e..dc9a6d9ad55dfecdfeea66a21b59a10157a6add9 100644 --- a/profiles/wcm_base/modules/contrib/workbench_media/workbench_media.info +++ b/profiles/wcm_base/modules/contrib/workbench_media/workbench_media.info @@ -4,3 +4,11 @@ package = Workbench core = 7.x dependencies[] = workbench dependencies[] = media + + +; Information added by drush on 2015-06-10 +version = "7.x-2.1" +core = "7.x" +project = "workbench_media" +datestamp = "1433897575" + diff --git a/profiles/wcm_base/modules/contrib/workbench_moderation/tests/workbench_moderation_test.info b/profiles/wcm_base/modules/contrib/workbench_moderation/tests/workbench_moderation_test.info index 0f9e0139939f90f05138f37fdc695d018263dee7..a79536c5503018b3cc34870de39af00b39945f84 100644 --- a/profiles/wcm_base/modules/contrib/workbench_moderation/tests/workbench_moderation_test.info +++ b/profiles/wcm_base/modules/contrib/workbench_moderation/tests/workbench_moderation_test.info @@ -3,3 +3,11 @@ description = Test module for Workbench Moderation. package = Workbench core = 7.x hidden = TRUE + + +; Information added by drush on 2015-06-10 +version = "7.x-1.4+6-dev" +core = "7.x" +project = "workbench_moderation" +datestamp = "1433897576" + diff --git a/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.info b/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.info index 3f9939f1b620392b86995547bbcbb4b94258075d..ad9a8e8e0e04d1235f3b76e3079c1a97742462a4 100644 --- a/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.info +++ b/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.info @@ -16,3 +16,11 @@ files[] = workbench_moderation.migrate.inc files[] = tests/external_node_update.test files[] = tests/workbench_moderation.test files[] = tests/workbench_moderation.files.test + + +; Information added by drush on 2015-06-10 +version = "7.x-1.4+6-dev" +core = "7.x" +project = "workbench_moderation" +datestamp = "1433897576" + diff --git a/profiles/wcm_base/modules/contrib/wysiwyg/tests/wysiwyg_test.info b/profiles/wcm_base/modules/contrib/wysiwyg/tests/wysiwyg_test.info index c3ba476d59be670ec5d699f4897ad17ed053e6b2..c9e293c1f74a4748f6a979ae4557c9c687a44698 100644 --- a/profiles/wcm_base/modules/contrib/wysiwyg/tests/wysiwyg_test.info +++ b/profiles/wcm_base/modules/contrib/wysiwyg/tests/wysiwyg_test.info @@ -6,9 +6,9 @@ hidden = TRUE dependencies[] = wysiwyg files[] = wysiwyg_test.module -; Information added by Drupal.org packaging script on 2015-05-26 -version = "7.x-2.2+57-dev" +; Information added by Drupal.org packaging script on 2015-06-04 +version = "7.x-2.2+58-dev" core = "7.x" project = "wysiwyg" -datestamp = "1432677186" +datestamp = "1433409487" diff --git a/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.info b/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.info index 5de2bc5e99d8cd1126cd01beb75117f35985f15e..797278898296a7ff29ef0df0a1bdb883be361d57 100644 --- a/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.info +++ b/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.info @@ -9,9 +9,9 @@ configure = admin/config/content/wysiwyg files[] = wysiwyg.module files[] = tests/wysiwyg.test -; Information added by Drupal.org packaging script on 2015-05-26 -version = "7.x-2.2+57-dev" +; Information added by Drupal.org packaging script on 2015-06-04 +version = "7.x-2.2+58-dev" core = "7.x" project = "wysiwyg" -datestamp = "1432677186" +datestamp = "1433409487" diff --git a/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.js b/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.js index 38146e2e179dd84c970bf7d7a17f5710dd82e3e1..ba1fb291f0f5ba7fa275368b18964e6530619935 100644 --- a/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.js +++ b/profiles/wcm_base/modules/contrib/wysiwyg/wysiwyg.js @@ -284,6 +284,11 @@ Drupal.wysiwygAttach = function(context, fieldId) { // Detach any previous editor instance if enabled, else remove the grippie. detachFromField(context, {'editor': previousEditor, 'status': previousStatus, 'field': fieldId, 'resizable': fieldInfo.resizable}, 'unload'); if (doSummary) { + // Summary instances may have a different status if no real editor was + // attached yet because the field was hidden. + if (Drupal.wysiwyg.instances[fieldInfo.summary]) { + previousStatus = Drupal.wysiwyg.instances[fieldInfo.summary]['status']; + } detachFromField(context, {'editor': previousEditor, 'status': previousStatus, 'field': fieldInfo.summary, 'resizable': fieldInfo.resizable}, 'unload'); } // Store this field id, so (external) plugins can use it. @@ -298,13 +303,17 @@ Drupal.wysiwygAttach = function(context, fieldId) { attachToField(context, {'status': fieldInfo.enabled, 'editor': editor, 'field': fieldId, 'format': fieldInfo.activeFormat, 'resizable': fieldInfo.resizable}, editorSettings); // Attach to summary field. if (doSummary) { - // If the summary wrapper is hidden, attach when it's made visible. + // If the summary wrapper is visible, attach immediately. if ($('#' + fieldInfo.summary).parents('.text-summary-wrapper').is(':visible')) { attachToField(context, {'status': fieldInfo.enabled, 'editor': editor, 'field': fieldInfo.summary, 'format': fieldInfo.activeFormat, 'resizable': fieldInfo.resizable}, editorSettings); } else { + // Attach an instance of the 'none' editor to have consistency while the + // summary is hidden, then switch to a real editor instance when shown. + attachToField(context, {'status': false, 'editor': editor, 'field': fieldInfo.summary, 'format': fieldInfo.activeFormat, 'resizable': fieldInfo.resizable}, editorSettings); // Unbind any existing click handler to avoid double toggling. $('#' + fieldId).parents('.text-format-wrapper').find('.link-edit-summary').unbind('click.wysiwyg').bind('click.wysiwyg', function () { + detachFromField(context, {'status': false, 'editor': editor, 'field': fieldInfo.summary, 'format': fieldInfo.activeFormat, 'resizable': fieldInfo.resizable}, editorSettings); attachToField(context, {'status': fieldInfo.enabled, 'editor': editor, 'field': fieldInfo.summary, 'format': fieldInfo.activeFormat, 'resizable': fieldInfo.resizable}, editorSettings); $(this).unbind('click.wysiwyg'); }); @@ -392,6 +401,11 @@ Drupal.wysiwygDetach = function (context, fieldId, trigger) { if (fieldInfo.summary && Drupal.wysiwyg.instances[fieldInfo.summary]) { // The "Edit summary" click handler could re-enable the editor by mistake. $('#' + fieldId).parents('.text-format-wrapper').find('.link-edit-summary').unbind('click.wysiwyg'); + // Summary instances may have a different status if no real editor was + // attached yet because the field was hidden. + if (Drupal.wysiwyg.instances[fieldInfo.summary]) { + previousStatus = Drupal.wysiwyg.instances[fieldInfo.summary]['status']; + } detachFromField(context, {'editor': editor, 'status': previousStatus, 'field': fieldInfo.summary, 'resizable': fieldInfo.resizable}, trigger); if (trigger == 'unload') { attachToField(context, {'editor': editor, 'status': false, 'format': fieldInfo.activeFormat, 'field': fieldInfo.summary, 'resizable': fieldInfo.resizable}); diff --git a/profiles/wcm_base/modules/custom/ocio_search/README b/profiles/wcm_base/modules/custom/wcm_tile_panes/README.md similarity index 100% rename from profiles/wcm_base/modules/custom/ocio_search/README rename to profiles/wcm_base/modules/custom/wcm_tile_panes/README.md diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.field_base.inc b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.field_base.inc new file mode 100644 index 0000000000000000000000000000000000000000..b5d4fa077fe9dbc2c4e0a61b5b5448a10afef435 --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.field_base.inc @@ -0,0 +1,84 @@ +<?php +/** + * @file + * wcm_tile_panes.features.field_base.inc + */ + +/** + * Implements hook_field_default_field_bases(). + */ +function wcm_tile_panes_field_default_field_bases() { + $field_bases = array(); + + // Exported field_base: 'field_tile_background_img' + $field_bases['field_tile_background_img'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_tile_background_img', + 'indexes' => array( + 'fid' => array( + 0 => 'fid', + ), + ), + 'locked' => 0, + 'module' => 'image', + 'settings' => array( + 'default_image' => 0, + 'uri_scheme' => 'public', + ), + 'translatable' => 0, + 'type' => 'image', + ); + + // Exported field_base: 'field_tile_link' + $field_bases['field_tile_link'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_tile_link', + 'indexes' => array(), + 'locked' => 0, + 'module' => 'link', + 'settings' => array( + 'attributes' => array( + 'class' => '', + 'rel' => '', + 'target' => 'default', + ), + 'display' => array( + 'url_cutoff' => 80, + ), + 'enable_tokens' => 1, + 'title' => 'optional', + 'title_maxlength' => 128, + 'title_value' => '', + 'url' => 0, + ), + 'translatable' => 0, + 'type' => 'link_field', + ); + + // Exported field_base: 'field_tile_text_area' + $field_bases['field_tile_text_area'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_tile_text_area', + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'locked' => 0, + 'module' => 'text', + 'settings' => array(), + 'translatable' => 0, + 'type' => 'text_long', + ); + + return $field_bases; +} diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.field_instance.inc b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.field_instance.inc new file mode 100644 index 0000000000000000000000000000000000000000..924b3f32b00f4a82f043246f41c0eda44a7e36c4 --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.field_instance.inc @@ -0,0 +1,337 @@ +<?php +/** + * @file + * wcm_tile_panes.features.field_instance.inc + */ + +/** + * Implements hook_field_default_field_instances(). + */ +function wcm_tile_panes_field_default_field_instances() { + $field_instances = array(); + + // Exported field_instance: 'fieldable_panels_pane-tile_pane-field_tile_background_img' + $field_instances['fieldable_panels_pane-tile_pane-field_tile_background_img'] = array( + 'bundle' => 'tile_pane', + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'hidden', + 'module' => 'image', + 'settings' => array( + 'image_link' => '', + 'image_style' => 'tile_pane', + ), + 'type' => 'image', + 'weight' => 0, + ), + 'preview' => array( + 'label' => 'hidden', + 'module' => 'image', + 'settings' => array( + 'image_link' => '', + 'image_style' => 'tile_pane', + ), + 'type' => 'image', + 'weight' => 0, + ), + ), + 'ds_extras_field_template' => '', + 'entity_type' => 'fieldable_panels_pane', + 'field_name' => 'field_tile_background_img', + 'label' => 'Background Image', + 'required' => 0, + 'settings' => array( + 'alt_field' => 0, + 'default_image' => 0, + 'file_directory' => 'tile-images', + 'file_extensions' => 'png gif jpg jpeg', + 'max_filesize' => '', + 'max_resolution' => '', + 'min_resolution' => '', + 'title_field' => 0, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'media', + 'settings' => array( + 'allowed_schemes' => array( + 'public' => 'public', + 'vimeo' => 0, + 'youtube' => 0, + ), + 'allowed_types' => array( + 'audio' => 0, + 'document' => 0, + 'image' => 'image', + 'video' => 0, + ), + 'browser_plugins' => array( + 'media_default--media_browser_1' => 0, + 'media_default--media_browser_my_files' => 0, + 'media_internet' => 0, + 'upload' => 0, + 'youtube' => 0, + ), + 'manualcrop_crop_info' => 1, + 'manualcrop_default_crop_area' => 1, + 'manualcrop_enable' => 0, + 'manualcrop_inline_crop' => 0, + 'manualcrop_instant_crop' => FALSE, + 'manualcrop_instant_preview' => 1, + 'manualcrop_keyboard' => 1, + 'manualcrop_maximize_default_crop_area' => 0, + 'manualcrop_require_cropping' => array(), + 'manualcrop_styles_list' => array(), + 'manualcrop_styles_mode' => 'include', + 'manualcrop_thumblist' => 0, + ), + 'type' => 'media_generic', + 'weight' => -3, + ), + ); + + // Exported field_instance: 'fieldable_panels_pane-tile_pane-field_tile_link' + $field_instances['fieldable_panels_pane-tile_pane-field_tile_link'] = array( + 'bundle' => 'tile_pane', + 'default_value' => NULL, + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'hidden', + 'module' => 'link', + 'settings' => array(), + 'type' => 'link_plain', + 'weight' => 1, + ), + 'preview' => array( + 'label' => 'hidden', + 'module' => 'link', + 'settings' => array(), + 'type' => 'link_url', + 'weight' => 1, + ), + ), + 'ds_extras_field_template' => '', + 'entity_type' => 'fieldable_panels_pane', + 'field_name' => 'field_tile_link', + 'label' => 'Link', + 'required' => 0, + 'settings' => array( + 'absolute_url' => 1, + 'attributes' => array( + 'class' => '', + 'configurable_class' => 0, + 'configurable_title' => 0, + 'rel' => '', + 'target' => 'default', + 'title' => '', + ), + 'display' => array( + 'url_cutoff' => '', + ), + 'enable_tokens' => 1, + 'linkit' => array( + 'button_text' => 'Search', + 'enable' => 0, + 'profile' => '', + ), + 'rel_remove' => 'default', + 'title' => 'none', + 'title_label_use_field_label' => 0, + 'title_maxlength' => 128, + 'title_value' => '', + 'url' => 0, + 'user_register_form' => FALSE, + 'validate_url' => 1, + ), + 'widget' => array( + 'active' => 0, + 'module' => 'link', + 'settings' => array(), + 'type' => 'link_field', + 'weight' => -4, + ), + ); + + // Exported field_instance: 'fieldable_panels_pane-tile_pane_plus_text_area-field_tile_background_img' + $field_instances['fieldable_panels_pane-tile_pane_plus_text_area-field_tile_background_img'] = array( + 'bundle' => 'tile_pane_plus_text_area', + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'hidden', + 'module' => 'image', + 'settings' => array( + 'image_link' => '', + 'image_style' => 'tile_pane_plus', + ), + 'type' => 'image', + 'weight' => 1, + ), + ), + 'ds_extras_field_template' => '', + 'entity_type' => 'fieldable_panels_pane', + 'field_name' => 'field_tile_background_img', + 'label' => 'Background Image', + 'required' => 0, + 'settings' => array( + 'alt_field' => 0, + 'default_image' => 0, + 'file_directory' => 'tile-images', + 'file_extensions' => 'png gif jpg jpeg', + 'max_filesize' => '', + 'max_resolution' => '', + 'min_resolution' => '', + 'title_field' => 0, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'media', + 'settings' => array( + 'allowed_schemes' => array( + 'public' => 'public', + 'vimeo' => 0, + 'youtube' => 0, + ), + 'allowed_types' => array( + 'audio' => 0, + 'document' => 0, + 'image' => 'image', + 'video' => 0, + ), + 'browser_plugins' => array( + 'media_default--media_browser_1' => 0, + 'media_default--media_browser_my_files' => 0, + 'media_internet' => 0, + 'upload' => 0, + 'youtube' => 0, + ), + 'manualcrop_crop_info' => 1, + 'manualcrop_default_crop_area' => 1, + 'manualcrop_enable' => 0, + 'manualcrop_inline_crop' => 0, + 'manualcrop_instant_crop' => FALSE, + 'manualcrop_instant_preview' => 1, + 'manualcrop_keyboard' => 1, + 'manualcrop_maximize_default_crop_area' => 0, + 'manualcrop_require_cropping' => array(), + 'manualcrop_styles_list' => array(), + 'manualcrop_styles_mode' => 'include', + 'manualcrop_thumblist' => 0, + ), + 'type' => 'media_generic', + 'weight' => -1, + ), + ); + + // Exported field_instance: 'fieldable_panels_pane-tile_pane_plus_text_area-field_tile_link' + $field_instances['fieldable_panels_pane-tile_pane_plus_text_area-field_tile_link'] = array( + 'bundle' => 'tile_pane_plus_text_area', + 'default_value' => NULL, + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'hidden', + 'module' => 'link', + 'settings' => array(), + 'type' => 'link_default', + 'weight' => 0, + ), + ), + 'ds_extras_field_template' => '', + 'entity_type' => 'fieldable_panels_pane', + 'field_name' => 'field_tile_link', + 'label' => 'Link', + 'required' => 0, + 'settings' => array( + 'absolute_url' => 1, + 'attributes' => array( + 'class' => '', + 'configurable_class' => 0, + 'configurable_title' => 0, + 'rel' => '', + 'target' => 'user', + 'title' => '', + ), + 'display' => array( + 'url_cutoff' => '', + ), + 'enable_tokens' => 1, + 'linkit' => array( + 'button_text' => 'Search', + 'enable' => 0, + 'profile' => '', + ), + 'rel_remove' => 'default', + 'title' => 'none', + 'title_label_use_field_label' => 0, + 'title_maxlength' => 128, + 'title_value' => '', + 'url' => 0, + 'user_register_form' => FALSE, + 'validate_url' => 1, + ), + 'widget' => array( + 'active' => 0, + 'module' => 'link', + 'settings' => array(), + 'type' => 'link_field', + 'weight' => -3, + ), + ); + + // Exported field_instance: 'fieldable_panels_pane-tile_pane_plus_text_area-field_tile_text_area' + $field_instances['fieldable_panels_pane-tile_pane_plus_text_area-field_tile_text_area'] = array( + 'bundle' => 'tile_pane_plus_text_area', + 'default_value' => NULL, + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'hidden', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 2, + ), + ), + 'ds_extras_field_template' => '', + 'entity_type' => 'fieldable_panels_pane', + 'field_name' => 'field_tile_text_area', + 'label' => 'Text Area', + 'required' => 0, + 'settings' => array( + 'linkit' => array( + 'button_text' => 'Search', + 'enable' => 0, + 'profile' => '', + ), + 'text_processing' => 1, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'rows' => 3, + ), + 'type' => 'text_textarea', + 'weight' => 0, + ), + ); + + // Translatables + // Included for use with string extractors like potx. + t('Background Image'); + t('Link'); + t('Text Area'); + + return $field_instances; +} diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.fpp_bundles.inc b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.fpp_bundles.inc new file mode 100644 index 0000000000000000000000000000000000000000..315d6caac2b7326eea19702fd59e21e1bd019410 --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.fpp_bundles.inc @@ -0,0 +1,27 @@ +<?php +/** + * @file + * wcm_tile_panes.features.fpp_bundles.inc + */ + +/** + * Implements hook_fpp_bundles(). + */ +function wcm_tile_panes_fpp_bundles() { + return array( + 'tile_pane' => array( + 'name' => 'Tile Pane', + 'level' => 0, + 'machine' => 'tile_pane', + 'category' => 'Tile Panes', + 'assets' => 1, + ), + 'tile_pane_plus_text_area' => array( + 'name' => 'Tile Pane Plus Text Area', + 'level' => 0, + 'machine' => 'tile_pane_plus_text_area', + 'category' => 'Tile Panes', + 'assets' => 1, + ), + ); +} diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.inc b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.inc new file mode 100644 index 0000000000000000000000000000000000000000..22fb1526fef4dc4f063d577bf1665351d50eaf0a --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.inc @@ -0,0 +1,53 @@ +<?php +/** + * @file + * wcm_tile_panes.features.inc + */ + +/** + * Implements hook_ctools_plugin_api(). + */ +function wcm_tile_panes_ctools_plugin_api($module = NULL, $api = NULL) { + if ($module == "strongarm" && $api == "strongarm") { + return array("version" => "1"); + } +} + +/** + * Implements hook_image_default_styles(). + */ +function wcm_tile_panes_image_default_styles() { + $styles = array(); + + // Exported image style: tile_pane. + $styles['tile_pane'] = array( + 'label' => 'Tile Pane', + 'effects' => array( + 1 => array( + 'name' => 'image_scale_and_crop', + 'data' => array( + 'width' => 600, + 'height' => 520, + ), + 'weight' => 1, + ), + ), + ); + + // Exported image style: tile_pane_plus. + $styles['tile_pane_plus'] = array( + 'label' => 'Tile Pane Plus', + 'effects' => array( + 2 => array( + 'name' => 'image_scale_and_crop', + 'data' => array( + 'width' => 600, + 'height' => 400, + ), + 'weight' => 1, + ), + ), + ); + + return $styles; +} diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.user_permission.inc b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.user_permission.inc new file mode 100644 index 0000000000000000000000000000000000000000..4c96ce8bd2027bb9df39c62cd8dca8d7cfc49bf2 --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.features.user_permission.inc @@ -0,0 +1,78 @@ +<?php +/** + * @file + * wcm_tile_panes.features.user_permission.inc + */ + +/** + * Implements hook_user_default_permissions(). + */ +function wcm_tile_panes_user_default_permissions() { + $permissions = array(); + + // Exported permission: 'create fieldable tile_pane'. + $permissions['create fieldable tile_pane'] = array( + 'name' => 'create fieldable tile_pane', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'fieldable_panels_panes', + ); + + // Exported permission: 'create fieldable tile_pane_plus_text_area'. + $permissions['create fieldable tile_pane_plus_text_area'] = array( + 'name' => 'create fieldable tile_pane_plus_text_area', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'fieldable_panels_panes', + ); + + // Exported permission: 'delete fieldable tile_pane'. + $permissions['delete fieldable tile_pane'] = array( + 'name' => 'delete fieldable tile_pane', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + ), + 'module' => 'fieldable_panels_panes', + ); + + // Exported permission: 'delete fieldable tile_pane_plus_text_area'. + $permissions['delete fieldable tile_pane_plus_text_area'] = array( + 'name' => 'delete fieldable tile_pane_plus_text_area', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + ), + 'module' => 'fieldable_panels_panes', + ); + + // Exported permission: 'edit fieldable tile_pane'. + $permissions['edit fieldable tile_pane'] = array( + 'name' => 'edit fieldable tile_pane', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'fieldable_panels_panes', + ); + + // Exported permission: 'edit fieldable tile_pane_plus_text_area'. + $permissions['edit fieldable tile_pane_plus_text_area'] = array( + 'name' => 'edit fieldable tile_pane_plus_text_area', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'fieldable_panels_panes', + ); + + return $permissions; +} diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.info b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.info new file mode 100644 index 0000000000000000000000000000000000000000..45af651d6ef95958c099a07577ee9168f2ff42ec --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.info @@ -0,0 +1,37 @@ +name = WCM Tile Panes +description = Contains two types of tile panes to be used via panels on WCM sites. +core = 7.x +package = OCIO Features +version = 7.x-1.0 +project = wcm_tile_panes +dependencies[] = ctools +dependencies[] = features +dependencies[] = fieldable_panels_panes +dependencies[] = fpp_bundles +dependencies[] = image +dependencies[] = link +dependencies[] = strongarm +dependencies[] = text +features[ctools][] = strongarm:strongarm:1 +features[features_api][] = api:2 +features[field_base][] = field_tile_background_img +features[field_base][] = field_tile_link +features[field_base][] = field_tile_text_area +features[field_instance][] = fieldable_panels_pane-tile_pane-field_tile_background_img +features[field_instance][] = fieldable_panels_pane-tile_pane-field_tile_link +features[field_instance][] = fieldable_panels_pane-tile_pane_plus_text_area-field_tile_background_img +features[field_instance][] = fieldable_panels_pane-tile_pane_plus_text_area-field_tile_link +features[field_instance][] = fieldable_panels_pane-tile_pane_plus_text_area-field_tile_text_area +features[fpp_bundles][] = tile_pane +features[fpp_bundles][] = tile_pane_plus_text_area +features[image][] = tile_pane +features[image][] = tile_pane_plus +features[user_permission][] = create fieldable tile_pane +features[user_permission][] = create fieldable tile_pane_plus_text_area +features[user_permission][] = delete fieldable tile_pane +features[user_permission][] = delete fieldable tile_pane_plus_text_area +features[user_permission][] = edit fieldable tile_pane +features[user_permission][] = edit fieldable tile_pane_plus_text_area +features[variable][] = field_bundle_settings_fieldable_panels_pane__tile_pane +features[variable][] = field_bundle_settings_fieldable_panels_pane__tile_pane_plus_text_area +features_exclude[dependencies][media] = media diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.module b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.module new file mode 100644 index 0000000000000000000000000000000000000000..ce595bc8458d06f04c1b4071cac3592fe7acdc1b --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.module @@ -0,0 +1,7 @@ +<?php +/** + * @file + * Code for the WCM Tile Panes feature. + */ + +include_once 'wcm_tile_panes.features.inc'; diff --git a/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.strongarm.inc b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.strongarm.inc new file mode 100644 index 0000000000000000000000000000000000000000..832d6f6746c73d4864aa32f161a4457b66a57432 --- /dev/null +++ b/profiles/wcm_base/modules/custom/wcm_tile_panes/wcm_tile_panes.strongarm.inc @@ -0,0 +1,74 @@ +<?php +/** + * @file + * wcm_tile_panes.strongarm.inc + */ + +/** + * Implements hook_strongarm(). + */ +function wcm_tile_panes_strongarm() { + $export = array(); + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'field_bundle_settings_fieldable_panels_pane__tile_pane'; + $strongarm->value = array( + 'view_modes' => array( + 'full' => array( + 'custom_settings' => FALSE, + ), + 'preview' => array( + 'custom_settings' => FALSE, + ), + 'token' => array( + 'custom_settings' => FALSE, + ), + ), + 'extra_fields' => array( + 'form' => array(), + 'display' => array( + 'title' => array( + 'default' => array( + 'weight' => '2', + 'visible' => FALSE, + ), + ), + ), + ), + ); + $export['field_bundle_settings_fieldable_panels_pane__tile_pane'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'field_bundle_settings_fieldable_panels_pane__tile_pane_plus_text_area'; + $strongarm->value = array( + 'view_modes' => array( + 'full' => array( + 'custom_settings' => FALSE, + ), + 'preview' => array( + 'custom_settings' => FALSE, + ), + 'token' => array( + 'custom_settings' => FALSE, + ), + ), + 'extra_fields' => array( + 'form' => array(), + 'display' => array( + 'title' => array( + 'default' => array( + 'weight' => '-5', + 'visible' => FALSE, + ), + ), + ), + ), + ); + $export['field_bundle_settings_fieldable_panels_pane__tile_pane_plus_text_area'] = $strongarm; + + return $export; +} diff --git a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css index 23a8a701abf93da478a0654164322ef6ea06e8b2..30a0bc8df7cc7f56b06dee79b1bba7700169c78c 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css +++ b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css @@ -1320,14 +1320,6 @@ body .ui-accordion .ui-accordion-content { padding: 0.5em 1.9em; } -.view .date-nav-wrapper ul.pager { - list-style: none; -} -.view .date-nav-wrapper ul.pager .date-prev a, -.view .date-nav-wrapper ul.pager .date-next a { - padding: 1em; -} - /* Clean this up sometime soon :) */ .view-faq.view-faq.view-display-id-page .item-list ul { padding-left: 0; @@ -1499,6 +1491,97 @@ h2.pane-title { line-height: 120%; } +.panel-pane.pane-bundle-tile-pane { + background: #b00; + padding: 0; +} +.panel-pane.pane-bundle-tile-pane:hover { + opacity: 0.9; +} +.panel-pane.pane-bundle-tile-pane a { + text-decoration: none; + color: #fff; +} +.panel-pane.pane-bundle-tile-pane a:visited { + color: #fff; +} +.panel-pane.pane-bundle-tile-pane a:focus { + color: #92b0d7; +} +.panel-pane.pane-bundle-tile-pane a:hover { + color: #ececec; +} +.panel-pane.pane-bundle-tile-pane a:active { + color: #666666; +} +.panel-pane.pane-bundle-tile-pane h2 { + font-size: 24px; + font-size: 2.4rem; + font-weight: 400; + padding: 0.5em 0.8em 0.7em 0.8em; + margin-top: 0; +} + +.panel-pane.pane-bundle-tile-pane-plus-text-area { + background: #ececec; + padding: 0; + text-align: center; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area:hover { + opacity: 0.9; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area img { + border-bottom: 4px solid #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area .text-areas { + padding: 1em; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area .text-areas:hover { + opacity: 0.85; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a { + text-decoration: none; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2 { + font-size: 24px; + font-size: 2.4rem; + font-weight: 600; + margin-top: 0; + text-decoration: none; + color: #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:visited { + color: #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:focus { + color: #92b0d7; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:hover { + color: #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:active { + color: #2d2d2d; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p { + font-size: 13px; + font-size: 1.3rem; + line-height: 150%; + color: #2d2d2d; + margin: 0.6em 0; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:visited { + color: #2d2d2d; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:focus { + color: #92b0d7; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:hover { + color: #2d2d2d; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:active { + color: #b00; +} + .more-link, .field--name-node-link { font-size: 15px; font-size: 1.5rem; diff --git a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css index e1b2cb60aa0bc71a979db6b3b4dfadfd64610817..3806eb694285b0da97f099f44a77aa77b7f5ca57 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css +++ b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css @@ -1336,14 +1336,6 @@ body .ui-accordion .ui-accordion-content { padding: 0.5em 1.9em; } -.view .date-nav-wrapper ul.pager { - list-style: none; -} -.view .date-nav-wrapper ul.pager .date-prev a, -.view .date-nav-wrapper ul.pager .date-next a { - padding: 1em; -} - /* Clean this up sometime soon :) */ .view-faq.view-faq.view-display-id-page .item-list ul { padding-left: 0; @@ -1523,6 +1515,97 @@ h2.pane-title { line-height: 120%; } +.panel-pane.pane-bundle-tile-pane { + background: #b00; + padding: 0; +} +.panel-pane.pane-bundle-tile-pane:hover { + opacity: 0.9; +} +.panel-pane.pane-bundle-tile-pane a { + text-decoration: none; + color: #fff; +} +.panel-pane.pane-bundle-tile-pane a:visited { + color: #fff; +} +.panel-pane.pane-bundle-tile-pane a:focus { + color: #92b0d7; +} +.panel-pane.pane-bundle-tile-pane a:hover { + color: #ececec; +} +.panel-pane.pane-bundle-tile-pane a:active { + color: #666666; +} +.panel-pane.pane-bundle-tile-pane h2 { + font-size: 24px; + font-size: 2.4rem; + font-weight: 400; + padding: 0.5em 0.8em 0.7em 0.8em; + margin-top: 0; +} + +.panel-pane.pane-bundle-tile-pane-plus-text-area { + background: #ececec; + padding: 0; + text-align: center; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area:hover { + opacity: 0.9; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area img { + border-bottom: 4px solid #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area .text-areas { + padding: 1em; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area .text-areas:hover { + opacity: 0.85; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a { + text-decoration: none; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2 { + font-size: 24px; + font-size: 2.4rem; + font-weight: 600; + margin-top: 0; + text-decoration: none; + color: #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:visited { + color: #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:focus { + color: #92b0d7; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:hover { + color: #b00; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a h2:active { + color: #2d2d2d; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p { + font-size: 13px; + font-size: 1.3rem; + line-height: 150%; + color: #2d2d2d; + margin: 0.6em 0; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:visited { + color: #2d2d2d; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:focus { + color: #92b0d7; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:hover { + color: #2d2d2d; +} +.panel-pane.pane-bundle-tile-pane-plus-text-area a p:active { + color: #b00; +} + .more-link, .field--name-node-link { font-size: 15px; font-size: 1.5rem; diff --git a/profiles/wcm_base/themes/ocio_omega_base/panels/ocio-omega-threecol.css b/profiles/wcm_base/themes/ocio_omega_base/panels/ocio-omega-threecol.css index 87fb4e7e839efa1aad6d05f17c7f21f665c1f3ee..bf977815f199425b989944ee68edaa4f6d792738 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/panels/ocio-omega-threecol.css +++ b/profiles/wcm_base/themes/ocio_omega_base/panels/ocio-omega-threecol.css @@ -9,16 +9,16 @@ .ocio-omega-threecol-column-content-region { min-height: 1px; - width: 34.043%; + width: 33.00%; float: left; } .ocio-omega-threecol-column-content-region-inner { - margin-right: 20px; + margin-right: 0; } .ocio-omega-threecol-column3 { - width: 31.915%; + width: 33.00%; } .ocio-omega-threecol-column3-inner { diff --git a/profiles/wcm_base/themes/ocio_omega_base/sass/components/_panels.scss b/profiles/wcm_base/themes/ocio_omega_base/sass/components/_panels.scss index bff183a1d62f77b41599a30c66b8751d2e71de3d..5d8e04fd334690510e8d2e3b2a42bc1f3f5df9d4 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/sass/components/_panels.scss +++ b/profiles/wcm_base/themes/ocio_omega_base/sass/components/_panels.scss @@ -12,3 +12,68 @@ h2.pane-title { @extend .header-links; } } + + +//custom tile panes + +.panel-pane.pane-bundle-tile-pane { + background: $red; + padding:0; + + &:hover { + opacity: (.90); + } + + a { + text-decoration: none; + @include link-colors($white, $lt-gray, $md-gray, $white, $blue); + } + + h2 { + @include font-size(2.4); + font-weight: 400; + padding: 0.5em 0.8em 0.7em 0.8em; + margin-top: 0; + } +} + +.panel-pane.pane-bundle-tile-pane-plus-text-area { + background: $lt-gray; + padding:0; + text-align: center; + + &:hover { + opacity: (.90); + } + + img { + border-bottom: 4px solid $red; + } + + .text-areas { + padding: 1em; + + &:hover { + opacity: (.85); + } + } + + a { + text-decoration: none; + + h2 { + @include font-size(2.4); + font-weight: 600; + margin-top: 0; + text-decoration: none; + @include link-colors($red, $red, $dk-gray, $red, $blue); + } + + p { + @include font-size(1.3); + line-height: 150%; + @include link-colors($dk-gray, $dk-gray, $red, $dk-gray, $blue); + margin: 0.6em 0; + } + } +} \ No newline at end of file diff --git a/profiles/wcm_base/themes/ocio_omega_base/template.php b/profiles/wcm_base/themes/ocio_omega_base/template.php index 24241dce8913dd3f6af658452c699b8780b8c919..1ef89be2382add9eeb14cf94d5f2fe9d83fbc35e 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/template.php +++ b/profiles/wcm_base/themes/ocio_omega_base/template.php @@ -98,3 +98,15 @@ function ocio_omega_base_omega_theme_libraries_info() { return $libraries; } + + +/** + * Create variables for custom panels panes created via FPP + ** + * Implements hook_preprocess_fieldable_panels_pane(). + */ + +function ocio_omega_base_preprocess_fieldable_panels_pane(&$vars) { + $vars['tile_title'] = $vars['content']['title']['#value']; + $vars['tile_url'] = $vars['content']['field_tile_link']['#items'][0]['url']; +} \ No newline at end of file diff --git a/profiles/wcm_base/themes/ocio_omega_base/templates/panes/fieldable-panels-pane--tile-pane-plus-text-area.tpl.php b/profiles/wcm_base/themes/ocio_omega_base/templates/panes/fieldable-panels-pane--tile-pane-plus-text-area.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..c56158fe94c70e4596107d5a29e9dbe05c7e4355 --- /dev/null +++ b/profiles/wcm_base/themes/ocio_omega_base/templates/panes/fieldable-panels-pane--tile-pane-plus-text-area.tpl.php @@ -0,0 +1,8 @@ +<a href="<?php print $tile_url; ?>"> + <?php print render($content['field_tile_background_img']); ?> + + <div class="text-areas"> + <h2><?php print $tile_title; ?></h2> + <?php print render($content['field_tile_text_area']); ?> + </div> +</a> \ No newline at end of file diff --git a/profiles/wcm_base/themes/ocio_omega_base/templates/panes/fieldable-panels-pane--tile-pane.tpl.php b/profiles/wcm_base/themes/ocio_omega_base/templates/panes/fieldable-panels-pane--tile-pane.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..9e66220c49c5dcb4a2e0f1f41b1c252cdeab3d08 --- /dev/null +++ b/profiles/wcm_base/themes/ocio_omega_base/templates/panes/fieldable-panels-pane--tile-pane.tpl.php @@ -0,0 +1,4 @@ +<a href="<?php print $tile_url; ?>"> + <?php print render($content['field_tile_background_img']); ?> + <h2><?php print $tile_title; ?></h2> +</a> \ No newline at end of file diff --git a/profiles/wcm_base/wcm_base.make b/profiles/wcm_base/wcm_base.make index d65f6bad58c2e7297cbf8f951a147cec2f401ece..e61d29222de019f0cc0eaa3727acc1ed48c612e6 100644 --- a/profiles/wcm_base/wcm_base.make +++ b/profiles/wcm_base/wcm_base.make @@ -38,6 +38,9 @@ projects[features][patch][986968] = https://drupal.org/files/issues/export_shorc projects[features_extra][version] = 1.0-beta1 projects[features_extra][subdir] = contrib +projects[fpp_bundles][version] = 1.4 +projects[fpp_bundles][subdir] = contrib + projects[media][version] = 2.x-dev projects[media][subdir] = contrib projects[media][download][type] = git @@ -276,6 +279,14 @@ projects[ocio_wysiwyg][download][type] = "git" projects[ocio_wysiwyg][download][url] = git@code.osu.edu:ocio_odee_web/ocio_wysiwyg.git projects[ocio_wysiwyg][download][branch] = 7.x-1.x +projects[wcm_tile_panes][type] = module +projects[wcm_tile_panes][subdir] = custom +projects[wcm_tile_panes][download][type] = "git" +projects[wcm_tile_panes][download][url] = git@code.osu.edu:ocio_odee_web/wcm_tile_panes.git +projects[wcm_tile_panes][download][branch] = 7.x-1.x + + + ;themes projects[ocio_omega_base][type] = theme