diff --git a/profiles/wcm_base/CHANGELOG.txt b/profiles/wcm_base/CHANGELOG.txt index b2d81c380e2cc5802554dd2f48d95967c2cd525b..0cd11f625b39c9c3fd18eda4f68bcac2f59b70b4 100644 --- a/profiles/wcm_base/CHANGELOG.txt +++ b/profiles/wcm_base/CHANGELOG.txt @@ -1,3 +1,9 @@ +WCM Base 7.x-1.x, 2016-02-02 +----------------------------- +- WCM Base: + - Added r4032login module, redirects Access Denied requests to login page. + - Added Chosen module, allowing read-only jQuery multiselect field formats. + WCM Base 7.x-1.x, 2016-02-01 ----------------------------- - WCM Base: Added Private module patch that prevents non-privileged diff --git a/profiles/wcm_base/modules/contrib/chosen/LICENSE.txt b/profiles/wcm_base/modules/contrib/chosen/LICENSE.txt new file mode 100755 index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/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/chosen/README.txt b/profiles/wcm_base/modules/contrib/chosen/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..658c4e0cc7929f574979805485739987c2a060b3 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/README.txt @@ -0,0 +1,32 @@ +-- SUMMARY -- + +Chosen uses the Chosen jQuery plugin to make your <select> elements more user-friendly. + + +-- INSTALLATION -- + + 1. Download the Chosen jQuery plugin (http://harvesthq.github.io/chosen/ version 1.1.0 is recommended) and extract the file under sites/all/libraries. + 2. Download and enable the module. + 3. Configure at Administer > Configuration > User interface > Chosen (requires administer site configuration permission) + +-- INSTALLATION VIA DRUSH -- + + A Drush command is provided for easy installation of the Chosen plugin. + + drush chosenplugin + + The command will download the plugin and unpack it in "sites/all/libraries". + It is possible to add another path as an option to the command, but not + recommended unless you know what you are doing. + +-- ACCESSIBILITY CONCERN -- + +There are accessibility problems with the main library as identified here: + https://github.com/harvesthq/chosen/issues/264 + +-- TROUBLE SHOOTING -- + + How to exlude a select field from becoming a chosen select. + - go to the configuration page and add your field using the jquery "not" + operator to the textarea with the comma seperated values. + For date fields this could look like: select:not([name*='day'],[name*='year'],[name*='month']) diff --git a/profiles/wcm_base/modules/contrib/chosen/UPDATE.txt b/profiles/wcm_base/modules/contrib/chosen/UPDATE.txt new file mode 100644 index 0000000000000000000000000000000000000000..df72429b5070eaea3c633fe0e77ab7cadb74df26 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/UPDATE.txt @@ -0,0 +1,8 @@ +-- UPDATING NOTES -- + +Everyone who upgrades from 1.x version or updates from alpha 2.x or dev +version before 28.07.2013 has to make sure of the following changes: +Chosen 1.1.0 has been released, this is the version chosen.module is using +since now. You can use the make file to download the recommended version or +replace it by your self. Note that the path changed from +libraries/chosen/chosen to libraries/chosen. diff --git a/profiles/wcm_base/modules/contrib/chosen/chosen.admin.inc b/profiles/wcm_base/modules/contrib/chosen/chosen.admin.inc new file mode 100644 index 0000000000000000000000000000000000000000..188c173082798489f8a0538a7bf63575cf834c30 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/chosen.admin.inc @@ -0,0 +1,110 @@ +<?php + +/** + * @file + * Chosen administration pages. + */ + +/** + * Returns with the general configuration form. + */ +function chosen_admin_settings($form, &$form_state) { + + $chosen_path = chosen_get_chosen_path(); + if (!$chosen_path) { + drupal_set_message(t('The library could not be detected. You need to download the !chosen and extract the entire contents of the archive into the %path directory on your server.', + array('!chosen' => l(t('Chosen JavaScript file'), CHOSEN_WEBSITE_URL), '%path' => 'sites/all/libraries') + ), 'error'); + return; + } + + $form['chosen_minimum_single'] = array( + '#type' => 'select', + '#title' => t('Minimum number of options for single select'), + '#options' => array_merge(array('0' => t('Always apply')), drupal_map_assoc(range(1, 25))), + '#default_value' => variable_get('chosen_minimum_single', 20), + '#description' => t('The minimum number of options to apply Chosen for single select fields. Example : choosing 10 will only apply Chosen if the number of options is greater or equal to 10.'), + ); + + $form['chosen_minimum_multiple'] = array( + '#type' => 'select', + '#title' => t('Minimum number of options for multi select'), + '#options' => array_merge(array('0' => t('Always apply')), drupal_map_assoc(range(1, 25))), + '#default_value' => variable_get('chosen_minimum_multiple', 20), + '#description' => t('The minimum number of options to apply Chosen for multi select fields. Example : choosing 10 will only apply Chosen if the number of options is greater or equal to 10.'), + ); + + $form['chosen_disable_search_threshold'] = array( + '#type' => 'select', + '#title' => t('Minimum number to show Search on Single Select'), + '#options' => array_merge(array('0' => t('Never apply')), drupal_map_assoc(range(1, 25))), + '#default_value' => variable_get('chosen_disable_search_threshold', 0), + '#description' => t('The minimum number of options to apply Chosen search box. Example : choosing 10 will only apply Chosen search if the number of options is greater or equal to 10.'), + ); + + $form['chosen_minimum_width'] = array( + '#type' => 'textfield', + '#title' => t('Minimum width of widget'), + '#field_suffix' => 'px', + '#required' => TRUE, + '#size' => 3, + '#default_value' => variable_get('chosen_minimum_width', 200), + '#description' => t('The minimum width of the Chosen widget.'), + ); + + $form['chosen_jquery_selector'] = array( + '#type' => 'textarea', + '#title' => t('Apply Chosen to the following elements'), + '#description' => t('A comma-separated list of jQuery selectors to apply Chosen to, such as <code>select#edit-operation, select#edit-type</code> or <code>.chosen-select</code>. Defaults to <code>select</code> to apply Chosen to all <code><select></code> elements.'), + '#default_value' => variable_get('chosen_jquery_selector', 'select:visible'), + ); + + $form['options'] = array( + '#type' => 'fieldset', + '#title' => t('Chosen options'), + ); + $form['options']['chosen_search_contains'] = array( + '#type' => 'checkbox', + '#title' => t('Search also in the middle of words'), + '#default_value' => variable_get('chosen_search_contains', FALSE), + '#description' => t('Per default chosen searches only at beginning of words. Enable this option will also find results in the middle of words. + Example: Search for <em>land</em> will also find <code>Switzer<strong>land</strong></code>.'), + ); + $form['options']['chosen_disable_search'] = array( + '#type' => 'checkbox', + '#title' => t('Disable search box'), + '#default_value' => variable_get('chosen_disable_search', FALSE), + '#description' => t('Enable or disable the search box in the results list to filter out possible options.'), + ); + $form['options']['chosen_use_theme'] = array( + '#type' => 'checkbox', + '#title' => t('Use the default chosen theme'), + '#default_value' => variable_get('chosen_use_theme', TRUE), + '#description' => t('Enable or disable the default chosen CSS file. Disable this option if your theme contains custom styles for Chosen replacements.'), + ); + + $form['strings'] = array( + '#type' => 'fieldset', + '#title' => t('Chosen strings'), + ); + $form['strings']['chosen_placeholder_text_multiple'] = array( + '#type' => 'textfield', + '#title' => t('Placeholder text of multiple selects'), + '#required' => TRUE, + '#default_value' => variable_get('chosen_placeholder_text_multiple', 'Choose some options'), + ); + $form['strings']['chosen_placeholder_text_single'] = array( + '#type' => 'textfield', + '#title' => t('Placeholder text of single selects'), + '#required' => TRUE, + '#default_value' => variable_get('chosen_placeholder_text_single', 'Choose an option'), + ); + $form['strings']['chosen_no_results_text'] = array( + '#type' => 'textfield', + '#title' => t('No results text'), + '#required' => TRUE, + '#default_value' => variable_get('chosen_no_results_text', 'No results match'), + ); + + return system_settings_form($form); +} diff --git a/profiles/wcm_base/modules/contrib/chosen/chosen.info b/profiles/wcm_base/modules/contrib/chosen/chosen.info new file mode 100644 index 0000000000000000000000000000000000000000..98ff7b3eb0e7a33ffa4f126894bcf7fdd7426b61 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/chosen.info @@ -0,0 +1,12 @@ +name = Chosen +description = Makes select elements more user-friendly using <a href="http://harvesthq.github.com/chosen/">Chosen</a>. +package = User interface +configure = admin/config/user-interface/chosen +core = 7.x + +; Information added by Drupal.org packaging script on 2014-03-08 +version = "7.x-2.0-beta4" +core = "7.x" +project = "chosen" +datestamp = "1394256505" + diff --git a/profiles/wcm_base/modules/contrib/chosen/chosen.install b/profiles/wcm_base/modules/contrib/chosen/chosen.install new file mode 100644 index 0000000000000000000000000000000000000000..71ec7933d9d6aa6409f9a68e88df395ec75bcf8f --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/chosen.install @@ -0,0 +1,99 @@ +<?php +/** + * @file + * Installation and uninstallation functions. + */ + +/** + * Implements hook_requirements(). + */ +function chosen_requirements($phase) { + $requirements = array(); + module_load_include('module', 'chosen'); + $t = get_t(); + $chosen_path = chosen_get_chosen_path(); + switch($phase) { + case 'runtime': + if (!$chosen_path) { + $requirements['chosen_js'] = array( + 'title' => $t('Chosen JavaScript file'), + 'severity' => REQUIREMENT_ERROR, + 'description' => $t('You need to download the !chosen and extract the entire contents of the archive into the %path directory on your server.', array('!chosen' => l($t('Chosen JavaScript file'), CHOSEN_WEBSITE_URL), '%path' => 'sites/all/libraries')), + 'value' => $t('Not Installed'), + ); + } + else { + $requirements['chosen_js'] = array( + 'title' => $t('Chosen JavaScript file'), + 'severity' => REQUIREMENT_OK, + 'value' => $t('Installed'), + ); + } + break; + } + return $requirements; +} + +/** + * Implements hook_uninstall(). + */ +function chosen_uninstall() { + // Delete created variables. + variable_del('chosen_minimum_single'); + variable_del('chosen_minimum_multiple'); + variable_del('chosen_minimum_width'); + variable_del('chosen_search_contains'); + variable_del('chosen_jquery_selector'); + variable_del('chosen_placeholder_text_multiple'); + variable_del('chosen_placeholder_text_single'); + variable_del('chosen_no_results_text'); + variable_del('chosen_use_theme'); + variable_del('chosen_disable_search'); + variable_del('chosen_disable_search_threshold'); +} + +/** + * Transfer the old chosen minimum value to the new chosen minimum single and + * chosen minimum multiple variables. + */ +function chosen_update_7201() { + $chosen_minimum = variable_get('chosen_minimum', 20); + variable_set('chosen_minimum_single', $chosen_minimum); + variable_set('chosen_minimum_multiple', $chosen_minimum); + variable_del('chosen_minimum'); +} + +/** + * Fix variables that should be integers and not strings. + */ +function chosen_update_7202() { + $variables = array( + 'chosen_minimum_single', + 'chosen_minimum_multiple', + 'chosen_disable_search_threshold', + ); + foreach ($variables as $variable) { + $value = variable_get($variable, 0); + if (!is_numeric($value)) { + variable_set($variable, 0); + } + } +} + +/** + * Update any option_select widgets with an empty Chosen setting to the 'No preference' Chosen setting. + */ +function chosen_update_7203() { + $field_names = db_query("SELECT field_name FROM {field_config_instance} WHERE data LIKE :widget", array(':widget' => '%' . db_like('options_select') . '%' . db_like('apply_chosen') . '%'))->fetchCol(); + if (empty($field_names)) { + return; + } + + $instances = field_read_instances(array('field_name' => $field_names)); + foreach ($instances as $instance) { + if ($instance['widget']['type'] == 'options_select' && empty($instance['widget']['settings']['apply_chosen'])) { + $instance['widget']['settings']['apply_chosen'] = ''; + field_update_instance($instance); + } + } +} diff --git a/profiles/wcm_base/modules/contrib/chosen/chosen.js b/profiles/wcm_base/modules/contrib/chosen/chosen.js new file mode 100644 index 0000000000000000000000000000000000000000..c7731c228ce35f809471b113fd964eec3460c86b --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/chosen.js @@ -0,0 +1,64 @@ +(function($) { + Drupal.behaviors.chosen = { + attach: function(context, settings) { + settings.chosen = settings.chosen || Drupal.settings.chosen; + + // Prepare selector and add unwantend selectors. + var selector = settings.chosen.selector; + + // Function to prepare all the options together for the chosen() call. + var getElementOptions = function (element) { + var options = $.extend({}, settings.chosen.options); + + // The width default option is considered the minimum width, so this + // must be evaluated for every option. + if ($(element).width() < settings.chosen.minimum_width) { + options.width = settings.chosen.minimum_width + 'px'; + } + else { + options.width = $(element).width() + 'px'; + } + + // Some field widgets have cardinality, so we must respect that. + // @see chosen_pre_render_select() + if ($(element).attr('multiple') && $(element).data('cardinality')) { + options.max_selected_options = $(element).data('cardinality'); + } + + return options; + }; + + // Process elements that have opted-in for Chosen. + // @todo Remove support for the deprecated chosen-widget class. + $('select.chosen-enable, select.chosen-widget', context).once('chosen', function() { + options = getElementOptions(this); + $(this).chosen(options); + }); + + $(selector, context) + // Disabled on: + // - Field UI + // - WYSIWYG elements + // - Tabledrag weights + // - Elements that have opted-out of Chosen + // - Elements already processed by Chosen + .not('#field-ui-field-overview-form select, #field-ui-display-overview-form select, .wysiwyg, .draggable select[name$="[weight]"], .draggable select[name$="[position]"], .chosen-disable, .chosen-processed') + .filter(function() { + // Filter out select widgets that do not meet the minimum number of + // options. + var minOptions = $(this).attr('multiple') ? settings.chosen.minimum_multiple : settings.chosen.minimum_single; + if (!minOptions) { + // Zero value means no minimum. + return true; + } + else { + return $(this).find('option').length >= minOptions; + } + }) + .once('chosen', function() { + options = getElementOptions(this); + $(this).chosen(options); + }); + } + }; +})(jQuery); diff --git a/profiles/wcm_base/modules/contrib/chosen/chosen.make.example b/profiles/wcm_base/modules/contrib/chosen/chosen.make.example new file mode 100644 index 0000000000000000000000000000000000000000..25ecb1833641653018cc50910304eb10b5525b9b --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/chosen.make.example @@ -0,0 +1,7 @@ +core = 7.x +api = 2 + +libraries[chosen][download][type] = "get" +libraries[chosen][download][url] = "https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip" +libraries[chosen][directory_name] = "chosen" +libraries[chosen][destination] = "libraries" diff --git a/profiles/wcm_base/modules/contrib/chosen/chosen.module b/profiles/wcm_base/modules/contrib/chosen/chosen.module new file mode 100644 index 0000000000000000000000000000000000000000..e54378dc28769b856ca530b35f41ae1aaaab84ac --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/chosen.module @@ -0,0 +1,284 @@ +<?php + +/** + * @file + * General functions and hook implementations. + * + * @see http://harvesthq.github.com/chosen/ + */ + +/** + * Define chosen library url + */ +define('CHOSEN_WEBSITE_URL', 'http://harvesthq.github.io/chosen'); + +/** + * Implements hook_menu(). + */ +function chosen_menu() { + $items = array(); + + $items['admin/config/user-interface/chosen'] = array( + 'title' => 'Chosen', + 'description' => 'Configuration for Chosen plugin', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('chosen_admin_settings'), + 'access arguments' => array('administer site configuration'), + 'file' => 'chosen.admin.inc', + ); + + return $items; +} + +/** + * Implements hook_field_widget_info_alter(). + * + * A list of settings needed by Chosen module for widgets. + */ +function chosen_field_widget_info_alter(&$info) { + $widget_defaults = array( + 'options_select' => '', + 'select_or_other' => '', + 'date_combo' => 0, + ); + + foreach ($widget_defaults as $widget => $default) { + if (isset($info[$widget])) { + $info[$widget]['settings']['apply_chosen'] = $default; + } + } +} + +/** + * Implements hook_form_FORM_ID_alter(). + */ +function chosen_form_field_ui_field_edit_form_alter(&$form, $form_state) { + if (empty($form['#field']['locked']) && isset($form['#instance']['widget']['settings']['apply_chosen'])) { + $form['instance']['widget']['settings']['apply_chosen'] = array( + '#type' => 'select', + '#title' => t('Apply Chosen to the select fields in this widget?'), + '#options' => array( + 0 => t('Do not apply'), + 1 => t('Apply'), + ), + '#default_value' => $form['#instance']['widget']['settings']['apply_chosen'], + '#disabled' => !chosen_get_chosen_path(), + '#empty_option' => t('No preference'), + '#empty_value' => '', + '#chosen' => FALSE, + ); + } +} + +/** + * Implements hook_field_widget_form_alter(). + */ +function chosen_field_widget_form_alter(&$element, &$form_state, $context) { + if (isset($context['instance']['widget']['settings']['apply_chosen'])) { + $value = $context['instance']['widget']['settings']['apply_chosen']; + if ($value === '') { + return; + } + else { + $element['#chosen'] = !empty($value); + } + } +} + +/** + * Implements hook_library(). + */ +function chosen_library() { + $library_path = chosen_get_chosen_path(); + + $info['chosen'] = array( + 'title' => 'Chosen', + 'website' => CHOSEN_WEBSITE_URL, + 'version' => '1.1.0', + 'js' => array( + $library_path . '/chosen.jquery.min.js' => array('group' => 'JS_LIBRARY'), + ), + ); + if (variable_get('chosen_use_theme', TRUE)) { + $info['chosen']['css'] = array($library_path . '/chosen.css' => array()); + } + + // All the settings that are actually passed through into the chosen() + // function are contained in this array. + $options = array( + 'disable_search' => (bool) variable_get('chosen_disable_search', FALSE), + 'disable_search_threshold' => (int) variable_get('chosen_disable_search_threshold', 0), + 'search_contains' => (bool) variable_get('chosen_search_contains', FALSE), + 'placeholder_text_multiple' => variable_get('chosen_placeholder_text_multiple', t('Choose some options')), + 'placeholder_text_single' => variable_get('chosen_placeholder_text_single', t('Choose an option')), + 'no_results_text' => variable_get('chosen_no_results_text', t('No results match')), + 'inherit_select_classes' => TRUE, + ); + + $module_path = drupal_get_path('module', 'chosen'); + $info['drupal.chosen'] = array( + 'title' => 'Drupal Chosen integration', + 'website' => 'https://drupal.org/project/chosen', + 'version' => '1.1.0', + 'js' => array( + $module_path . '/chosen.js' => array( + 'group' => JS_DEFAULT, + 'weight' => 100, + ), + array( + 'data' => array( + 'chosen' => array( + 'selector' => variable_get('chosen_jquery_selector', 'select:visible'), + 'minimum_single' => (int) variable_get('chosen_minimum_single', 20), + 'minimum_multiple' => (int) variable_get('chosen_minimum_multiple', 20), + 'minimum_width' => (int) variable_get('chosen_minimum_width', 200), + 'options' => $options, + ), + ), + 'type' => 'setting', + ), + ), + 'css' => array( + $module_path . '/css/chosen-drupal.css' => array(), + ), + 'dependencies' => array( + array('system', 'jquery.once'), + array('chosen', 'chosen'), + ), + ); + + return $info; +} + +/** + * Implements hook_element_info_alter(). + */ +function chosen_element_info_alter(&$info) { + $info['select']['#pre_render'][] = 'chosen_pre_render_select'; + + if (module_exists('date')) { + $info['date_combo']['#pre_render'][] = 'chosen_pre_render_date_combo'; + } + + if (module_exists('select_or_other')) { + $info['select_or_other']['#pre_render'][] = 'chosen_pre_render_select_or_other'; + } +} + +/** + * Render API callback: Apply Chosen to a select element. + */ +function chosen_pre_render_select($element) { + // If the #chosen FAPI property is set, then add the appropriate class. + if (isset($element['#chosen'])) { + if (!empty($element['#chosen'])) { + // Element has opted-in for Chosen, ensure the library gets added. + $element['#attributes']['class'][] = 'chosen-enable'; + } + else { + $element['#attributes']['class'][] = 'chosen-disable'; + // Element has opted-out of Chosen. Do not add the library now. + return $element; + } + } + elseif (isset($element['#attributes']['class']) && is_array($element['#attributes']['class'])) { + if (array_intersect($element['#attributes']['class'], array('chosen-disable'))) { + // Element has opted-out of Chosen. Do not add the library now. + return $element; + } + elseif (array_intersect($element['#attributes']['class'], array('chosen-enable', 'chosen-widget'))) { + // Element has opted-in for Chosen, ensure the library gets added. + // @todo Remove support for the deprecated chosen-widget class. + } + } + else { + // Neither the #chosen property was set, nor any chosen classes found. + // This element still might match the site-wide critera, so add the library. + } + + if (isset($element['#field_name']) && !empty($element['#multiple'])) { + $field = field_info_field($element['#field_name']); + if ($field['cardinality'] != FIELD_CARDINALITY_UNLIMITED && $field['cardinality'] > 1) { + $element['#attributes']['data-cardinality'] = $field['cardinality']; + } + } + + $element['#attached']['library'][] = array('chosen', 'drupal.chosen'); + return $element; +} + +/** + * Render API callback: Apply Chosen to a date_combo element. + */ +function chosen_pre_render_date_combo($element) { + // Because the date_combo field contains many different select elements, we + // need to recurse down and apply the FAPI property to each one. + if (isset($element['#chosen'])) { + chosen_element_apply_property_recursive($element, $element['#chosen']); + } + return $element; +} + +/** + * Render API callback: Apply Chosen to a select_or_other element. + */ +function chosen_pre_render_select_or_other($element) { + if ($element['#select_type'] == 'select' && isset($element['#chosen'])) { + $element['select']['#chosen'] = $element['#chosen']; + } + return $element; +} + +/** + * Recurse through an element to apply the chosen property to any select fields. + */ +function chosen_element_apply_property_recursive(array &$element, $chosen_value = NULL) { + if (!isset($chosen_value)) { + if (isset($element['#chosen'])) { + $chosen_value = $element['#chosen']; + } + else { + return; + } + } + if (isset($element['#type']) && $element['#type'] == 'select') { + $element['#chosen'] = $chosen_value; + } + foreach (element_children($element) as $key) { + chosen_element_apply_property_recursive($element[$key], $chosen_value); + } +} + +/** + * Get the location of the chosen library. + * + * @return + * The location of the library, or FALSE if the library isn't installed. + */ +function chosen_get_chosen_path() { + if (function_exists('libraries_get_path')) { + return libraries_get_path('chosen'); + } + + // The following logic is taken from libraries_get_libraries() + $searchdir = array(); + + // Similar to 'modules' and 'themes' directories inside an installation + // profile, installation profiles may want to place libraries into a + // 'libraries' directory. + $searchdir[] = 'profiles/' . drupal_get_profile() . '/libraries'; + + // Always search sites/all/libraries. + $searchdir[] = 'sites/all/libraries'; + + // Also search sites/<domain>/*. + $searchdir[] = conf_path() . '/libraries'; + + foreach ($searchdir as $dir) { + if (file_exists($dir . '/chosen/chosen.jquery.min.js')) { + return $dir . '/chosen'; + } + } + + return FALSE; +} diff --git a/profiles/wcm_base/modules/contrib/chosen/css/chosen-drupal.css b/profiles/wcm_base/modules/contrib/chosen/css/chosen-drupal.css new file mode 100644 index 0000000000000000000000000000000000000000..89444d1efe17a3570704aee13cb4f01b84f311e3 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/css/chosen-drupal.css @@ -0,0 +1,30 @@ +/** + * @file + * Drupal-specific CSS fixes for the Chosen module + */ + +.chosen-container.error .chosen-single, +.chosen-container.error .chosen-single span { + line-height: inherit; +} + +.chosen-container-single .chosen-search { + display: block; +} + +.chosen-container-multi .chosen-choices li.search-field input[type="text"] { + height: auto; +} + +.chosen-container { + display: inline-block !important; +} +.container-inline div.chosen-container div { + display: block; +} + +/* Error handling. */ +.chosen-container.error .chosen-choices, +.chosen-container.error .chosen-single { + border: 2px solid red; +} diff --git a/profiles/wcm_base/modules/contrib/chosen/drush/chosen.drush.inc b/profiles/wcm_base/modules/contrib/chosen/drush/chosen.drush.inc new file mode 100644 index 0000000000000000000000000000000000000000..84b2024468b0361f3f5f2ce86522d187239062f2 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/chosen/drush/chosen.drush.inc @@ -0,0 +1,117 @@ +<?php + +/** + * @file + * drush integration for chosen. + */ + +/** + * The Chosen plugin URI. + */ +define('CHOSEN_DOWNLOAD_URI', 'https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip'); + +/** + * Implementation of hook_drush_command(). + * + * In this hook, you specify which commands your + * drush module makes available, what it does and + * description. + * + * Notice how this structure closely resembles how + * you define menu hooks. + * + * See `drush topic docs-commands` for a list of recognized keys. + * + * @return + * An associative array describing your command(s). + */ +function chosen_drush_command() { + $items = array(); + + // The key in the $items array is the name of the command. + $items['chosen-plugin'] = array( + 'callback' => 'drush_chosen_plugin', + 'description' => dt('Download and install the Chosen plugin.'), + 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap. + 'arguments' => array( + 'path' => dt('Optional. A path where to install the Chosen plugin. If omitted Drush will use the default location.'), + ), + 'aliases' => array('chosenplugin'), + ); + + return $items; +} + +/** + * Implementation of hook_drush_help(). + * + * This function is called whenever a drush user calls + * 'drush help <name-of-your-command>'. + * + * @param + * A string with the help section (prepend with 'drush:'). + * + * @return + * A string with the help text for your command. + */ +function chosen_drush_help($section) { + switch ($section) { + case 'drush:chosen-plugin': + return dt('Download and install the Chosen plugin from http://harvesthq.github.com/chosen, default location is sites/all/libraries.'); + } +} + +/** + * Command to download the Chosen plugin. + */ +function drush_chosen_plugin() { + $args = func_get_args(); + if (!empty($args[0])) { + $path = $args[0]; + } + else { + $path = 'sites/all/libraries'; + } + + // Create the path if it does not exist. + if (!is_dir($path)) { + drush_op('mkdir', $path); + drush_log(dt('Directory @path was created', array('@path' => $path)), 'notice'); + } + + // Set the directory to the download location. + $olddir = getcwd(); + chdir($path); + + // Download the zip archive. + if ($filepath = drush_download_file(CHOSEN_DOWNLOAD_URI)) { + $filename = basename($filepath); + $dirname = basename($filepath, '.zip'); + + // Remove any existing Chosen plugin directory. + if (is_dir($dirname) || is_dir('chosen')) { + drush_delete_dir($dirname, TRUE); + drush_delete_dir('chosen', TRUE); + drush_log(dt('A existing Chosen plugin was deleted from @path', array('@path' => $path)), 'notice'); + } + + // Decompress the zip archive. + drush_tarball_extract($filename, $dirname); + + // Change the directory name to "chosen" if needed. + if ($dirname != 'chosen') { + drush_move_dir($dirname, 'chosen', TRUE); + $dirname = 'chosen'; + } + } + + if (is_dir($dirname)) { + drush_log(dt('Chosen plugin has been installed in @path', array('@path' => $path)), 'success'); + } + else { + drush_log(dt('Drush was unable to install the Chosen plugin to @path', array('@path' => $path)), 'error'); + } + + // Set working directory back to the previous working directory. + chdir($olddir); +} diff --git a/profiles/wcm_base/modules/contrib/r4032login/LICENSE.txt b/profiles/wcm_base/modules/contrib/r4032login/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/r4032login/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/r4032login/README.TXT b/profiles/wcm_base/modules/contrib/r4032login/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..d37a747757f34e7c103228ccda53f074d09b09f6 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/r4032login/README.TXT @@ -0,0 +1,23 @@ + +r4032login +-------------------------------------------------------------------------------- +Redirect the HTTP 403 error page to the Drupal /user/login page with a message +that reads, "Access denied. You must login to view this page." Also, a redirect +to the desired page is appended in the url query string so that, once login is +successful, the user is taken directly where they were originally trying to go. + +Makes for a much more user-friendly Drupal. + +Installation +-------------------------------------------------------------------------------- + +Extract and enable r4032login. +Configure at admin/config/system/site-information . + +Support +-------------------------------------------------------------------------------- +This open source project is supported by the Drupal.org community. To report a +bug, request a feature, or upgrade to the latest version, please visit the +project page: + + http://drupal.org/project/r4032login diff --git a/profiles/wcm_base/modules/contrib/r4032login/r4032login.info b/profiles/wcm_base/modules/contrib/r4032login/r4032login.info new file mode 100644 index 0000000000000000000000000000000000000000..ff6414c690a6dea7f1c5d488397d3b5f193d06fb --- /dev/null +++ b/profiles/wcm_base/modules/contrib/r4032login/r4032login.info @@ -0,0 +1,15 @@ +name = Redirect 403 to User Login +description = Redirect anonymous users from 403 Access Denied pages to the /user/login page. +core = 7.x + +files[] = r4032login.install +files[] = r4032login.module + +configure = admin/config/system/site-information + +; Information added by Drupal.org packaging script on 2014-08-11 +version = "7.x-1.8" +core = "7.x" +project = "r4032login" +datestamp = "1407782030" + diff --git a/profiles/wcm_base/modules/contrib/r4032login/r4032login.install b/profiles/wcm_base/modules/contrib/r4032login/r4032login.install new file mode 100644 index 0000000000000000000000000000000000000000..940a74ba564e377704ac7dcc70e503eb3dd359c4 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/r4032login/r4032login.install @@ -0,0 +1,38 @@ +<?php + +/** + * @file + * Install, update and uninstall functions for the r4032login module. + */ + +/** + * Implements hook_enable(). + */ +function r4032login_enable() { + variable_set('site_403', 'r4032login'); +} + +/** + * Implements hook_disable(). + */ +function r4032login_disable() { + variable_del('site_403'); +} + +/** + * Implements hook_uninstall(). + */ +function r4032login_uninstall() { + variable_del('r4032login_display_denied_message'); + variable_del('r4032login_access_denied_message'); + variable_del('r4032login_user_login_path'); + variable_del('r4032login_default_redirect_code'); + variable_del('r4032login_match_noredirect_pages'); +} + +/** + * Drupal 7 has better handling for visiting the user registration page while logged in. + */ +function r4032login_update_7000() { + variable_del('r4032login_user_register_message'); +} diff --git a/profiles/wcm_base/modules/contrib/r4032login/r4032login.module b/profiles/wcm_base/modules/contrib/r4032login/r4032login.module new file mode 100644 index 0000000000000000000000000000000000000000..a4fc9ff910eac827e6d873d4e40844ff3329f527 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/r4032login/r4032login.module @@ -0,0 +1,188 @@ +<?php + +/** + * @file + * Redirect denied pages to the user login form. + */ + +/** + * Implements hook_menu(). + */ +function r4032login_menu() { + $items = array(); + $items['r4032login'] = array( + 'page callback' => 'r4032login_redirect', + 'access callback' => 'r4032login_access_callback', + 'type' => MENU_CALLBACK, + 'title' => 'Access denied', + 'description' => 'You are not authorized to access this page.', + ); + return $items; +} + +/** + * Without an access callback on the menu item for r4032login_redirect, + * the redirect will be 403 and just have the default access denied page anyway. + */ +function r4032login_access_callback() { + return TRUE; +} + +/** + * Implements hook_form_FORM_ID_alter(). + */ +function r4032login_form_system_site_information_settings_alter(&$form, &$form_state, $form_id) { + $form['error_page']['r4032login_display_denied_message'] = array( + '#type' => 'checkbox', + '#weight' => 5, + '#title' => t('Display access denied message on login page'), + '#default_value' => variable_get('r4032login_display_denied_message', TRUE), + ); + $form['error_page']['r4032login_access_denied_message'] = array( + '#type' => 'textarea', + '#rows' => 1, + '#weight' => 6, + '#title' => t("User login 'access denied' message"), + '#default_value' => variable_get('r4032login_access_denied_message', t('Access denied. You must log in to view this page.')), + '#states' => array( + 'invisible' => array('input[name="r4032login_display_denied_message"]' => array( + 'checked' => FALSE, + )), + ), + ); + $form['error_page']['r4032login_access_denied_message_type'] = array( + '#type' => 'select', + '#options' => array( + 'error' => t('Error'), + 'warning' => t('Warning'), + 'status' => t('Status'), + ), + '#weight' => 7, + '#title' => t("User login 'access denied' message type"), + '#default_value' => variable_get('r4032login_access_denied_message_type', 'error'), + '#states' => array( + 'invisible' => array('input[name="r4032login_display_denied_message"]' => array( + 'checked' => FALSE, + )), + ), + ); + $form['error_page']['r4032login_redirect_authenticated_users_to'] = array( + '#type' => 'textfield', + '#weight' => 7, + '#title' => t("Redirect authenticated users to"), + '#description' => t('If an authenticated user tries to access a page they can not, redirect them to the given page. Use <front> for the front page, leave blank for a default access denied page.'), + '#default_value' => variable_get('r4032login_redirect_authenticated_users_to', ''), + ); + $form['error_page']['r4032login_user_login_path'] = array( + '#type' => 'textfield', + '#weight' => 8, + '#title' => t("Path to user login form"), + '#description' => t('The path to the user login form. Omit the beginning slash, ie: user/login'), + '#default_value' => variable_get('r4032login_user_login_path', 'user/login'), + ); + $options = array('301' => '301 Moved Permanently', '302' => '302 Found'); + $form['error_page']['r4032login_default_redirect_code'] = array( + '#type' => 'select', + '#weight' => 9, + '#title' => t("HTTP redirect code"), + '#description' => t('The redirect code to send. 301 responses may be cached by browsers and proxies, so 302 is normally the correct choice.'), + '#options' => $options, + '#default_value' => variable_get('r4032login_default_redirect_code', 302), + ); + $form['error_page']['matching_paths'] = array( + '#type' => 'fieldset', + '#title' => t('Skip redirect for matching pages'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#weight' => 10, + ); + $form['error_page']['matching_paths']['r4032login_match_noredirect_pages'] = array( + '#type' => 'textarea', + '#title' => '<span class="element-invisible">' . t('Only the listed pages') . '</span>', + '#default_value' => variable_get('r4032login_match_noredirect_pages', ''), + '#description' => t('Instead of redirecting, the user will get an access deined response and see the standard login form. This may be useful when the response code is important - such as for removing outdated content from search engines. Use the path node/* for all content.') . ' ' . t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')), + ); + return system_settings_form($form); +} + +/** + * Implements hook_theme(). + */ +function r4032login_theme() { + return array( + 'r4032login_denied' => array( + 'variables' => array(), + ), + ); +} + +/** + * MENU_CALLBACK for /r4032login + * + * Redirect anonymous users from 403 Access Denied pages to the /user/login page + * with a message explaining that they must log in to view the requested page + * and a query string parameter appended to the url to return after login. + */ +function r4032login_redirect() { + global $user, $language; + if (user_is_anonymous()) { + // Show the access denied message. + if (variable_get('r4032login_display_denied_message', TRUE) && empty($_POST)) { + $message = variable_get('r4032login_access_denied_message', t('Access denied. You must log in to view this page.')); + $message_type = variable_get('r4032login_access_denied_message_type', 'error'); + drupal_set_message(filter_xss_admin($message), $message_type); + } + $page_match = FALSE; + $pages = variable_get('r4032login_match_noredirect_pages', ''); + if ($pages) { + // When on an access denied page, Drupal stores the original path in + // $_GET['destination'] in drupal_deliver_html_page(). + // Convert the Drupal path to lowercase. + $path = drupal_strtolower(drupal_get_path_alias($_GET['destination'])); + // Compare the lowercase internal and lowercase path alias (if any). + $page_match = drupal_match_path($path, $pages); + if ($path != $_GET['destination']) { + $page_match = $page_match || drupal_match_path($_GET['destination'], $pages); + } + } + if ($page_match) { + // Display the default login page. + return drupal_get_form('user_login'); + } + // Handle redirection to the login form. + // using drupal_goto() with destination set causes a recursive redirect loop + $login_path = variable_get('r4032login_user_login_path', 'user/login'); + $code = variable_get('r4032login_default_redirect_code', 302); + // The code in drupal_get_destination() doesn't preserve any query string + // on 403 pages, so reproduce the part we want here. + $path = $_GET['destination']; + $query = drupal_http_build_query(drupal_get_query_parameters(NULL, array('q', 'destination'))); + if ($query != '') { + $path .= '?' . $query; + } + $destination = array('destination' => $path); + header('Location: ' . url($login_path, array('query' => $destination, 'absolute' => TRUE)), TRUE, $code); + drupal_exit(); + } + else { + // Check to see if we are to redirect the user. + $redirect = variable_get('r4032login_redirect_authenticated_users_to', ''); + if (empty($redirect)) { + // Display the default access denied page. + return theme('r4032login_denied'); + } + else { + // Custom access denied page for logged in users. + header('Location: ' . url($redirect, array('absolute' => TRUE))); + drupal_exit(); + } + } +} + +/** + * Display themed Access denied page. + */ +function theme_r4032login_denied() { + drupal_set_title(t('Access denied')); + return '<p>' . t('You are not authorized to access this page.') . '</p>'; +} diff --git a/profiles/wcm_base/modules/contrib/r4032login/r4032login.variable.inc b/profiles/wcm_base/modules/contrib/r4032login/r4032login.variable.inc new file mode 100644 index 0000000000000000000000000000000000000000..65159deef33795ad85d8dd456123eaf085c9eb1b --- /dev/null +++ b/profiles/wcm_base/modules/contrib/r4032login/r4032login.variable.inc @@ -0,0 +1,75 @@ +<?php + +/** + * @file + * Variable information. + */ + +/** + * Implements hook_variable_info(). + */ +function r4032login_variable_info($options) { + $variables['r4032login_display_denied_message'] = array( + 'type' => 'boolean', + 'title' => t('Display access denied message on login page', array(), $options), + 'default' => 1, + 'description' => t('Displays an access denied message on the user login page.', array(), $options), + 'group' => 'r4032login', + ); + $variables['r4032login_access_denied_message'] = array( + 'type' => 'string', + 'title' => t("User login 'access denied' message", array(), $options), + 'default' => t('Access denied. You must log in to view this page.', array(), $options), + 'description' => t('The message text displayed to users who are denied access to the page.', array(), $options), + 'group' => 'r4032login', + ); + $variables['r4032login_redirect_authenticated_users_to'] = array( + 'type' => 'drupal_path', + 'title' => t('Redirect authenticated users to', array(), $options), + 'default' => '', + 'description' => t('If an authenticated user tries to access a page they can not, redirect them to the given page. Use <front> for the front page, leave blank for a default access denied page.', array(), $options), + 'group' => 'r4032login', + ); + $variables['r4032login_user_login_path'] = array( + 'type' => 'drupal_path', + 'title' => t('Path to user login form', array(), $options), + 'default' => 'user/login', + 'description' => t('The path to the user login form. Omit the beginning slash, ie: user/login', array(), $options), + 'group' => 'r4032login', + ); + $variables['r4032login_default_redirect_code'] = array( + 'type' => 'select', + 'title' => t("HTTP default redirect code"), + 'description' => t('The redirect code to send by default. 301 responses may be cached by browsers and proxies.'), + 'default_value' => 302, + 'group' => 'r4032login', + ); + $variables['r4032login_match_redirect_code'] = array( + 'type' => 'select', + 'title' => t("HTTP redirect code to use for matching pages"), + 'description' => t('The redirect code to send for paths that match. 301 responses may be cached by browsers and proxies.'), + 'default' => 301, + ); + $variables['r4032login_match_redirect_pages'] = array( + 'type' => 'drupal_path', + 'title' => t('Specify matching pages by using their paths.'), + 'default' => '', + 'description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')), + 'group' => 'r4032login', + ); + return $variables; +} + +/** + * Implements hook_variable_group_info(). + */ +function r4032login_variable_group_info() { + $groups['r4032login'] = array( + 'title' => t('Redirect 403 to User Login'), + 'description' => t('Redirect anonymous users from 403 Access Denied pages to the user/login page.'), + 'access' => 'administer site configuration', + 'path' => array('admin/config/system/site-information'), + ); + + return $groups; +} diff --git a/profiles/wcm_base/modules/custom/wcm_user_config/theme/user-login.tpl.php b/profiles/wcm_base/modules/custom/wcm_user_config/theme/user-login.tpl.php index fb899363f336aa209f8d6f2a5bf842cc48874244..053d285d96da71132c8911c747b83783770eb9b1 100644 --- a/profiles/wcm_base/modules/custom/wcm_user_config/theme/user-login.tpl.php +++ b/profiles/wcm_base/modules/custom/wcm_user_config/theme/user-login.tpl.php @@ -1,6 +1,6 @@ <div class="login-box"> <h2>OSU Users</h2> - <p><a href="<?php print $https_base_url; ?>/saml_login<?php if ($has_destination) : ?>?ReturnTo=<?php print $return_to; ?><?php endif; ?>">Log in with your OSU credentials</a></p> + <p><a href="/saml_login">Log in with your OSU credentials</a></p> </div> <div class="login-box"> diff --git a/profiles/wcm_base/wcm_base.info b/profiles/wcm_base/wcm_base.info index 8780510bf685d34ba71deb4cf7f13b2811a31942..db5656dbcfe806718d7a707fe47cd0b678bd624c 100644 --- a/profiles/wcm_base/wcm_base.info +++ b/profiles/wcm_base/wcm_base.info @@ -61,6 +61,7 @@ dependencies[] = override_node_options dependencies[] = panels_accordion dependencies[] = private dependencies[] = private_files_download_permission +dependencies[] = r4032login dependencies[] = smtp dependencies[] = telephone dependencies[] = textformatter diff --git a/profiles/wcm_base/wcm_base.make b/profiles/wcm_base/wcm_base.make index 6539151621421ee3b75993c1d0ad8f8b376ce1fa..619b383e5b4cb4b56eac8c2cc49b26ef244205ef 100644 --- a/profiles/wcm_base/wcm_base.make +++ b/profiles/wcm_base/wcm_base.make @@ -11,6 +11,9 @@ projects[better_exposed_filters][patch][2560321] = http://drupal.org/files/issue projects[calendar][version] = 3.5 projects[calendar][subdir] = contrib +projects[chosen][version] = 2.0-beta4 +projects[chosen][subdir] = contrib + projects[conditional_fields][version] = 3.0-alpha2 projects[conditional_fields][subdir] = contrib @@ -93,6 +96,9 @@ projects[private_files_download_permission][subdir] = contrib projects[realname][version] = 1.2 projects[realname][subdir] = contrib +projects[r4032login][version] = 1.8 +projects[r4032login][subdir] = contrib + projects[redis][version] = 2.12 projects[redis][subdir] = contrib