diff --git a/.travis.yml b/.travis.yml index 68a7e069bf..c689d589b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ php: # make sure we test on latest trusty environment sudo: required dist: trusty -group: edge # Cache Composer & Drush directories. cache: @@ -33,8 +32,8 @@ branches: # TODO - Update from Selenium Server Standalone to alternative Marionette # https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver # Addons not working with Firefox. SeleniumHQ issue? Manually adding proper FF version. -#addons: -# firefox: "46.0.1" +addons: + chrome: stable # Cut down on git depth from default of 50 git: @@ -50,24 +49,27 @@ before_install: - sleep 1 # Disable PHP features - XDebug - phpenv config-rm xdebug.ini + #- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & install: - sudo apt-get update > /dev/null - "mysql -e 'create database drupal;'" - # Install Firefox manually until SeleniumHQ fixes the problem with the version not being reported to Travis-CI - - sudo mkdir /usr/local/bin/firefoxhack - - sudo wget --directory-prefix=/tmp http://ftp.mozilla.org/pub/firefox/releases/46.0.1/linux-x86_64/en-US/firefox-46.0.1.tar.bz2 - - sudo tar -xjf /tmp/firefox-46.0.1.tar.bz2 -C /usr/local/bin/firefoxhack --strip-components=1 - - export PATH="/usr/local/bin/firefoxhack:$PATH" - - echo "Using Firefox version $(firefox --version)" - # Install latest Drush 7.x. - export PATH="$HOME/.composer/vendor/bin:$PATH" - composer global require --no-interaction drush/drush:7.* + # get chromedriver + - cd ~/ + - wget -N https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip + - unzip ~/chromedriver_linux64.zip -d ~/ + - rm ~/chromedriver_linux64.zip + - sudo mv -f ~/chromedriver /usr/local/share/ + - sudo chmod +x /usr/local/share/chromedriver + - sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver + # Build Behat dependencies - - cd profiles/openasu/modules/panopoly/panopoly_test/behat + - cd $TRAVIS_BUILD_DIR/profiles/openasu/modules/panopoly/panopoly_test/behat - composer install --no-interaction # Build Behat dependencies - cd ../../../custom/webspark_test/behat @@ -85,6 +87,8 @@ install: # Setup files - sudo chmod -R 777 sites + + # Get Selenium - wget https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar - java -jar selenium-server-standalone-2.53.0.jar > /dev/null 2>&1 & diff --git a/profiles/openasu/CHANGELOG.txt b/profiles/openasu/CHANGELOG.txt index 84b87d39d5..f84cb4855f 100644 --- a/profiles/openasu/CHANGELOG.txt +++ b/profiles/openasu/CHANGELOG.txt @@ -1,3 +1,26 @@ +Webspark 1.64.1 (San Diego), 2019-04-05 +--------------------------------------- +- Web standards components in Webspark + + * ASU Google Custom Search Engine (asu_gcse) - v1.0 + * Initial release of the ASU Google Custom Search Engine module + * Replaces the functionality of the ASU GSA module + * ASU Google Search Appliance (asu_gsa) - v1.2 + * Deprecated module + * ASU News (asu_news) - v3.0-alpha1 + * Deprecated module + * Added hooks to disable module in preparation for removal in next release + * ASU Events (asu_events) - v3.0-alpha1 + * Deprecated module + * Added hooks to disable module in preparation for removal in next release + +- Contrib module updates + + - Managed by Webspark + + * Google Custom Search Engine (google_cse) - v2.5 + * Added as a dependency for the new ASU Google Custom Search Engine module + Webspark 1.64 (California) release, 2019-03-25 ---------------------------------------------- - Webspark core diff --git a/profiles/openasu/modules/contrib/google_cse/LICENSE.txt b/profiles/openasu/modules/contrib/google_cse/LICENSE.txt new file mode 100644 index 0000000000..d159169d10 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/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. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/profiles/openasu/modules/contrib/google_cse/README.txt b/profiles/openasu/modules/contrib/google_cse/README.txt new file mode 100644 index 0000000000..103d884b39 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/README.txt @@ -0,0 +1,80 @@ + +CONTENTS OF THIS FILE +--------------------- + + * Overview + * Quick setup + * Requirements + * Blocks + * SiteSearch + * Search module integration + * Advanced settings + * Installation + * Maintainers + +OVERVIEW +-------- + +Google Custom Search Engine (CSE) is an embedded search engine that can +be used to search any set of one or more sites. No Google API key is +required. Read more at http://www.google.com/cse/. + +QUICK SETUP +----------- + +After installing this module, activate Google CSE at +admin/config/search/settings, optionally setting it as the default +search module, and configure it by entering Google's unique ID for your +CSE. Once you have granted permission for one or more roles to search +the Google CSE, the search page can be found at search/google, and a +separate self-contained search block can also be enabled. + +BLOCKS +------ + +The include Google CSE block can optionally be enabled at +admin/structure/block. The "Google CSE" block provides a search box and +also displays the search results. After entering search terms, the user +will be returned to the same page (via GET request) and the results will +be displayed. Do not allow this Google CSE block to appear on the +search/google page, as the search results will fail to display. + +SITESEARCH +---------- + +In addition to the CSE functionality, SiteSearch on one or more domains +or URL paths can optionally be configured. Radio buttons allow users to +search on either the SiteSearch option(s) or the CSE, and searches can +default to either option. + +ADVANCED SETTINGS +----------------- + +The collapsed advanced settings on the settings page provide various +customizations such as country and language preferences. For example, +with the Locale module enabled, the Google CSE user interface language +can be selected dynamically based on the current user's language. + +INSTALLATION +------------ + +Place the google_cse directory in your sites/all/modules directory. +Enable the Google CSE module at admin/modules, configure it at +admin/config/search/settings, and assign permissions for "search Google +CSE" at admin/people/permissions. + +To configure this module, you will need your CSE's unique ID. Go to +http://www.google.com/cse/manage/all, click on control panel and you +will find the "Search engine unique ID" under "Basic information". + +MAINTAINERS +----------- + +Authored and maintained by mfb: http://drupal.org/user/12302 + +The current maintainer does not plan to add new features to this module, +such as support for multiple CSEs; however, patches providing new +features are welcome and will be reviewed. + +For bugs, feature requests and support requests, please use the issue +queue at http://drupal.org/project/issues/google_cse diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse.admin.inc b/profiles/openasu/modules/contrib/google_cse/google_cse.admin.inc new file mode 100644 index 0000000000..b21d015b5b --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse.admin.inc @@ -0,0 +1,303 @@ + t('Google CSE'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + + $form['google_cse']['google_cse_cx'] = array( + '#title' => t('Google Custom Search Engine ID'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_cx', ''), + '#description' => t('Enter your Google CSE unique ID (click on control panel).'), + ); + + $form['google_cse']['google_cse_results_tab'] = array( + '#title' => t('Search results tab name'), + '#type' => 'textfield', + '#maxlength' => 50, + '#size' => 60, + '#description' => t('Enter a custom name of the tab where search results are displayed (defaults to %google).', array('%google' => t('Google'))), + '#default_value' => variable_get('google_cse_results_tab', ''), + ); + + $form['google_cse']['google_cse_results_width'] = array( + '#title' => t('Search results frame width'), + '#type' => 'textfield', + '#maxlength' => 4, + '#size' => 6, + '#description' => t('Enter the desired width, in pixels, of the search frame.'), + '#default_value' => variable_get('google_cse_results_width', 600), + ); + + $form['google_cse']['google_cse_cof_here'] = array( + '#title' => t('Ad format on this site'), + '#type' => 'radios', + '#default_value' => variable_get('google_cse_cof_here', 'FORID:11'), + '#options' => array( + 'FORID:9' => t('Right'), + 'FORID:10' => t('Top and right'), + 'FORID:11' => t('Top and bottom'), + ), + '#description' => t('Ads on the right increase the width of the iframe. Non-profit organizations can disable ads in the Google CSE control panel.'), + ); + + $form['google_cse']['google_cse_cof_google'] = array( + '#title' => t('Ad format on Google'), + '#type' => 'radios', + '#default_value' => variable_get('google_cse_cof_google', 'FORID:0'), + '#options' => array( + 'FORID:0' => t('Right'), + 'FORID:1' => t('Top and bottom'), + ), + '#description' => t('AdSense ads are also displayed when the CSE links or redirects to Google.'), + ); + + $form['google_cse']['google_cse_results_prefix'] = array( + '#title' => t('Search results prefix text'), + '#type' => 'textarea', + '#cols' => 50, + '#rows' => 4, + '#description' => t('Enter text to appear on the search page before the search form.'), + '#default_value' => variable_get('google_cse_results_prefix', ''), + ); + + $form['google_cse']['google_cse_results_suffix'] = array( + '#title' => t('Search results suffix text'), + '#type' => 'textarea', + '#cols' => 50, + '#rows' => 4, + '#description' => t('Enter text to appear on the search page after the search form and results.'), + '#default_value' => variable_get('google_cse_results_suffix', ''), + ); + + $form['google_cse']['google_cse_results_searchbox_width'] = array( + '#title' => t('Google CSE block searchbox width'), + '#type' => 'textfield', + '#maxlength' => 4, + '#size' => 6, + '#description' => t('Enter the desired width, in characters, of the searchbox on the Google CSE block.'), + '#default_value' => variable_get('google_cse_results_searchbox_width', 40), + ); + + $form['google_cse']['google_cse_results_display'] = array( + '#title' => t('Display search results'), + '#type' => 'radios', + '#default_value' => variable_get('google_cse_results_display', 'here'), + '#options' => array( + 'here' => t('On this site (requires JavaScript)'), + 'google' => t('On Google'), + ), + '#description' => t('Search results for the Google CSE block can be displayed on this site, using JavaScript, or on Google, which does not require JavaScript.'), + ); + + $form['google_cse']['google_cse_results_display_images'] = array( + '#title' => t('Display thumbnail images in the search results'), + '#type' => 'checkbox', + '#description' => t('If set, search result snippets will contain a thumbnail image'), + '#default_value' => variable_get('google_cse_results_display_images', TRUE), + ); + + $form['google_cse']['google_cse_show_watermark'] = array( + '#title' => t('Show watermark in search field'), + '#type' => 'checkbox', + '#description' => t('If set, search result snippets will contain a thumbnail image'), + '#default_value' => variable_get('google_cse_results_display_images', TRUE), + ); + + $form['google_cse']['google_cse_tag_attributes'] = array( + '#title' => t('Google CSE Tag Attributes'), + '#type' => 'textfield', + '#description' => t('Enter any additional tag attributes you want in the GCSE tag. Defaults to gname="google_cse". A list of attributes can be found here: Google Custom Search supported attributes'), + '#default_value' => variable_get('google_cse_tag_attributes', 'gname="google_cse"'), + ); + + $form['google_cse']['sitesearch'] = array( + '#title' => t('SiteSearch settings'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['google_cse']['sitesearch']['google_cse_sitesearch'] = array( + '#title' => t('SiteSearch domain'), + '#type' => 'textarea', + '#cols' => 50, + '#rows' => 4, + '#description' => t('If set, users will be presented with the option of searching only on the domain(s) specified rather than using the CSE. Enter one domain or URL path followed by a description (e.g. example.com/user Search users) on each line.'), + '#default_value' => variable_get('google_cse_sitesearch', ''), + ); + + $form['google_cse']['sitesearch']['google_cse_sitesearch_form'] = array( + '#title' => t('SiteSearch form element'), + '#type' => 'radios', + '#options' => array( + 'radios' => t('Radio buttons'), + 'select' => t('Select'), + ), + '#description' => t('Select the type of form element used to present the SiteSearch option(s).'), + '#default_value' => variable_get('google_cse_sitesearch_form', 'radios'), + ); + + $form['google_cse']['sitesearch']['google_cse_sitesearch_option'] = array( + '#title' => t('CSE search option label'), + '#type' => 'textfield', + '#maxlength' => 50, + '#size' => 60, + '#description' => t('Customize the label for CSE search if SiteSearch is enabled (defaults to %search-web).', array('%search-web' => t('Search the web'))), + '#default_value' => variable_get('google_cse_sitesearch_option', ''), + ); + + $form['google_cse']['sitesearch']['google_cse_sitesearch_default'] = array( + '#title' => t('Default to using the SiteSearch domain'), + '#type' => 'checkbox', + '#description' => t('If set, searches will default to using the first listed SiteSearch domain rather than the CSE.'), + '#default_value' => variable_get('google_cse_sitesearch_default', 0), + ); + + $form['google_cse']['advanced'] = array( + '#title' => t('Advanced settings'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['google_cse']['advanced']['google_cse_domain'] = array( + '#title' => t('Search domain'), + '#type' => 'textfield', + '#maxlength' => 64, + '#description' => t('Enter the Google domain to use for search results, e.g. www.google.com.'), + '#default_value' => variable_get('google_cse_domain', 'www.google.com'), + ); + + $form['google_cse']['advanced']['google_cse_limit_domain'] = array( + '#title' => t('Limit results to this domain'), + '#type' => 'textfield', + '#maxlength' => 64, + '#description' => t('Enter the domain to limit results on + (only display results for this domain) www.google.com.'), + '#default_value' => variable_get('google_cse_limit_domain', ''), + ); + + $form['google_cse']['advanced']['google_cse_cr'] = array( + '#title' => t('Country restriction'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_cr', ''), + '#description' => t('Enter a 9-letter country code, e.g. countryNZ, and optional boolean operators, to restrict search results to documents (not) originating in particular countries. See the cr parameter.'), + ); + + $form['google_cse']['advanced']['google_cse_gl'] = array( + '#title' => t('Country boost'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_gl', ''), + '#description' => t('Enter a 2-letter country code, e.g. uk, to boost documents written in a particular country. See the gl parameter.'), + ); + + $form['google_cse']['advanced']['google_cse_hl'] = array( + '#title' => t('Interface language'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_hl', ''), + '#description' => t('Enter a supported 2- or 5-character language code, e.g. fr, to set the language of the user interface. See the hl parameter.'), + ); + + $form['google_cse']['advanced']['google_cse_locale_hl'] = array( + '#title' => t('Set interface language dynamically'), + '#type' => 'checkbox', + '#default_value' => variable_get('google_cse_locale_hl', ''), + '#description' => t('The language restriction can be set dynamically if the locale module is enabled. Note the locale language code must match one of the supported language codes.'), + ); + + $form['google_cse']['advanced']['google_cse_ie'] = array( + '#title' => t('Input encoding'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_ie', 'utf-8'), + '#description' => t('The default utf-8 is recommended. See the ie parameter.'), + ); + + $form['google_cse']['advanced']['google_cse_lr'] = array( + '#title' => t('Language restriction'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_lr', ''), + '#description' => t('Enter a supported 7- or 10-character language code, e.g. lang_en, and optional boolean operators, to restrict search results to documents (not) written in particular languages. See the lr parameter.'), + ); + + $form['google_cse']['advanced']['google_cse_locale_lr'] = array( + '#title' => t('Set language restriction dynamically'), + '#type' => 'checkbox', + '#default_value' => variable_get('google_cse_locale_lr', ''), + '#description' => t('The language restriction can be set dynamically if the locale module is enabled. Note the locale language code must match one of the supported language codes.'), + ); + + $form['google_cse']['advanced']['google_cse_oe'] = array( + '#title' => t('Output encoding'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_oe', ''), + '#description' => t('The default utf-8 is recommended. See the oe parameter.'), + ); + + $form['google_cse']['advanced']['google_cse_safe'] = array( + '#title' => t('SafeSearch filter'), + '#type' => 'select', + '#options' => array( + '' => '', + 'off' => t('Off'), + 'medium' => t('Medium'), + 'high' => t('High'), + ), + '#default_value' => variable_get('google_cse_safe', ''), + '#description' => t('SafeSearch filters search results for adult content. See the safe parameter.'), + ); + + $form['google_cse']['advanced']['google_cse_custom_css'] = array( + '#title' => t('Stylesheet Override'), + '#type' => 'textfield', + '#default_value' => variable_get('google_cse_custom_css', ''), + '#description' => t('Set a custom stylesheet to override or add any styles not allowed in the CSE settings (such as "background-color: none;"). Include !important for overrides.
Example: //replacewithrealsite.com/sites/all/modules/google_cse/default.css'), + ); + + $form['google_cse']['advanced']['google_cse_custom_results_display'] = array( + '#title' => t('Layout of Search Engine'), + '#type' => 'radios', + '#default_value' => variable_get('google_cse_custom_results_display', 'results-only'), + '#options' => array( + 'overlay' => t('Overlay'), + 'two-page' => t('Two page'), + 'full-width' => t('Full width'), + 'two-column' => t('Two column'), + 'compact' => t('Compact'), + 'results-only' => t('Results only'), + 'google-hosted' => t('Google hosted'), + ), + '#description' => t('Set the search engine layout, as found in the Layout tab of Custom Search settings.', array( + '@url' => 'https://www.google.com/cse/lookandfeel/layout?cx=' . variable_get('google_cse_cx', ''), + )), + ); + + $form['google_cse_adv'] = array( + '#title' => t('Google CSE Advanced'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + + $form['google_cse_adv']['google_cse_use_adv'] = array( + '#title' => t('Use advanced, ad-free version, search engine (You will need a paid account with Google)'), + '#type' => 'checkbox', + '#default_value' => variable_get('google_cse_use_adv', 0), + '#description' => t('If enabled, search results will be fetch using Adv engine.'), + ); + + return $form; +} diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse.css b/profiles/openasu/modules/contrib/google_cse/google_cse.css new file mode 100644 index 0000000000..e5b3ceb8ac --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse.css @@ -0,0 +1,8 @@ +#google-cse-results-searchbox-form div, #google-cse-results-searchbox-form input { + margin: 0; + display: inline; +} + +#google-cse-results-searchbox-form .form-radios div { + display: block; +} diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse.info b/profiles/openasu/modules/contrib/google_cse/google_cse.info new file mode 100644 index 0000000000..04b963932c --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse.info @@ -0,0 +1,19 @@ +name = "Google CSE" +description = "Use Google Custom Search to search your site and/or any other sites." +core = 7.x +dependencies[] = search +files[] = google_cse.install +files[] = google_cse.module +files[] = google_cse.admin.inc +files[] = google_cse.theme.inc +files[] = tests/google_cse.test +scripts[] = google_cse.js +stylesheets[all][] = google_cse.css + + +; Information added by Drupal.org packaging script on 2017-04-25 +version = "7.x-2.5" +core = "7.x" +project = "google_cse" +datestamp = "1493159645" + diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse.install b/profiles/openasu/modules/contrib/google_cse/google_cse.install new file mode 100644 index 0000000000..cee0f0ce88 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse.install @@ -0,0 +1,76 @@ +': + $new_value = 'overlay'; + break; + + case '': + $new_value = 'two-page'; + break; + + case ' ': + $new_value = 'full-width'; + break; + + case '': + $new_value = 'two-column'; + break; + + case '  ': + $new_value = 'compact'; + break; + + case '': + $new_value = 'results-only'; + break; + + case '': + $new_value = 'google-hosted'; + break; + + default: + $new_value = 'results-only'; + } + + variable_set('google_cse_custom_results_display', $new_value); +} + +/** + * Delete irrelevant gadget variable. + */ +function google_cse_update_7201() { + variable_del('google_cse_results_gadget'); +} + +/** + * Implements hook_uninstall(). + */ +function google_cse_uninstall() { + db_delete('variable') + ->condition('name', db_like('google_cse_') . '%', 'LIKE') + ->execute(); + + // Delete Google CSE from active search modules, if it exists. + $active_search = variable_get('search_active_modules'); + if (array_key_exists('google_cse', $active_search)) { + unset($active_search['google_cse']); + variable_set('search_active_modules', $active_search); + } + + // Delete Google CSE from being default search module. + if (variable_get('search_default_module') == 'google_cse') { + variable_del('search_default_module'); + } +} diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse.js b/profiles/openasu/modules/contrib/google_cse/google_cse.js new file mode 100644 index 0000000000..7f18392c75 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse.js @@ -0,0 +1,47 @@ +(function ($) { + + /** + * Google CSE utility functions. + */ + Drupal.googleCSE = Drupal.googleCSE || {}; + + Drupal.behaviors.googleCSE = { + attach: function (context, settings) { + // Show watermark, if not disabled in module settings. + if (Drupal.settings.googleCSE.showWaterMark) { + Drupal.googleCSE.googleCSEWatermark('#search-block-form.google-cse', context); + Drupal.googleCSE.googleCSEWatermark('#search-form.google-cse', context); + Drupal.googleCSE.googleCSEWatermark('#google-cse-results-searchbox-form', context); + } + } + }; + + /** + * Show google CSE watermark. + */ + Drupal.googleCSE.googleCSEWatermark = function(id, context) { + var f = $(id, context)[0]; + if (f && (f.query || f['edit-search-block-form--2'] || f['edit-keys'])) { + var q = f.query ? f.query : (f['edit-search-block-form--2'] ? f['edit-search-block-form--2'] : f['edit-keys']); + var n = navigator; + var l = location; + if (n.platform == 'Win32') { + q.style.cssText = 'border: 1px solid #7e9db9; padding: 2px;'; + } + var b = function () { + if (q.value == '') { + q.style.background = '#FFFFFF url(https://www.google.com/cse/intl/' + Drupal.settings.googleCSE.language + '/images/google_custom_search_watermark.gif) left no-repeat'; + } + }; + var f = function () { + q.style.background = '#ffffff'; + }; + q.onfocus = f; + q.onblur = b; +// if (!/[&?]query=[^&]/.test(l.search)) { + b(); +// } + } + }; + +})(jQuery); diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse.module b/profiles/openasu/modules/contrib/google_cse/google_cse.module new file mode 100644 index 0000000000..9ff852c7c3 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse.module @@ -0,0 +1,360 @@ +' . t('About') . ''; + $output .= '

' . t('Google Custom Search Engine (CSE) is an embedded search engine that can be used to search any set of one or more sites. No Google API key is required. Read more at http://www.google.com/cse/.') . '

'; + $output .= '

' . t('Usage') . '

'; + $output .= '

' . t("After installing this module, activate Google CSE at admin/config/search/settings, optionally setting it as the default search module, and configure it by entering Google's unique ID for your CSE. Once you have granted permission for one or more roles to search the Google CSE, the search page can be found at search/google, and a separate self-contained search block can also be enabled.") . '

'; + $output .= '

' . t('Blocks') . '

'; + $output .= '

' . t('The include Google CSE block can optionally be enabled at admin/structure/block. The "Google CSE" block provides a search box and also displays the search results. After entering search terms, the user will be returned to the same page (via GET request) and the results will be displayed. Do not allow this Google CSE block to appear on the search/google page, as the search results will fail to display.') . '

'; + $output .= '

' . t('SiteSearch') . '

'; + $output .= '

' . t('In addition to the CSE functionality, SiteSearch on one or more domains or URL paths can optionally be configured. Radio buttons allow users to search on either the SiteSearch option(s) or the CSE, and searches can default to either option.') . '

'; + $output .= '

' . t('Advanced Settings') . '

'; + $output .= '

' . t("The collapsed advanced settings on the settings page provide various customizations such as country and language preferences. For example, with the Locale module enabled, the Google CSE user interface language can be selected dynamically based on the current user's language.") . '

'; + return $output; + } +} + +/** + * Implements hook_search_info(). + */ +function google_cse_search_info() { + return array( + 'title' => google_cse_results_tab(), + 'path' => 'google', + 'conditions_callback' => 'google_cse_conditions_callback', + ); +} + +/** + * Search conditions callback. + */ +function google_cse_conditions_callback($keys) { + $conditions = array(); + return $conditions; +} + +/** + * Implements hook_search_execute(). + */ +function google_cse_search_execute($keys = NULL, $conditions = NULL) { + // Pass search terms to JS so they can be sent in google_cse_results.js + drupal_add_js(array('googleCSE' => array('keys' => $keys)), 'setting'); + + if (variable_get('google_cse_use_adv', 0)) { + // Firstly, load the needed modules. + module_load_include('inc', 'google_cse', 'google_cse_adv/google_cse_adv'); + // And get the google results. + $response = google_cse_adv_service($keys); + $results = google_cse_adv_response_results($response[0], $keys, $conditions); + + // Allow other modules to alter the keys. + drupal_alter('google_cse_searched_keys', $keys); + + // Allow other modules to alter the results. + drupal_alter('google_cse_searched_results', $results); + + return $results; + } + +} + +/** + * Builds a query array based on Google CSE settings. + */ +function google_cse_build_query($keys, $sitesearch = NULL, $here = TRUE) { + if (!variable_get('google_cse_use_adv', 0)) { + return array( + 'q' => $keys, + 'cx' => variable_get('google_cse_cx', ''), + ); + } + + return array( + 'q' => $keys, + 'cx' => variable_get('google_cse_cx', ''), + 'cof' => $here ? variable_get('google_cse_cof_here', 'FORID:11') : variable_get('google_cse_cof_google', 'FORID:0'), + 'sitesearch' => isset($sitesearch) ? $sitesearch : google_cse_sitesearch_default(), + ) + google_cse_advanced_settings(); +} + +/** + * Implements hook_search_page(). + */ +function google_cse_search_page($results) { + if (!variable_get('google_cse_use_adv', 0)) { + $output['#theme'] = 'google_cse_results'; + + return $output; + } + + if (!$results) { + // No results found. + $output['search_results'] = array('#markup' => theme('google_cse_search_noresults')); + + return $output; + } + + $current_page = 0; + if (!empty($_GET['page'])) { + $current_page = $_GET['page']; + } + + $number_results = t('Results @from to @to of @total matches.', array( + '@from' => $current_page * 10 + 1, + '@to' => $current_page * 10 + 10, + '@total' => $GLOBALS['pager_total_items'][0], + )); + $output['prefix']['#markup'] = $number_results . '
    '; + + foreach ($results as $entry) { + $output[] = array( + '#theme' => 'search_result', + '#result' => $entry, + '#module' => 'google_cse', + ); + } + + // Important, add the pager. + $output['suffix']['#markup'] = '
' . theme('pager'); + + return $output; +} + +/** + * Implements hook_search_admin(). + */ +function google_cse_search_admin() { + module_load_include('admin.inc', 'google_cse'); + return google_cse_admin_settings(); +} + +/** + * Implements hook_search_access(). + */ +function google_cse_search_access() { + return user_access('search Google CSE'); +} + +/** + * Implements hook_theme(). + */ +function google_cse_theme($existing, $type, $theme, $path) { + return array( + 'google_cse_results' => array( + 'variables' => array('form' => FALSE, 'path' => $path), + 'file' => 'google_cse.theme.inc', + 'template' => 'google_cse_results', + ), + 'google_cse_adv_results' => array( + 'variables' => array('form' => FALSE, 'path' => $path), + 'file' => 'google_cse.theme.inc', + 'template' => 'google_cse_adv/templates/google_cse_adv_results', + ), + // Shows a message when the search does not return any result. + 'google_cse_search_noresults' => array( + 'variables' => array(), + ), + ); +} + +/** + * Implements hook_block_info(). + */ +function google_cse_block_info() { + return array( + 'google_cse' => array( + 'info' => t('Google CSE'), + ), + ); +} + +/** + * Implements hook_block_view(). + */ +function google_cse_block_view($delta = '') { + if (user_access('search Google CSE')) { + switch ($delta) { + case 'google_cse': + return array( + 'subject' => t('Search'), + 'content' => array('#theme' => 'google_cse_results', '#form' => TRUE), + ); + } + } +} + +/** + * Return the Google CSE tab title, either a setting or a translation. + */ +function google_cse_results_tab() { + return ($var = variable_get('google_cse_results_tab', '')) ? $var : t('Google'); +} + +/** + * Implements hook_perm(). + */ +function google_cse_permission() { + return array( + 'search Google CSE' => array( + 'title' => t('Use Google CSE search'), + ), + ); +} + +/** + * Returns an array of any advanced settings which have been set. + */ +function google_cse_advanced_settings() { + global $language; + $settings = array(); + foreach (array('cr', 'gl', 'hl', 'ie', 'lr', 'oe', 'safe') as $parameter) { + if ($setting = variable_get("google_cse_$parameter", '')) { + $settings[$parameter] = $setting; + } + } + if (variable_get('google_cse_locale_hl', '')) { + $settings['hl'] = $language->language; + } + if (variable_get('google_cse_locale_lr', '')) { + $settings['lr'] = 'lang_' . $language->language; + } + return $settings; +} + +/** + * Get the relevant language to use for the search. + * + * @return string + * The language. + */ +function google_cse_language() { + global $language; + return variable_get('google_cse_locale_hl', '') ? $language->language : variable_get('google_cse_hl', ''); +} + +/** + * Implements hook_init(). + */ +function google_cse_init() { + drupal_add_js(array( + 'googleCSE' => array( + 'cx' => variable_get('google_cse_cx', ''), + 'language' => google_cse_language(), + 'resultsWidth' => intval(variable_get('google_cse_results_width', 600)), + 'domain' => variable_get('google_cse_domain', 'www.google.com'), + 'showWaterMark' => variable_get('google_cse_show_watermark', TRUE), + ), + ), 'setting'); +} + +/** + * Returns SiteSearch options form item. + */ +function google_cse_sitesearch_form(&$form) { + if ($options = google_cse_sitesearch_options()) { + $form['sitesearch'] = array( + '#type' => variable_get('google_cse_sitesearch_form', 'radios'), + '#options' => $options, + '#default_value' => google_cse_sitesearch_default(), + ); + if ($form['sitesearch']['#type'] == 'select' && isset($form['sa'])) { + $form['sa']['#weight'] = 10; + } + } +} + +/** + * Returns SiteSearch options. + */ +function google_cse_sitesearch_options() { + static $options; + if (!isset($options)) { + $options = array(); + if ($sites = preg_split('/[\n\r]+/', variable_get('google_cse_sitesearch', ''), -1, PREG_SPLIT_NO_EMPTY)) { + $options[''] = ($var = variable_get('google_cse_sitesearch_option', '')) ? $var : t('Search the web'); + foreach ($sites as $site) { + $site = preg_split('/[\s]+/', trim($site), 2, PREG_SPLIT_NO_EMPTY); + // Select options will be HTML-escaped. + // Radio options will be XSS-filtered. + $options[$site[0]] = isset($site[1]) ? $site[1] : t('Search "@sitesearch"', array('@sitesearch' => $site[0])); + } + } + } + return $options; +} + +/** + * Returns SiteSearch default value. + */ +function google_cse_sitesearch_default() { + $options = google_cse_sitesearch_options(); + if (isset($_GET['sitesearch']) && isset($options[$_GET['sitesearch']])) { + return $_GET['sitesearch']; + } + elseif (variable_get('google_cse_sitesearch_default', 0)) { + // Return the key of the second element in the array. + return key(array_slice($options, 1, 1)); + } + return ''; +} + +/** + * Adds custom submit handler for search form. + */ +function google_cse_form_search_form_alter(&$form, &$form_state, $form_id) { + if ($form['module']['#value'] == 'google_cse') { + google_cse_sitesearch_form($form); + $form['#attributes']['class'][] = 'google-cse'; + } +} + +/** + * Adds custom submit handler for search block form. + */ +function google_cse_form_search_block_form_alter(&$form, &$form_state, $form_id) { + $info = search_get_default_module_info(); + if ($info['module'] == 'google_cse') { + google_cse_sitesearch_form($form); + $form['#attributes']['class'][] = 'google-cse'; + } +} + + +/** + * Implements hook_proxy_settings_info(). + */ +function google_cse_proxy_settings_info() { + return array( + 'google_cse_adv' => array( + 'name' => 'Google Custom Search Engine', + ), + ); +} + + +/** + * Brief message to display when no results match the query. + * + * @see search_help() + */ +function theme_google_cse_search_noresults() { + return t('

Sorry there were no results matching your enquiry.

+
    +
  • Check the spelling of your keywords
  • +
  • Try a more specific enquiry (e.g. "Penny Black" instead of "Stamps"): "blue drop"
  • +
  • Be explicit (e.g. "Second class stamp" instead of "Stamp")
  • +
  • Include spaces between keywords
  • +
'); +} diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse.theme.inc b/profiles/openasu/modules/contrib/google_cse/google_cse.theme.inc new file mode 100644 index 0000000000..88e517778c --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse.theme.inc @@ -0,0 +1,106 @@ +'; + + case 'two-page': + return ''; + + + case 'two-column': + return ''; + + + case 'results-only': + return ''; + + case 'google-hosted': + return ''; + + default: + watchdog('google_cse', 'Invalid custom result display %display', + array('%display' => $display), WATCHDOG_CRITICAL); + } +} + +/** + * The search results page can be themed/customized. + */ +function template_preprocess_google_cse_results(&$variables) { + $variables['results_searchbox_form'] = $variables['form'] ? drupal_get_form('google_cse_results_searchbox_form') : ''; + $variables['cse_tag'] = google_cse_get_cse_tag(); + $variables['noscript'] = t('You must enable JavaScript to view the search results.'); + $variables['prefix'] = filter_xss_admin(variable_get('google_cse_results_prefix', '')); + $variables['suffix'] = filter_xss_admin(variable_get('google_cse_results_suffix', '')); + + if (google_cse_validate_request()) { + drupal_add_js(drupal_get_path('module', 'google_cse') . '/google_cse_results.js', + array('scope' => 'footer')); + drupal_add_css('' . variable_get('google_cse_custom_css', '') . '', 'external'); + } +} + +/** + * Validate GET parameters to avoid displaying inappropriate search results. + */ +function google_cse_validate_request() { + return ( + (empty($_GET['cx']) || $_GET['cx'] == variable_get('google_cse_cx', '')) && + (empty($_GET['safe']) || $_GET['safe'] == variable_get('google_cse_safe', '')) && + (empty($_GET['sitesearch']) || (($options = google_cse_sitesearch_options()) && isset($options[$_GET['sitesearch']]))) + ); +} + +/** + * Form builder for the searchbox forms. + */ +function google_cse_results_searchbox_form($form, &$form_state) { + $form = array(); + if (variable_get('google_cse_results_display', 'here') == 'here') { + $cof = variable_get('google_cse_cof_here', 'FORID:11'); + } + else { + $form['#action'] = '//' . variable_get('google_cse_domain', 'www.google.com') . '/cse'; + $cof = variable_get('google_cse_cof_google', 'FORID:0'); + } + $form['#method'] = 'get'; + $form['cx'] = array( + '#type' => 'hidden', + '#value' => variable_get('google_cse_cx', ''), + ); + $form['cof'] = array( + '#type' => 'hidden', + '#value' => $cof, + ); + $form['query'] = array( + '#type' => 'textfield', + '#default_value' => isset($_GET['query']) ? $_GET['query'] : '', + ); + $form['sa'] = array( + '#type' => 'submit', + '#value' => t('Search'), + ); + foreach (google_cse_advanced_settings() as $parameter => $setting) { + $form[$parameter] = array( + '#type' => 'hidden', + '#value' => $setting, + ); + } + $form['query']['#size'] = intval(variable_get('google_cse_results_searchbox_width', 40)); + $form['query']['#title'] = t('Enter your keywords'); + + google_cse_sitesearch_form($form); + return $form; +} diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse_adv/google_cse_adv.inc b/profiles/openasu/modules/contrib/google_cse/google_cse_adv/google_cse_adv.inc new file mode 100644 index 0000000000..3429189efd --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse_adv/google_cse_adv.inc @@ -0,0 +1,367 @@ + variable_get('google_cse_cx', ''), + 'client' => 'google-csbe', + 'output' => 'xml_no_dtd', + 'filter' => '1', + 'hl' => google_cse_adv_param_hl(), + 'lr' => google_cse_adv_param_lr(), + 'q' => $keys, + 'num' => $rows, + 'start' => ($offset) ? $offset : ($page * $rows), + 'as_sitesearch' => variable_get('google_cse_limit_domain', ''), + ); + + if (isset($_GET['more'])) { + $query['+more:'] = urlencode($_GET['more']); + } + + $url = url('http://www.google.com/cse', array('query' => $query)); + + // Get the google response. + $response = google_cse_adv_get_response($url); + + return $response; +} + + +/** + * Given the url with the search we try to do, get response from Google. + * + * @param string $url + * The Google URL to query. + * + * @return string + * The response from Google. + */ +function google_cse_adv_get_response($url) { + + $request = new stdClass(); + $request->url = $url; + + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $request->url); + // Return into a variable. + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_TIMEOUT, 30); + + if (module_exists('proxy_settings') && $proxy_host = proxy_settings_host('google_cse_adv')) { + + if ($proxy_port = proxy_settings_port('google_cse_adv')) { + curl_setopt($curl, CURLOPT_PROXY, $proxy_host . ':' . $proxy_port); + } + else { + curl_setopt($curl, CURLOPT_PROXY, $proxy_host); + } + if ($user = proxy_settings_username('google_cse_adv') && $password = proxy_settings_password('google_cse_adv')) { + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $user . ':' . $password); + } + } + + $response[] = curl_exec($curl); + curl_close($curl); + + return $response; +} + +/** + * Returns the thumbnail properly themed if configured to do so. + * + * @param array $img + * Image array. + * + * @return string + * The HTML for the image. + */ +function _google_cse_adv_thumbnail($title, $image_att) { + if (variable_get('google_cse_results_display_images', TRUE)) { + return theme('image', array( + 'path' => isset($image_att['value']) ? $image_att['value'] : '', + 'alt' => $title, + 'title' => $title, + 'attributes' => array('width' => '100px'), + 'getsize' => FALSE + )); + } + + return ''; +} + +/** + * Returns "hl" language param for search request. + * + * @return string + * The language code. + */ +function google_cse_adv_param_hl() { + + $language = variable_get('google_cse_adv_language', ''); + switch ($language) { + case 'active': + global $language; + return $language->language; + + default: + return ''; + } +} + + +/** + * Returns "lr" language param for search request. + * + * @return string + */ +function google_cse_adv_param_lr() { + switch (variable_get('google_cse_adv_language', '')) { + case 'active': + global $language; + return 'lang_' . $language->language; + + default: + return ''; + } +} + + +/** + * Function to fetch the results xml from Google. + * + * @param string $response + * @param string $keys + * @param string $conditions + * + * @return string + */ +function google_cse_adv_response_results($response, $keys, $conditions) { + $xml = simplexml_load_string($response); + $results = array(); + // Number of results. + $total = 0; + + if (isset($xml->RES->R)) { + + // Cap the result total if necessary. + // Google will not return more than 1000 results, but RES->M may + // be higher than this, which messes up our paging. Retain a copy + // of the original so that themers can still display it. + // Also, any result beyond pages 8x and 99 tends to repeat themselves, so + // they are not relevant. Limited then to 150 pages (1500) + $max_results = variable_get('google_cse_adv_maximum_results', 1500); + + $total = (int) $xml->RES->M; + $xml->RES->M_ORIGINAL = $total; + + // Is the result accurate? + if (!google_cse_adv_result_is_accurate($response)) { + $total = google_cse_adv_get_accurate_num_of_results($keys, $total); + } + + if ($total > $max_results) { + $xml->RES->M = $total = $max_results; + } + + foreach ($xml->RES->R as $result) { + + // Clean the text and remove tags. + $title = google_cse_adv_clean_str((string) $result->T); + + if ($result->PageMap) { + $att = $result->PageMap->DataObject->attributes(); + switch ($att['type']) { + case "cse_image": + $image_att = $result->PageMap->DataObject->Attribute->attributes(); + + // Clean the text. + $text_snippet = google_cse_adv_clean_str((string) $result->S); + + // Add a search result image. + $snippet = _google_cse_adv_thumbnail($title, $image_att) . $text_snippet; + + // Clean the text. + $extra = google_cse_adv_clean_str((string) $result->U); + $extra = parse_url($extra); + $extra = $extra['host']; + break; + + case "metatags": + // Clean the string. + $snippet = google_cse_adv_clean_str((string) $result->S); + + // Clean the string. + $extra = google_cse_adv_clean_str(check_plain((string) $result->U)); + + $extra = parse_url($extra); + $extra = $extra['host'] . " | Document"; + break; + } + } + else { + if ($result->SL_RESULTS) { + $snippet = strip_tags((string) $result->SL_RESULTS->SL_MAIN->BODY_LINE->BLOCK->T); + } + else { + $snippet = (string) $result->S; + } + // Clean the text. + $snippet = google_cse_adv_clean_str($snippet); + + // Clean the text. + $extra = google_cse_adv_clean_str(check_plain((string) $result->U)); + + $extra = parse_url($extra); + $extra = $extra['host']; + } + + // Results in a Drupal themed way for search. + $results[] = array( + 'link' => (string) $result->U, + 'title' => $title, + 'snippet' => $snippet, + 'keys' => check_plain($keys), + 'extra' => array($extra), + 'date' => NULL, + ); + } + + // No pager query was executed - we have to set the pager manually. + $limit = variable_get('google_cse_adv_results_per_page', 10); + pager_default_initialize($total, $limit); + + } + + // Allow other modules to alter the number of results. + drupal_alter('google_cse_num_results', $total); + + return $results; +} + +/** + * Check Return if the response from Google is accurate. + * + * Google initially estimates the exact number of results + * that the search should have. + * + * @param string $response + * The XML response from Google. + * + * @return bool + * TRUE if the results are considered accurate. + */ +function google_cse_adv_result_is_accurate($response) { + $accurate = FALSE; + // Time to get the response. + $xml = simplexml_load_string($response); + + // And to check the "accurate" Google variable, if the XT flag exists + // the search is accurate. + if (isset($xml->RES->XT)) { + $accurate = TRUE; + } + + return $accurate; +} + + +/** + * Get the exact (accurate) number of search results to be used in the pager. + * + * Google will never return more than 1000 results for any given search. If a + * request for the maximum results is made, Google will return the last page of + * the search results with the start and end position as attributes of the results. + * + * The tag encapsulates the set of individual search results and details + * about those results. The tag attributes are SN (the 1-based index of the first + * search result returned in this result set) and EN (the 1-based index of the + * last search result). + * + * @param string $keys + * The search keys. + * + * @param $total + * The initial estimated total. + * + * @return int + * The accurate total number of results. + */ +function google_cse_adv_get_accurate_num_of_results($keys, $total) { + $total_num_results = 0; + // Allow other modules to alter the keys. + drupal_alter('google_cse_searched_keys', $keys); + + $offset = GOOGLE_MAX_SEARCH_RESULTS - variable_get('google_cse_adv_results_per_page', 10); + $response = google_cse_adv_service($keys, $offset); + $xml = simplexml_load_string($response[0]); + if (isset($xml->RES)) { + // Get the 1-based index of the last search result item from the result end + // attribute (EN) of the search result tag (RES). + $attributes = $xml->RES->attributes(); + $total_num_results += (int) $attributes['EN']; + } + + // If we do not find an accurate result we will use the initial estimate. + if (!$total_num_results) { + $total_num_results = $total; + } + return $total_num_results; +} + + +/** + * Clean string of html, tags, etc... + * + * @param string $input_str + * The original string. + * + * @return string + * The cleaned output. + */ +function google_cse_adv_clean_str($input_str) { + $cleaned_str = $input_str; + + if (function_exists('htmlspecialchars_decode')) { + $cleaned_str = htmlspecialchars_decode($input_str, ENT_QUOTES); + } + + // Remove possible tags. + $cleaned_str = strip_tags($cleaned_str); + + return $cleaned_str; +} diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse_results.js b/profiles/openasu/modules/contrib/google_cse/google_cse_results.js new file mode 100644 index 0000000000..20df5110e4 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse_results.js @@ -0,0 +1,57 @@ +/** + * @file + * Google CSE JavaScript setup and invocation code. + */ + +// Callback to grab search terms from the URL and feed them to Google. +window.__gcse = { + callback: function () { + var keys = []; + if (Drupal.settings.googleCSE.keys) { + // Get search keys passed by settings. + keys[1] = Drupal.settings.googleCSE.keys; + } else { + // Fallback to get keys from URL, if not set in settings. + keys = /.*\/search\/google\/(.+)/.exec(document.location.pathname); + } + if (keys) { + var gcse = google.search.cse.element.getElement("google_cse"); + if (gcse) { + gcse.execute(decodeURIComponent(keys[1])); + } + } + } +}; + +// The Google CSE standard code, just changed to pick up the SE if +// ("cx") from Drupal.settings. +(function() { + var cx = Drupal.settings.googleCSE.cx; + var gcse = document.createElement('script'); + gcse.type = 'text/javascript'; + gcse.async = true; + gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + + '//www.google.com/cse/cse.js?cx=' + cx; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(gcse, s); +} +)(); + +// Added to send input from search block to Google endpoint. +// The Form API AJAX framework should probably be used here. +(function($) { + Drupal.behaviors.form_submit_processor = { + attach: function (context, settings) { + $("form#google-cse-results-searchbox-form").submit(function (e) { + e.preventDefault(); + keys = $('form#google-cse-results-searchbox-form #edit-query').val(); + if (keys) { + var gcse = google.search.cse.element.getElement("google_cse"); + if (gcse) { + gcse.execute(decodeURIComponent(keys)); + } + } + }); + } + } +})(jQuery); diff --git a/profiles/openasu/modules/contrib/google_cse/google_cse_results.tpl.php b/profiles/openasu/modules/contrib/google_cse/google_cse_results.tpl.php new file mode 100644 index 0000000000..1c3ee8edc9 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/google_cse_results.tpl.php @@ -0,0 +1,20 @@ + + + +
+ + + + + + +
+ + +
+ +
+ diff --git a/profiles/openasu/modules/contrib/google_cse/tests/google_cse.test b/profiles/openasu/modules/contrib/google_cse/tests/google_cse.test new file mode 100644 index 0000000000..077421b063 --- /dev/null +++ b/profiles/openasu/modules/contrib/google_cse/tests/google_cse.test @@ -0,0 +1,141 @@ + 'Google CSE Tests', + 'description' => 'Ensure that the Google Custom Search Engine is integrated with Search API.', + 'group' => 'Search', + ); + } + + /** + * Perform steps to setup Drupal installation for test runs. + */ + public function setUp() { + // The only dependency for the Google CSE module is search. + $modules = array( + 'google_cse', + 'search', + 'block', + ); + + parent::setUp($modules); + } + + /** + * Tests all SiteSearch configuration options. + */ + public function testSiteSearchSettingsConfig() { + // Need to have user for this test. + $this->setupGoogleCSEUser(); + + // Need to have Google CSE as default search. + $this->setupGoogleCSEAsDefaultSearch(); + + // Need to setup page with Google CSE search block until redirect issue is fixed. + // @todo Figure out why going to /search/google ended up in a redirect loop. + $this->setupGoogleCSESearchPage(); + + // Post to config form to save SiteSearch settings. + $edit = array(); + $edit['google_cse_sitesearch'] = "example.com/user User Search \n example.com/node Node Search"; + $edit['google_cse_sitesearch_form'] = 'radios'; + $this->drupalPost('admin/config/search/settings', $edit, t('Save configuration')); + + // Go to Google CSE search page. + $this->drupalGet('node/1'); + + // Assert that all SiteSearch options are there. + $this->assertText('Search the web', "Default SiteSearch radio button found."); + $this->assertText('User Search', "First SiteSearch radio button found."); + $this->assertText('Node Search', "Second SiteSearch radio button found."); + + // Post different config options for more checks. + $edit = array(); + $edit['google_cse_sitesearch_form'] = 'select'; + $edit['google_cse_sitesearch_option'] = 'Search Your Site'; + $edit['google_cse_sitesearch_default'] = 1; + $edit['google_cse_sitesearch'] = "example.com/user \n example.com/node"; + $this->drupalPost('admin/config/search/settings', $edit, t('Save configuration')); + + // Go to Google CSE search page. + $this->drupalGet('node/1'); + + // Assert select options have changed. + // Need to use raw option since the select list options are not visible. + $this->assertRaw('', "Default SiteSearch select option found."); + $this->assertRaw('', "First SiteSearch select option found and selected."); + $this->assertRaw('', "Second SiteSearch select option found."); + } + + /** + * Since most tests need a user and Google CSE to be default search, abstract to function. + */ + private function setupGoogleCSEUser() { + // Give the user all search permissions to use in testing. + $this->privileged_user = $this->drupalCreateUser(array( + 'search Google CSE', + 'administer search', + 'search content', + 'use advanced search', + 'administer site configuration', + 'access administration pages', + 'view the administration theme', + 'bypass node access', + 'administer content types', + 'administer blocks', + )); + + // Login user in order to edit config forms and use search. + $this->drupalLogin($this->privileged_user); + } + + /** + * Setup search variables as most Google CSE users will. + */ + private function setupGoogleCSEAsDefaultSearch() { + // Set variable for Drupal to use CSE as default search option. + // We will explicitly define it with the other search module options. + variable_set('search_active_modules', array( + 'google_cse' => 'google_cse', + 'node' => 'node', + 'user' => 'user', + )); + variable_set('search_default_module', 'google_cse'); + } + + /** + * Sets up a search block on "/node/1". + */ + private function setupGoogleCSESearchPage() { + $edit = array(); + $edit['name'] = 'CSE'; + $edit['type'] = 'cse'; + $this->drupalPost('admin/structure/types/add', $edit, t('Save content type')); + + $edit = array(); + $edit['title'] = 'Google CSE'; + $this->drupalPost('node/add/cse', $edit, t('Save')); + + $edit = array(); + $edit['types[cse]'] = TRUE; + $edit['regions[bartik]'] = 'content'; + $this->drupalPost('admin/structure/block/manage/google_cse/google_cse/configure', $edit, t('Save block')); + } +} + diff --git a/profiles/openasu/modules/custom/asu_events/asu_events.info b/profiles/openasu/modules/custom/asu_events/asu_events.info index 59a733d19b..69c4d8fdc2 100755 --- a/profiles/openasu/modules/custom/asu_events/asu_events.info +++ b/profiles/openasu/modules/custom/asu_events/asu_events.info @@ -1,5 +1,5 @@ name = "ASU Events" -description = "[DEVELOPMENT PREVIEW] Create and customize an ASU Events block from an ASU Events feed." +description = "[DEPRECATED - DO NOT USE - This module will be removed in the next release.] Create and customize an ASU Events block from an ASU Events feed." core = 7.x version = "7.x-3.0-alpha1" ; Added to staging module package diff --git a/profiles/openasu/modules/custom/asu_events/asu_events.install b/profiles/openasu/modules/custom/asu_events/asu_events.install index 7285c0ad16..8f5572dcf5 100755 --- a/profiles/openasu/modules/custom/asu_events/asu_events.install +++ b/profiles/openasu/modules/custom/asu_events/asu_events.install @@ -3,49 +3,10 @@ * @file * Install and update hooks. */ - -/** - * Implements hook_install(). - */ -function asu_events_install() { - // Create Asu Events Content type - _asu_events_create_node_type(); - $modules = array('addtocal', 'field_ellipsis');// Array of module names - $enable_dependencies = TRUE; // Whether or not to enable dependant modules - - module_enable($modules, $enable_dependencies); - cache_clear_all(); - // Create vocab - _asu_events_create_taxonomy(); - // Create fields - _asu_events_create_fields(); - // Disable panels for news and EventBase - - try { - _asu_events_disable_page_variants('node_view', array('node_view_panel_context_2')); - } - catch (ErrorException $e) { - drupal_set_message('Unable to disable node_view', 'status'); - } - try { - _asu_events_disable_views_events_page('events'); - } - catch (ErrorException $e) { - drupal_set_message('Unable to load view', 'status'); - } - try { - _asu_events_disable_views_events_page('events_new'); - } - catch (ErrorException $e) { - drupal_set_message('Unable to load view', 'status'); - } - $modules = array('asu_events_importer', 'asu_feeds2');// Array of module names - $enable_dependencies = TRUE; // Whether or not to enable dependant modules - - module_enable($modules, $enable_dependencies); - cache_clear_all(); - asu_events_update_7001(); - asu_events_update_7002(); +function asu_events_enable() { + drupal_set_message("Prevented enabling deprecated module."); + module_disable(array('asu_events')); + drupal_uninstall_modules(array('asu_events')); } function asu_events_uninstall(){ @@ -6321,3 +6282,14 @@ function _asu_events_create_fields_helper($data) { } } } + + +/** + * Implements hook_update_N(). + * + Disable deprecated experimental modules + * @param $sandbox + */ +function asu_events_update_7003(&$sandbox) { + module_disable(array('asu_events')); + drupal_uninstall_modules(array('asu_events')); +} \ No newline at end of file diff --git a/profiles/openasu/modules/custom/asu_news/asu_news.info b/profiles/openasu/modules/custom/asu_news/asu_news.info index f77465abf1..d3a401475b 100755 --- a/profiles/openasu/modules/custom/asu_news/asu_news.info +++ b/profiles/openasu/modules/custom/asu_news/asu_news.info @@ -1,5 +1,5 @@ name = "ASU News" -description = "[DEVELOPMENT PREVIEW] Create and customize an ASU News block from a ASU News feed." +description = "[DEPRECATED - DO NOT USE - This module will be removed in the next release.] Create and customize an ASU News block from a ASU News feed." core = 7.x version = "7.x-3.0-alpha1" ; Added to staging module package diff --git a/profiles/openasu/modules/custom/asu_news/asu_news.install b/profiles/openasu/modules/custom/asu_news/asu_news.install index 4ca569c562..1f48be0e29 100755 --- a/profiles/openasu/modules/custom/asu_news/asu_news.install +++ b/profiles/openasu/modules/custom/asu_news/asu_news.install @@ -3,43 +3,13 @@ * @file * Install and update hooks. */ - -/** - * Implements hook_install(). - */ -function asu_news_install() { - // Create ASU News Content type - _asu_news_create_node_type(); - $modules = array('asu_now_saf_taxonomy', 'asu_now_tags', 'asu_news_importer');// Array of module names - $enable_dependencies = TRUE; // Whether or not to enable dependant modules - - module_enable($modules, $enable_dependencies); - cache_clear_all(); - // Create Fields - _asu_news_create_fields(); - - // Disable panels for news and EventBase - try { - _asu_news_disable_page_variants('node_view', array('node_view_panel_context')); - } - catch (ErrorException $e) { - drupal_set_message('Unable to disable node_view', 'status'); - } - - try{ - _asu_news_disable_views_news_page(); - } - catch (ErrorException $e) { - drupal_set_message('Unable to load view', 'status'); - } - - $modules = array('asu_news_importer', 'asu_feeds2');// Array of module names - $enable_dependencies = TRUE; // Whether or not to enable dependant modules - - module_enable($modules, $enable_dependencies); - cache_clear_all(); +function asu_news_enable() { + drupal_set_message("Prevented enabling deprecated module."); + module_disable(array('asu_news')); + drupal_uninstall_modules(array('asu_news')); } + function _asu_news_disable_page_variants($page_name, $variant_ids) { $page = page_manager_get_page_cache($page_name); @@ -5727,3 +5697,13 @@ function _asu_news_create_fields_helper($data) { } } } + +/** + * Implements hook_update_N(). + * + Disable asu_news deprecated experimental module + * @param $sandbox + */ +function asu_news_update_7001(&$sandbox) { + module_disable(array('asu_news')); + drupal_uninstall_modules(array('asu_news')); +} diff --git a/profiles/openasu/modules/custom/webspark_test/behat/behat.travis.yml b/profiles/openasu/modules/custom/webspark_test/behat/behat.travis.yml index 995f1a04bc..d287767ca8 100644 --- a/profiles/openasu/modules/custom/webspark_test/behat/behat.travis.yml +++ b/profiles/openasu/modules/custom/webspark_test/behat/behat.travis.yml @@ -1,8 +1,20 @@ imports: - behat.common.yml +# default: extensions: Behat\MinkExtension: + selenium2: + # This will probably be the same always, if you follow the guide for browsers below. + wd_host: http://localhost:4444/wd/hub + capabilities: + chrome: + switches: + - "--headless" + - "--disable-gpu" + - "--no-sandbox" + javascript_session: selenium2 + browser_name: chrome base_url: http://127.0.0.1:8888 files_path: './profiles/openasu/modules/custom/webspark_test/behat' Drupal\DrupalExtension: @@ -10,7 +22,6 @@ default: root: "/home/travis/build/ASU/webspark-drops-drupal7" drupal: drupal_root: "/home/travis/build/ASU/webspark-drops-drupal7" - # Look in the profile modules directory and pull in module subcontexts. subcontexts: paths: diff --git a/profiles/openasu/modules/panopoly/panopoly_test/behat/behat.travis.yml b/profiles/openasu/modules/panopoly/panopoly_test/behat/behat.travis.yml index 2c4c37685b..b34d2d529b 100644 --- a/profiles/openasu/modules/panopoly/panopoly_test/behat/behat.travis.yml +++ b/profiles/openasu/modules/panopoly/panopoly_test/behat/behat.travis.yml @@ -4,6 +4,17 @@ imports: default: extensions: Behat\MinkExtension: + selenium2: + # This will probably be the same always, if you follow the guide for browsers below. + wd_host: http://localhost:4444/wd/hub + capabilities: + chrome: + switches: + - "--headless" + - "--disable-gpu" + - "--no-sandbox" + javascript_session: selenium2 + browser_name: chrome base_url: http://127.0.0.1:8888 files_path: './profiles/openasu/modules/panopoly/panopoly_test/behat' Drupal\DrupalExtension: @@ -11,7 +22,6 @@ default: root: "/home/travis/build/ASU/webspark-drops-drupal7" drupal: drupal_root: "/home/travis/build/ASU/webspark-drops-drupal7" - # Look in the profile modules directory and pull in module subcontexts. subcontexts: paths: diff --git a/profiles/openasu/modules/panopoly/panopoly_test/behat/features/video_widget.feature b/profiles/openasu/modules/panopoly/panopoly_test/behat/features/video_widget.feature index e0c56cdccc..cda26d7dbe 100644 --- a/profiles/openasu/modules/panopoly/panopoly_test/behat/features/video_widget.feature +++ b/profiles/openasu/modules/panopoly/panopoly_test/behat/features/video_widget.feature @@ -12,7 +12,7 @@ Feature: Add video widget And I click "Add video" in the "CTools modal" region Then I should see "Configure new Add video" - @api @javascript @panopoly_widgets @webspark_broken @webspark_ignore + @api @javascript @panopoly_widgets Scenario: Add a YouTube video When I fill in "Testing video" for "edit-title" When I click "Browse" diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gcse/CHANGELOG.md b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/CHANGELOG.md new file mode 100755 index 0000000000..9bf6173354 --- /dev/null +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/CHANGELOG.md @@ -0,0 +1,5 @@ +# ASU Google Custom Search Engine Changelog + +### ASU GCSE 7.x-1.0, 2019-01-17 +- Initial release of the ASU Google Custom Search Engine module +- Deprecated ASU GSA module diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.features.defaultconfig.inc b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.features.defaultconfig.inc new file mode 100644 index 0000000000..9f2e77ccae --- /dev/null +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.features.defaultconfig.inc @@ -0,0 +1,268 @@ + array( + 'strongarm' => 'strongarm', + ), + ); +} + +/** + * Implements hook_defaultconfig_strongarm(). + */ +function asu_gcse_defaultconfig_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 = 'google_cse_cof_google'; + $strongarm->value = 'FORID:0'; + $export['google_cse_cof_google'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_cof_here'; + $strongarm->value = 'FORID:9'; + $export['google_cse_cof_here'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_cr'; + $strongarm->value = ''; + $export['google_cse_cr'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_custom_css'; + $strongarm->value = ''; + $export['google_cse_custom_css'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_custom_results_display'; + $strongarm->value = 'full-width'; + $export['google_cse_custom_results_display'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_cx'; + $strongarm->value = '007921449323584335659:7htbgpmmreu'; + $export['google_cse_cx'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_domain'; + $strongarm->value = 'www.google.com'; + $export['google_cse_domain'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_gl'; + $strongarm->value = ''; + $export['google_cse_gl'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_hl'; + $strongarm->value = ''; + $export['google_cse_hl'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_ie'; + $strongarm->value = 'utf-8'; + $export['google_cse_ie'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_limit_domain'; + $strongarm->value = ''; + $export['google_cse_limit_domain'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_locale_hl'; + $strongarm->value = 0; + $export['google_cse_locale_hl'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_locale_lr'; + $strongarm->value = 0; + $export['google_cse_locale_lr'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_lr'; + $strongarm->value = ''; + $export['google_cse_lr'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_oe'; + $strongarm->value = ''; + $export['google_cse_oe'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_results_display'; + $strongarm->value = 'here'; + $export['google_cse_results_display'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_results_display_images'; + $strongarm->value = 1; + $export['google_cse_results_display_images'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_results_prefix'; + $strongarm->value = ''; + $export['google_cse_results_prefix'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_results_searchbox_width'; + $strongarm->value = '40'; + $export['google_cse_results_searchbox_width'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_results_suffix'; + $strongarm->value = ''; + $export['google_cse_results_suffix'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_results_tab'; + $strongarm->value = 'All of ASU'; + $export['google_cse_results_tab'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_results_width'; + $strongarm->value = '600'; + $export['google_cse_results_width'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_safe'; + $strongarm->value = 'high'; + $export['google_cse_safe'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_show_watermark'; + $strongarm->value = 1; + $export['google_cse_show_watermark'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_sitesearch'; + $strongarm->value = ''; + $export['google_cse_sitesearch'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_sitesearch_default'; + $strongarm->value = 0; + $export['google_cse_sitesearch_default'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_sitesearch_form'; + $strongarm->value = 'radios'; + $export['google_cse_sitesearch_form'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_sitesearch_option'; + $strongarm->value = ''; + $export['google_cse_sitesearch_option'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_tag_attributes'; + $strongarm->value = 'gname="google_cse"'; + $export['google_cse_tag_attributes'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'google_cse_use_adv'; + $strongarm->value = 0; + $export['google_cse_use_adv'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'search_active_modules'; + $strongarm->value = array( + 'google_cse' => 'google_cse', + 'node' => 'node', + 'file_entity' => 0, + 'user' => 0, + ); + $export['search_active_modules'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'search_cron_limit'; + $strongarm->value = '100'; + $export['search_cron_limit'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'search_default_module'; + $strongarm->value = 'node'; + $export['search_default_module'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'search_logging'; + $strongarm->value = 1; + $export['search_logging'] = $strongarm; + + return $export; +} diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.info b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.info new file mode 100644 index 0000000000..7198500cf4 --- /dev/null +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.info @@ -0,0 +1,45 @@ +name = ASU Google Custom Search Engine +description = Search ASU websites using Google Custom Search. +core = 7.x +package = ASU +version = 7.x-1.0 +dependencies[] = defaultconfig +dependencies[] = google_cse +scripts[] = /js/asu_gcse.js +stylesheets[all][] = /css/asu_gcse.css +features[defaultconfig][] = strongarm:google_cse_cof_google +features[defaultconfig][] = strongarm:google_cse_cof_here +features[defaultconfig][] = strongarm:google_cse_cr +features[defaultconfig][] = strongarm:google_cse_custom_css +features[defaultconfig][] = strongarm:google_cse_custom_results_display +features[defaultconfig][] = strongarm:google_cse_cx +features[defaultconfig][] = strongarm:google_cse_domain +features[defaultconfig][] = strongarm:google_cse_gl +features[defaultconfig][] = strongarm:google_cse_hl +features[defaultconfig][] = strongarm:google_cse_ie +features[defaultconfig][] = strongarm:google_cse_limit_domain +features[defaultconfig][] = strongarm:google_cse_locale_hl +features[defaultconfig][] = strongarm:google_cse_locale_lr +features[defaultconfig][] = strongarm:google_cse_lr +features[defaultconfig][] = strongarm:google_cse_oe +features[defaultconfig][] = strongarm:google_cse_results_display +features[defaultconfig][] = strongarm:google_cse_results_display_images +features[defaultconfig][] = strongarm:google_cse_results_prefix +features[defaultconfig][] = strongarm:google_cse_results_searchbox_width +features[defaultconfig][] = strongarm:google_cse_results_suffix +features[defaultconfig][] = strongarm:google_cse_results_tab +features[defaultconfig][] = strongarm:google_cse_results_width +features[defaultconfig][] = strongarm:google_cse_safe +features[defaultconfig][] = strongarm:google_cse_show_watermark +features[defaultconfig][] = strongarm:google_cse_sitesearch +features[defaultconfig][] = strongarm:google_cse_sitesearch_default +features[defaultconfig][] = strongarm:google_cse_sitesearch_form +features[defaultconfig][] = strongarm:google_cse_sitesearch_option +features[defaultconfig][] = strongarm:google_cse_tag_attributes +features[defaultconfig][] = strongarm:google_cse_use_adv +features[defaultconfig][] = strongarm:search_active_modules +features[defaultconfig][] = strongarm:search_cron_limit +features[defaultconfig][] = strongarm:search_default_module +features[defaultconfig][] = strongarm:search_logging +features[features_api][] = api:2 +project path = profiles/openasu/modules/webspark_featurescustom diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.install b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.install new file mode 100644 index 0000000000..b41e92cbdd --- /dev/null +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/asu_gcse.install @@ -0,0 +1,8 @@ + 'inline', + 'scope' => 'header', + 'group' => JS_THEME, + 'weight' => -10 + )); + + // Checking if a search has been done on the site and if so, check which type and redirect to appropriate search type + if (isset($_POST['search_keys']) || isset($_POST['search_header'])) { + + // Get current path and set variables for later use + $path = current_path(); + $exp = explode("/", $path); + $type = $exp[0]; + $query = ''; + + if (isset($_POST['search_keys'])) { + $query = check_plain($_POST['search_keys']); + if (strpos($query, "quot;") != FALSE) { + $query = str_replace('"', '"', $query); + } + if ($query != $_POST['search_keys']) { + $query = '"' . $query . '"'; + } + } + + if (isset($_POST['search_header'])) { + $query = check_plain($_POST['search_header']); + if (strpos($query, 'quot;') != FALSE) { + $query = str_replace('"', '"', $query); + } + $type = 'search'; + if ($query != $_POST['search_header']) { + $query = '"' . $query . '"'; + } + } + + // Send query to redirect function for processing search type + asu_gcse_redirect($query, $type); + } + +} + +/** + * Redirect to the appropriate search engine based on search type + */ +function asu_gcse_redirect($query, $type) { + if ($query != "") { + if ($type == "search") { + drupal_goto('search/node/' . $query); + } else if ($type == "global") { + drupal_goto('search/google/' . $query); + } else { + drupal_goto('search/node/' . $query); + } + } else { + drupal_set_message(t("Please enter a valid search query."), 'error'); + } +} + +/** + * Implements hook_process_page + * @param $variables + */ +function asu_gcse_process_page(&$variables) { + + // Set the 'Search Results' title on search pages + if (arg(0) == 'search') { + $variables['title'] = 'Search Results'; + } +} \ No newline at end of file diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gcse/css/asu_gcse.css b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/css/asu_gcse.css new file mode 100644 index 0000000000..e239152ff9 --- /dev/null +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/css/asu_gcse.css @@ -0,0 +1,148 @@ +/* GOOGLE SEARCH */ + +/* Removes border that's being added to nav pills on hover */ +/* +.page-search #top-content #tabs .nav-pills li a:hover { + border: none !important; +}*/ + +/* Forces ASU brand standard button styling */ +/* +.page-search #top-content #tabs .nav-pills > li.active > a { + background-color: #8c1d40 !important; + color: #ffffff !important; + font-weight: 400 !important; +} +.page-search #top-content #tabs .nav-pills > li.active > a:hover { + background-color: #d23153 !important; + color: #ffffff !important; + font-weight: 400 !important; +} +.page-search #top-content #tabs .nav-pills li a { + background-color: #dbdbdb !important; + color: #2a2a2a !important; + font-weight: 400 !important; +} +.page-search #top-content #tabs .nav-pills li a:hover { + background-color: #f2f2f2 !important; + color: #2a2a2a !important; + font-weight: 400 !important; +} +*/ +/* Hides various unneeded elements on the page (e.g. the ad area, the extra search box, files showing in results, etc) */ +.page-search .gsc-wrapper .gsc-adBlock, +.page-search .gsc-search-box, +.page-search .gsc-search-box-tools, +.page-search .gsc-resultsHeader, +.page-search .gs-fileFormat { + display: none !important; +} + +/* Forces the Google search background color to transparent (versus white) */ +.page-search .gsc-table-result > tbody > tr, +.page-search .gsc-above-wrapper-area-container > tbody > tr { + background-color: transparent !important; +} + +/* Adds spacing between the 'About xxx results' element and the search results below it */ +.page-search .gsc-above-wrapper-area { + margin-bottom: 3em !important; +} + +/* Removes space between text snippet and URL elements (in order to appear more like a Google search) */ +.page-search .gs-snippet { + margin-top: -.5em !important; +} + +/* Adds space between URL and result title elements (in order to appear more like a Google search) */ +.page-search .gs-visibleUrl-long { + margin-top: .25em !important; +} + +/* Removes an extra border that is created due to Google and Webspark styling incompatibilities */ +.page-search #google-cse-results tbody, +.page-search #google-cse-results table tbody tr td { + border-top: none !important; +} + +/* Removes the whitespace to the left of the Google search results */ +.page-search .gsc-table-result, +.page-search .gsc-thumbnail-inside, +.page-search .gsc-url-top, +.page-search .gsc-control-cse, +.page-search .gsc-result-info-container, +.page-search .gsc-result-info { + padding-left: 0 !important; +} + +/* Adds appropriate ASU gray text color for 'About xxx results' and 'Sort by' elements */ +.page-search .gsc-above-wrapper-area-container .gsc-result-info, +.page-search .gsc-above-wrapper-area-container .gsc-orderby-label{ + color: #5C6670; +} + +/* Adds ASU brand standard-like styling to the bottom pager */ +.page-search .gsc-results .gsc-cursor-page { + padding: 8px !important; + font-size: 1.5em !important; +} +.page-search .gsc-results .gsc-cursor-box .gsc-cursor-current-page { + color: #FFFFFF !important; +} +.page-search .gsc-results .gsc-cursor-box { + text-align: center !important; +} + + + + +/* LOCAL SITE (NODE) SEARCH */ + +/* Hides the advanced search options */ +.page-search .search-form .search-advanced { + display: none !important; +} + +/* Removes the whitespace to the left of the local search results */ +.page-search .search-results, +.page-search .node-results { + padding-left: 0 !important; +} + + + + +/* COMMON CSS */ + +/* Forces search box and search submit button onto the same line */ +.page-search .search-form .container-inline div, +.page-search .search-form #edit-submit { + display: inline-block; +} + +.page-search #top-content #tabs .nav-pills > li.active > a, .page-search #top-content #tabs .nav-pills > li.active > a:hover { + background-color: transparent; + color: #2a2a2a; + border-bottom: 5px solid #a30046; + padding-left: 0; + padding-right: 0; + margin-right: 2.2em; + border-radius: 0; + font-size: 18px; +} + +.page-search #top-content #tabs .nav-pills li a, .page-search #top-content #tabs .nav-pills li a:hover { + background-color: transparent; + color: #2a2a2a; + font-weight: 400; + padding-left: 0; + padding-right: 0; + margin-right: 2.2em; + border-radius: 0; + font-size: 18px; +} + +.page-search #top-content #tabs .nav-pills li a:hover { + color: #000; + border-bottom: 5px solid #a30046; +} \ No newline at end of file diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gcse/js/asu_gcse.js b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/js/asu_gcse.js new file mode 100644 index 0000000000..032a1d0789 --- /dev/null +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gcse/js/asu_gcse.js @@ -0,0 +1,56 @@ +(function($) { + Drupal.behaviors.asu_gcse_search = { + attach: function (context, settings) { + + // Get URL path and set search variable + var url_path_name = window.location.pathname; + var url_search = '/search/'; + var node_search = 'search/node'; + var google_search = 'search/google'; + + // If user is currently on a page with 'search' in the path + if (url_path_name.indexOf(url_search) === 0) { + + var first_nav_pill_text_check = $('.nav-pills li:first-child a').text(); + + // Move 'Content' aka 'This site' nav pill to first position if it's last (because it falls alphabetically behind 'All of ASU' either way) + if (first_nav_pill_text_check != 'Content') { + var $nav_pill_to_move = $('.nav-pills li:last-child'); + if ($nav_pill_to_move.not(':first-child')) { + $nav_pill_to_move.prev().before($nav_pill_to_move); + } + } + + // Get nav pill data + var first_nav_pill_url = $('.nav-pills li:first-child a').attr("href"); + var first_nav_pill_text = $('.nav-pills li:first-child a').text(); + var last_nav_pill_url = $('.nav-pills li:last-child a').attr("href"); + var last_nav_pill_text = $('.nav-pills li:last-child a').text(); + + // Get the title set by the site + var asu_site_title = $('.asu-site-title').text(); + + // Forced a document title, because it doesn't reflect the h1 title (on both search pages) + document.title = "Search Results | " + asu_site_title; + + // If the first nav pill URL matches the node_search form ('search/node') then proceed + if (first_nav_pill_url && first_nav_pill_url.indexOf(node_search) != -1) { + // Change 'Content' nav pill label to 'This site' + $('.nav-pills li:first-child a').text("This site"); + + // Hide 'Search results' h2 title (not the same as the #page-title added above) that is produced by node search + if ($('.content h2').text() != '') { + $('.content h2').hide(); + } + } + + // If the last nav pill URL matches the node_search form ('search/google') then proceed + if (last_nav_pill_url && last_nav_pill_url.indexOf(google_search) != -1) { + // Google engine-specific JS here + } + + } + + } + }; +})(jQuery); \ No newline at end of file diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.info b/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.info index 24e500a4fa..c8e0174a73 100755 --- a/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.info +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.info @@ -1,7 +1,7 @@ -name = ASU GSA -description = "ASU-specific customizations for Google Search Appliance results, and the Google Appliance contrib module." +name = ASU GSA [DEPRECATED] +description = "[DEPRECATED] ASU-specific customizations for Google Search Appliance results, and the Google Appliance contrib module." core = 7.x -package = ASU +package = ASU Deprecated version = 7.x-1.2 project = asu_gsa dependencies[] = google_appliance diff --git a/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.install b/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.install index b28ba26055..ea329d5198 100755 --- a/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.install +++ b/profiles/openasu/modules/webspark_featurescustom/asu_gsa/asu_gsa.install @@ -77,3 +77,24 @@ function asu_gsa_update_7000(&$sandbox) { watchdog('update', 'asu_gsa_update_7000 was applied.', array(), WATCHDOG_NOTICE); drupal_set_message('If your search results are broken after this ASU GSA module update, please go to /admin/config/search/google_appliance/settings and re-save that form.', 'warning'); } + +/** +* Implements hook_update_N(). +* Automagically enable GCSE module and disable GSA module. +*/ +function asu_gsa_update_7101(&$sandbox) { + // Array for modules that we want to enable with update.php (GCSE) + $modules_to_enable = array( + 'asu_gcse' + ); + // Array for modules that we want to disable with update.php (GSA) + $modules_to_disable = array( + 'asu_gsa', + 'google_appliance', + 'panopoly_search', + 'search_api_solr' + ); + drupal_set_message("Attempting to disable asu_gsa and enable asu_gcse in its place."); + module_enable($modules_to_enable, TRUE); // Adding TRUE forces dependencies to also be enabled + module_disable($modules_to_disable); +} diff --git a/profiles/openasu/modules/webspark_featurescustom/webspark_featurescustom.install b/profiles/openasu/modules/webspark_featurescustom/webspark_featurescustom.install index d77281d331..08eec8c268 100644 --- a/profiles/openasu/modules/webspark_featurescustom/webspark_featurescustom.install +++ b/profiles/openasu/modules/webspark_featurescustom/webspark_featurescustom.install @@ -31,11 +31,14 @@ function webspark_featurescustom_update_dependencies() { // Makes doubly sure for older Panopoly updates that 7118 comes before 7005 (panopoly_search) // Overrides panopoly_widgets_update_dependencies in panopoly_search.install // Remove this once panopoly patches the issue on their end. + + /* Removing panopoly_search from Webspark $deps['panopoly_search'][7005] = array( 'search_api' => 7118, 'search_api_db' => 7104, 'search_api_solr' => 7102, - ); + );*/ + // Ensure that ASU Brand module updates to v4.5 last, after other prior updates $deps['asu_brand'][7102] = array( 'asu_cas' => 7001, @@ -391,4 +394,4 @@ function webspark_featurescustom_update_7012(&$sandbox) { watchdog('webspark_featurescustom', $messaging['msg'], array(), $messaging['watch_state']); } -} +} \ No newline at end of file diff --git a/profiles/openasu/openasu.info b/profiles/openasu/openasu.info index f3eadf13a9..9b3d9a42e0 100644 --- a/profiles/openasu/openasu.info +++ b/profiles/openasu/openasu.info @@ -5,7 +5,7 @@ core = 7.x exclusive = 1 ;version = VERSION ; Remember to update in innovation as well for DOM -version = 1.64 +version = 1.64.1 ; Drupal Core dependencies[] = taxonomy @@ -36,7 +36,6 @@ dependencies[] = panopoly_widgets ; Panopoly Toolset dependencies[] = panopoly_pages -dependencies[] = panopoly_search dependencies[] = panopoly_wysiwyg ; Panopoly Recommended - Admin @@ -72,7 +71,7 @@ dependencies[] = asu_brand ; Container module built for Webspark custom features dependencies[] = webspark_featurescustom -dependencies[] = asu_gsa +dependencies[] = asu_gcse dependencies[] = asu_maps_enhanced dependencies[] = asu_spotlight dependencies[] = uto_carousel diff --git a/profiles/openasu/openasu.make b/profiles/openasu/openasu.make index 9f3a1dfbc6..0e6bcba857 100644 --- a/profiles/openasu/openasu.make +++ b/profiles/openasu/openasu.make @@ -56,7 +56,6 @@ projects[panopoly_test][patch][137] = patches/webspark-847_panopoly-test-137-upd projects[panopoly_test][patch][1370] = patches/webspark-847_behat_common.patch projects[panopoly_test][patch][142] = patches/webspark-944_add-init-config-tests-panopoly-test.patch projects[panopoly_test][patch][143] = patches/webspark-1066-panopoly-test-v146.patch -projects[panopoly_test][patch][1640] = patches/v1.64-behat-test-disable-video-test.patch ; ASU-specific, Webspark-agnostic modules (/custom directory contents) ;projects[asu_drupal_modules][type] = module @@ -166,6 +165,10 @@ projects[google_appliance][version] = 1.14 projects[google_appliance][type] = module projects[google_appliance][subdir] = contrib +projects[google_cse][version] = 2.5 +projects[google_cse][type] = module +projects[google_cse][subdir] = contrib + projects[maxlength][version] = 3.2-beta2 projects[maxlength][type] = module projects[maxlength][subdir] = contrib diff --git a/profiles/openasu/patches/v1.64-behat-test-disable-video-test.patch b/profiles/openasu/patches/v1.64-behat-test-disable-video-test.patch deleted file mode 100644 index c5a98a960c..0000000000 --- a/profiles/openasu/patches/v1.64-behat-test-disable-video-test.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/behat/features/video_widget.feature b/behat/features/video_widget.feature -index cda26d7db..e0c56cdcc 100644 ---- behat/features/video_widget.feature -+++ behat/features/video_widget.feature -@@ -12,7 +12,7 @@ Feature: Add video widget - And I click "Add video" in the "CTools modal" region - Then I should see "Configure new Add video" - -- @api @javascript @panopoly_widgets -+ @api @javascript @panopoly_widgets @webspark_broken @webspark_ignore - Scenario: Add a YouTube video - When I fill in "Testing video" for "edit-title" - When I click "Browse" diff --git a/profiles/openasu/themes/innovation/template.php b/profiles/openasu/themes/innovation/template.php index e6baa5e740..808528ae9a 100644 --- a/profiles/openasu/themes/innovation/template.php +++ b/profiles/openasu/themes/innovation/template.php @@ -38,7 +38,7 @@ function innovation_preprocess_html(&$variables) { '#tag' => 'meta', '#attributes' => array( // Don't forget to update openasu.info as well!! - 'content' => 'Webspark:1.64 (California)', + 'content' => 'Webspark:1.64.1 (San Diego)', 'http-equiv' => 'X-Name-of-Distro', 'name' => 'cmsversion', )