diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/LICENSE.txt b/profiles/wcm_base/modules/contrib/apachesolr_views/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/README.txt b/profiles/wcm_base/modules/contrib/apachesolr_views/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..1c3c8d36339be8e817d0c384922b77d0573cad83 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/README.txt @@ -0,0 +1,81 @@ +CONTENTS OF THIS FILE +--------------------- +* Introduction +* Requirements +* Installation +* Configuration +* Troubleshooting +* Advantages +* Limitations +* Maintainers + +INTRODUCTION +------------ + +This module provides a Views integration to the Apache Solr Search Integration +project. It provides the views plugins and handlers needed to be able to +create a view that fetches its results from Apachesolr index, without hitting +the database. + +REQUIREMENTS +------------ + +Requires Apache Solr Search https://www.drupal.org/project/apachesolr +Requires the use of an Apachesolr search index. + +INSTALLATION +------------ + +Download and install the module as normal. + +CONFIGURATION +------------- + +First make sure that Apachesolr module is configured correctly. +If in the page "admin/config/search/apachesolr/settings" the Apachesolr +environment is green and working, you can test this by using the site +search page. +Create a view from admin/structure/views/add and choose Apachesolr search. All +of the fields indexed in solr should be available as views fields/filters/sort. +Configure the view as needed and save it. + +TROUBLESHOOTING +--------------- + +This module can diagnose problems with solr entity indexing: +https://www.drupal.org/project/solr_devel +Solr admin adds even more options, and is usually available at: +http://[host]:8983/solr/admin/ + +ADVANTAGES +---------- + +It is impossible to have duplicate results, unlike database views. + +Queries do not hit the database, and so they offload the database server. + +Views are very easy to customize, unlike search pages. + +LIMITATIONS +----------- + +Exposed filters are only textfields. See [#1807028]. + +Search facets are supported, but may not work reliably in combination with +views filters. + +Search sort block is not supported. See [#443410]. + +Multiple Apachesolr views on the same page do not work See [#1766254]. + +Most entity field types are not sent to Solr, and will not be available as +views handlers. Apachesolr views doesn't index the fields itself. This is +done from other modules by implementing hook_apachesolr_field_mappings(). + +MAINTAINERS +----------- + +The 7.x branch is maintained by Miroslav Vladimirov Banov. +https://www.drupal.org/user/1509224 + +The 6.x branch is unmaintained. diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.info b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.info new file mode 100644 index 0000000000000000000000000000000000000000..45284dd12c2e7d602b262472c86dae4e963d3e30 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.info @@ -0,0 +1,27 @@ +name = Apache Solr Views integration +description = Provides Apache Solr integration with Views +package = Search Toolkit +core = "7.x" + +dependencies[] = apachesolr +dependencies[] = apachesolr_search +dependencies[] = views + +files[] = apachesolr_views_query.inc +files[] = apachesolr_views_solr_base_query.inc +files[] = handlers/apachesolr_views_handler_field.inc +files[] = handlers/apachesolr_views_handler_field_date.inc +files[] = handlers/apachesolr_views_snippet_handler_field.inc +files[] = handlers/apachesolr_views_handler_sort.inc +files[] = handlers/apachesolr_views_handler_filter.inc +files[] = handlers/apachesolr_views_handler_filter_date.inc +files[] = handlers/apachesolr_views_handler_filter_string.inc +files[] = handlers/apachesolr_views_keyword_handler_filter.inc +files[] = handlers/apachesolr_views_handler_argument.inc + +; Information added by Drupal.org packaging script on 2015-05-21 +version = "7.x-1.1-beta1" +core = "7.x" +project = "apachesolr_views" +datestamp = "1432238584" + diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.module b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.module new file mode 100644 index 0000000000000000000000000000000000000000..38779f8691502c540aeb9af3405ab7363b9de335 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.module @@ -0,0 +1,36 @@ +<?php + +/** + * @file + * Provides Views Implementation for the ApacheSolr Search Integration project + * drupal.org/project/apachesolr + */ + +/** + * Implements of hook_views_api(). + */ +function apachesolr_views_views_api() { + return array('api' => '3.0'); +} + +/** + * Implements hook_views_query_alter(). + */ +function apachesolr_views_views_query_alter($view, $query) { + if (get_class($query) == 'apachesolr_views_query' && isset($view->fields['snippet'])) { + // Add additional parameters to get snippet. + // @see apachesolr_search_highlighting_params(). + $params['hl'] = variable_get('apachesolr_hl_active', NULL); + $params['hl.fragsize'] = variable_get('apachesolr_hl_textsnippetlength', NULL); + $params['hl.simple.pre'] = variable_get('apachesolr_hl_pretag', NULL); + $params['hl.simple.post'] = variable_get('apachesolr_hl_posttag', NULL); + $params['hl.snippets'] = variable_get('apachesolr_hl_numsnippets', NULL); + // This should be an array of possible field names. + $params['hl.fl'] = variable_get('apachesolr_hl_fieldtohighlight', NULL); + $params = array_filter($params); + + foreach ($params as $key => $value) { + $view->query->add_parameter($key, $value); + } + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.views.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.views.inc new file mode 100644 index 0000000000000000000000000000000000000000..7d1b0d57f4e1a2a44c13cbd86d72aaab632b31df --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views.views.inc @@ -0,0 +1,142 @@ +<?php + +/** + * @file + * Contains Views hooks to register Views plugins and handlers. + */ + +/** + * Implements of hook_views_plugins(). + */ +function apachesolr_views_views_plugins() { + return array( + 'module' => 'apachesolr_views', + 'query' => array( + 'apachesolr_views_query' => array( + 'title' => t('Apache Solr Query'), + 'help' => t('Query that allows you to search with Apache Solr.'), + 'handler' => 'apachesolr_views_query', + 'parent' => 'views_query', + ), + ), + ); + +} + +/** + * Implements of hook_views_data(). + */ +function apachesolr_views_views_data() { + foreach (apachesolr_load_all_environments() as $env_id => $environment) { + $name = $environment['name']; + $apachesolr_base_table = 'apachesolr__' . $env_id; + + $data[$apachesolr_base_table]['table']['group'] = t('Apache Solr'); + $data[$apachesolr_base_table]['table']['base'] = array( + 'query class' => 'apachesolr_views_query', + 'title' => t('Apache Solr @name', array('@name' => $name)), + 'help' => t('Searches the site with the Apache Solr search engine for @name', array('@name' => $name)), + ); + + // Get the list of the fields in index directly from Solr. + try { + $solr = apachesolr_get_solr($env_id); + $solr_fields = $solr->getFields(0); + } + catch (Exception $e) { + $solr_fields = array(); + watchdog('Apache Solr Views', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_WARNING); + } + + foreach ($solr_fields as $solr_field_name => $solr_field) { + + // We do not allow to display 'sort_*' fields. + if (strpos($solr_field_name, 'sort_') === 0) { + continue; + } + + $field_type = $solr_field->type; + + $field_handler = 'apachesolr_views_handler_field'; + $filter_handler = 'apachesolr_views_handler_filter'; + switch ($field_type) { + case 'tdate': + $field_handler = 'apachesolr_views_handler_field_date'; + $filter_handler = 'apachesolr_views_handler_filter_date'; + break; + + case 'text': + case 'string': + $filter_handler = 'apachesolr_views_handler_filter_string'; + break; + } + + $data[$apachesolr_base_table][$solr_field_name] = array( + 'title' => $solr_field_name, + 'help' => filter_xss(apachesolr_field_name_map($solr_field_name)), + 'field' => array( + 'handler' => $field_handler, + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => $filter_handler, + ), + 'sort' => array( + 'handler' => 'apachesolr_views_handler_sort', + ), + 'argument' => array( + 'handler' => 'apachesolr_views_handler_argument', + ), + ); + + // Default sort field for label. + $sort_field_name = ($solr_field_name == 'label') ? 'sort_label' : ''; + // Check if corresponding sort_ field exists. We remove prefix from field + // name (for example prefix "ss_" from "ss_name") and check if "sort_*" + // field is available. + if (array_key_exists('sort_' . substr($solr_field_name, 2), $solr_fields)) { + $sort_field_name = 'sort_' . substr($solr_field_name, 2); + } + if (!empty($sort_field_name)) { + // Use the sort field for click sorting. + $data[$apachesolr_base_table][$solr_field_name]['field']['click sort field'] = $sort_field_name; + // And use the sort field for explicit sorts. + $data[$apachesolr_base_table][$solr_field_name]['sort']['real field'] = $sort_field_name; + } + } + + // Keyword field. + $data[$apachesolr_base_table]['keyword'] = array( + 'title' => t('Search'), + 'help' => t('Fulltext search'), + 'filter' => array( + 'handler' => 'apachesolr_views_keyword_handler_filter', + ), + ); + + // Snippet field. + $data[$apachesolr_base_table]['snippet'] = array( + 'title' => t('Snippet'), + 'help' => t('Search snippet'), + 'field' => array( + 'handler' => 'apachesolr_views_snippet_handler_field', + 'click sortable' => TRUE, + ), + ); + + // Score field. + $data[$apachesolr_base_table]['score'] = array( + 'title' => t('Score'), + 'help' => t('Score'), + 'field' => array( + 'handler' => 'apachesolr_views_handler_field', + 'click sortable' => TRUE, + ), + 'sort' => array( + 'handler' => 'apachesolr_views_handler_sort', + ), + ); + } + + return $data; +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views_query.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views_query.inc new file mode 100644 index 0000000000000000000000000000000000000000..c10da5c088177f1654fb963c5961963ebe340410 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views_query.inc @@ -0,0 +1,274 @@ +<?php + +/** + * @file + * Views query plugin for Apache Solr Views. + * Gets its data not from the database, but from a Solr server. + */ + +class apachesolr_views_query extends views_plugin_query { + + /** + * Array of parameters for Solr query. + */ + protected $params; + protected $query_params; + public $orderby = array(); + + /** + * Store results of apachesolr search. + */ + protected $apachesolr_results; + + /** + * Array of where conditions. + * + * Neede for grouppin of query conditions. + */ + protected $where = array(); + + /** + * The default group operator. + * + * @var string + */ + protected $group_operator = 'AND'; + + /** + * Builds what is necessary prior to executing the query. + */ + public function build(&$view) { + $view->init_pager(); + + // Let the pager modify the query to add limits. + $this->pager->query(); + + // Add fields to the query so they will be shown in solr document. + $this->params['fl'] = array_keys($view->field); + + $params = array(); + if (isset($this->params['q'])) { + $params['q'] = $this->params['q']; + } + + $params['rows'] = $this->pager->options['items_per_page']; + $params['start'] = $this->pager->current_page * $this->pager->options['items_per_page']; + + // If we display all items without pager. + if ($params['rows'] == 0) { + $params['rows'] = 100000; + } + + // Add fields. + $params['fl'] = array('id', 'entity_id'); + if (isset($this->params['fl'])) { + $params['fl'] = array_merge($params['fl'], $this->params['fl']); + } + $params['fl'] = implode(',', $params['fl']); + + $where = $this->where; + // Remove any empty conditions (exposed filters), they will cause an error. + foreach ($where as &$where_condition) { + foreach ($where_condition['conditions'] as $index => $condition) { + if ($condition['value'] == '') { + unset($where_condition['conditions'][$index]); + } + } + } + // Add conditions to filter parameter. + $conditions = array('conditions' => $where, 'type' => $this->group_operator); + $conditions_string = $this->build_where_string($conditions); + + if (!empty($conditions_string)) { + $params['fq'] = $conditions_string; + } + + // Set query type if it is present. + if (isset($this->params['defType'])) { + $params['defType'] = $this->params['defType']; + } + + $this->query_params = $params; + + // Export parameters for preview. + $view->build_info['query'] = var_export($params, TRUE); + } + + /** + * Let modules modify the query just prior to finalizing it. + */ + public function alter(&$view) { + foreach (module_implements('views_query_alter') as $module) { + $function = $module . '_views_query_alter'; + $function($view, $this); + } + } + + /** + * Executes the query. + * + * Assigns the resulting values to the view object. + * Values to set: $view->result, $view->total_rows, $view->execute_time. + */ + public function execute(&$view) { + try { + $start = microtime(TRUE); + + // Execute the search. + + + // Load search query. + // Get the Apache Solr "environment id". + if (strpos($view->base_table, 'apachesolr__') === 0) { + $env_id = substr($view->base_table, 12); + } + else { + $env_id = apachesolr_default_environment(); + } + + $solr = apachesolr_get_solr($env_id); + $context = array( + 'search_type' => 'apachesolr_views_query', + 'view_name' => $view->name, + 'current_display' => $view->current_display, + ); + + $query = new ApachesolrViewsSolrBaseQuery('apachesolr', $solr, $this->query_params, '', current_path(), $context, $view); + + // Add sorting. The setSolrsort method can't be used, because it doesn't support multiple sorting criteria. + $query->replaceParam('sort', $this->orderby); + + $query->page = $this->pager->current_page; + + // Boost parameters if apachesolr_search module is available. + apachesolr_search_add_boost_params($query); + + // Execute search. + list($final_query, $response) = apachesolr_do_query($query); + apachesolr_has_searched($solr->getId(), TRUE); + + // Store results. + $view->result = $response->response->docs; + + // Store apachesolr cached response. + $this->apachesolr_response = $response; + + // Store the results. + $this->pager->total_items = $view->total_rows = $this->apachesolr_response->response->numFound; + $this->pager->update_page_info(); + } + catch (Exception $e) { + $view->result = array(); + $view->total_rows = 0; + if (!empty($view->live_preview)) { + drupal_set_message($e->getMessage(), 'error'); + } + else { + vpr('Exception in @human_name[@view_name]: @message', array('@human_name' => $view->human_name, '@view_name' => $view->name, '@message' => $e->getMessage())); + } + } + + $view->execute_time = microtime(TRUE) - $start; + } + + public function add_filter($type, $value, $exclude = FALSE) { + $exclude_string = ($exclude) ? '-' : ''; + $this->params['filters'][] = $exclude_string . $type . ':(' . $value . ')'; + } + + public function add_filter_string($string) { + $this->params['q.alt'][] = $string; + } + + public function add_sort($field, $order) { + $this->orderby[] = "$field $order"; + } + + public function add_parameter($key, $value) { + $this->params[$key] = $value; + } + + public function add_field($table_alias, $field, $alias = '', $params = array()) { + // Make sure an alias is assigned. + $alias = $alias ? $alias : $field; + return $alias; + } + + public function get_params() { + return $this->params; + } + + /** + * Build filter string from where array. + */ + function build_where_string($where) { + if (!isset($where['conditions'])) { + return $where['field'] . ':(' . $where['value'] . ')'; + } + else { + $condition_strings = array(); + foreach ($where['conditions'] as $condition) { + $condition_strings[] = $this->build_where_string($condition); + } + $condition_strings = array_filter($condition_strings); + $condition_string = implode(' ' . $where['type'] . ' ', $condition_strings); + // Respect grouping by wrapping multiple conditions with parenthesis. + if (count($condition_strings) > 1) { + $condition_string = '(' . $condition_string . ')'; + } + return $condition_string; + } + } + + /** + * Support for groupping. + * + * @see views_plugin_query_default::add_where(). + */ + function add_where($group, $field, $value = NULL, $operator = NULL) { + // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all + // the default group. + if (empty($group)) { + $group = 0; + } + + // Check for a group. + if (!isset($this->where[$group])) { + $this->set_where_group('AND', $group); + } + + $this->where[$group]['conditions'][] = array( + 'field' => $field, + 'value' => $value, + 'operator' => $operator, + ); + } + + /** + * Support for groupping. + * + * @see views_plugin_query_default::set_where_group(). + */ + function set_where_group($type = 'AND', $group = NULL, $where = 'where') { + // Set an alias. + $groups = &$this->$where; + + if (!isset($group)) { + $group = empty($groups) ? 1 : max(array_keys($groups)) + 1; + } + + // Create an empty group + if (empty($groups[$group])) { + $groups[$group] = array('conditions' => array(), 'args' => array()); + } + + $groups[$group]['type'] = strtoupper($type); + return $group; + } + + /** + * Implement ensure_table, do nothing. + */ + function ensure_table($table, $relationship = NULL, $join = NULL) { + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views_solr_base_query.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views_solr_base_query.inc new file mode 100644 index 0000000000000000000000000000000000000000..4d6c96072af5b39b7f9fe5436939b3e6fa5aa2ad --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/apachesolr_views_solr_base_query.inc @@ -0,0 +1,61 @@ +<?php + +/** + * @file + * Contains custom SolrBaseQuery class for Apachesolr Views. + */ + +class ApachesolrViewsSolrBaseQuery extends SolrBaseQuery { + + // The view related with this query object. + protected $view; + + /** + * Constructs a new archiver instance. + * + * @param string $name + * The search name, used for finding the correct blocks and other config. + * Typically "apachesolr". + * + * @param string $solr + * An instantiated DrupalApacheSolrService Object. + * Can be instantiated from apachesolr_get_solr(). + * + * @param array $params + * Array of params to initialize the object (typically 'q' and 'fq'). + * + * @param string $sortstring + * Visible string telling solr how to sort - added to GET query params. + * + * @param string $base_path + * The search base path (without the keywords) for this query, + * without trailing slash. + * + * @param array $context + * The context related with this query. + * + * @param object $view + * The view object related with this query. + */ + public function __construct($name, $solr, array $params = array(), $sortstring = '', $base_path = '', $context = array(), $view = NULL) { + parent::__construct($name, $solr, $params, $sortstring, $base_path, $context); + $this->view = $view; + } + + /** + * Need to set proper base path for facets. + */ + public function getPath($new_keywords = NULL) { + if (isset($new_keywords)) { + return $this->base_path . '/' . $new_keywords; + } + return $this->base_path; + } + + /** + * Returns the view related with this query object. + */ + public function getView() { + return $this->view; + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_argument.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_argument.inc new file mode 100644 index 0000000000000000000000000000000000000000..c9f9a919b4061e36d00b340b0b4f711400f9f495 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_argument.inc @@ -0,0 +1,16 @@ +<?php + +/** + * @file + * Argument handler for Apache Solr Views. + */ + +class apachesolr_views_handler_argument extends views_handler_argument { + + /** + * Set up the query parameters for this argument. + */ + public function query($group_by = FALSE) { + $this->query->add_where(0, $this->real_field, $this->argument); + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field.inc new file mode 100644 index 0000000000000000000000000000000000000000..e2fa480ade2fe1252e706befaa89ae24dca1d8f2 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field.inc @@ -0,0 +1,33 @@ +<?php + +/** + * @file + * Field handler for Apache Solr Views. + */ + +class apachesolr_views_handler_field extends views_handler_field { + + /** + * Retrieve value from Solr result document. + */ + public function get_value($values, $field = NULL) { + $alias = isset($field) ? $this->aliases[$field] : $this->field_alias; + if (isset($values->{$alias})) { + if (is_array($values->{$alias})) { + return decode_entities(implode(' ', $values->{$alias})); + } + else { + return decode_entities($values->{$alias}); + } + } + } + + /** + * Called to determine what to tell the clicksorter. + */ + public function click_sort($order) { + $sort_field = (isset($this->definition['click sort field']) ? $this->definition['click sort field'] : $this->real_field); + $this->query->add_sort($sort_field, $order); + } + +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field_date.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field_date.inc new file mode 100644 index 0000000000000000000000000000000000000000..eac4c8193d9f06957c5697f6b19256a33096c2f4 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field_date.inc @@ -0,0 +1,23 @@ +<?php + +/** + * Field handler for Solr date fields. + */ +class apachesolr_views_handler_field_date extends views_handler_field_date { + + // Transform a Solr date field into a Unix timestamp + function get_value($values, $field = NULL) { + $value = parent::get_value($values, $field); + if (isset($value)) { + return strtotime($value); + } + } + + /** + * Called to determine what to tell the clicksorter. + */ + function click_sort($order) { + $sort_field = (isset($this->definition['click sort field']) ? $this->definition['click sort field'] : $this->real_field); + $this->query->add_sort($sort_field, $order); + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter.inc new file mode 100644 index 0000000000000000000000000000000000000000..1297b6a81b6a0b72919de5f7bf5f96a40c1e2f84 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter.inc @@ -0,0 +1,55 @@ +<?php + +/** + * @file + * Main filter handler for Apache Solr Views. + */ + +class apachesolr_views_handler_filter extends views_handler_filter { + + /** + * Add this filter to the query. + */ + public function query() { + $this->trim_value(); + + if (!empty($this->value)) { + if (is_array($this->value)) { + $this->value = implode(' OR ', $this->value); + } + $this->query->add_where($this->options['group'], $this->real_field, $this->value, $this->operator); + } + } + + /** + * Trim filter value. + */ + public function trim_value() { + // Trim both array or scalar value. + if (is_array($this->value)) { + array_walk($this->value, 'apachesolr_views_handler_filter::trim'); + $this->value = array_filter($this->value); + } + else { + $this->value = trim($this->value); + } + } + + /** + * Trim value. + */ + public function trim(&$value) { + $value = trim($value); + } + + /** + * Provide a simple textfield for equality. + */ + public function value_form(&$form, &$form_state) { + $form['value'] = array( + '#type' => 'textfield', + '#title' => t($this->definition['title']), + '#default_value' => $this->value, + ); + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_date.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_date.inc new file mode 100644 index 0000000000000000000000000000000000000000..7b1f82f393cc8d38597ac66342cbb4a138c3b8f9 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_date.inc @@ -0,0 +1,157 @@ +<?php + +/** + * @file + * Date filter handler for Apache Solr Views. + */ + +// Date format used by Solr. +define('APACHESOLR_VIEWS_DATE_ISO8601', 'Y-m-d\TH:i:s\Z'); + +class apachesolr_views_handler_filter_date extends views_handler_filter_date { + + /** + * Filter for a date within certain range. + */ + public function op_between($field) { + $min_value = $this->obtain_formated_date($this->value['min'], '00:00:00'); + $max_value = $this->obtain_formated_date($this->value['max'], '23:59:59.999'); + $value = "[$min_value TO $max_value]"; + $operator = strtoupper($this->operator); + $this->query->add_where($this->options['group'], $this->real_field, $value, $operator); + } + + /** + * Add the date filter to the query parameters. + */ + public function op_simple($field) { + $value = intval(strtotime($this->value['value'])); + $value = new DateObject($value); + + // Probably there is a better way with dateobject, but no way to find how. + $has_time = strpos($this->value['value'], ':'); + + $value_format = $value->format(APACHESOLR_VIEWS_DATE_ISO8601); + switch ($this->operator) { + case '<': + case '<=': + if ($has_time) { + $value = '[* TO ' . $value_format . ']'; + } + else { + $value = '[* TO ' . $value_format . '/DAY+1DAY]'; + } + break; + + case '>': + case '>=': + if ($has_time) { + $value = '[' . $value_format . ' TO *]'; + } + else { + $value = '[' . $value_format . '/DAY TO *]'; + } + break; + + case '!=': + if ($has_time) { + $value = '[* TO ' . $value_format . '-1SECOND] OR [' . $value_format . '+1SECOND TO *]'; + } + else { + $value = '[* TO ' . $value_format . '/DAY-1DAY] OR [' . $value_format . '/DAY+1DAY TO *]'; + } + break; + + case '=': + default: + if ($has_time) { + $value = '[' . $value_format . ' TO ' . $value_format . ']'; + } + else { + $value = '[' . $value_format . '/DAY TO ' . $value_format . '/DAY+1DAY]'; + } + break; + } + $this->query->add_where($this->options['group'], $this->real_field, $value, $this->operator); + } + + /** + * Add a type selector to the value form. + */ + public function value_form(&$form, &$form_state) { + parent::value_form($form, $form_state); + // Remove offset functionality. + unset($form['value']['type']); + + // Add class to identify in jquery input fields and add jquery.ui.datepicker + if (isset($form['value']['min'])) { + $form['value']['max']['#attributes']['class'][] = 'views_input_date'; + $form['value']['min']['#attributes']['class'][] = 'views_input_date'; + } + else { + $form['value']['value']['#attributes']['class'][] = 'views_input_date'; + } + } + + /** + * Override to allow ranges without end-date, assume * if not present. + */ + public function accept_exposed_input($input) { + if (empty($this->options['exposed'])) { + return TRUE; + } + + // Store this because it will get overwritten. + $type = $this->value['type']; + $rc = parent::accept_exposed_input($input); + + $operators = $this->operators(); + if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator_id'])) { + $operator = $input[$this->options['expose']['operator_id']]; + } + else { + $operator = $this->operator; + } + + if ($operators[$operator]['values'] != 1) { + // This is the line overridden. + if ($this->value['min'] == '' && $this->value['max'] == '') { + return FALSE; + } + else { + return TRUE; + } + } + + // Restore what got overwritten by the parent. + $this->value['type'] = $type; + return $rc; + } + + /** + * Obtains a formated data for SOLR. + * + * @param string $date_str + * Date in string format. + * @param string $round_string + * String to add if no time is present. + * + * @return string + * The date formated for SOLR. + */ + public function obtain_formated_date($date_str, $round_string = '00:00:00') { + // Guess if we time part to the date and if not, add the round string. + if ($date_str != '' && !strpos($date_str, ':')) { + $date_str .= ' ' . $round_string; + } + $time = intval(strtotime($date_str)); + if ($time != 0) { + $date = new DateObject($time); + $date_formatted = $date->format(APACHESOLR_VIEWS_DATE_ISO8601); + } + else { + $date_formatted = '*'; + } + return $date_formatted; + } +} \ No newline at end of file diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_string.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_string.inc new file mode 100644 index 0000000000000000000000000000000000000000..69ab64944ec4da5cfa99b92311e6803427d1e007 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_string.inc @@ -0,0 +1,90 @@ +<?php + +/** + * @file + * Sring filter handler for Apache Solr Views. + */ + +class apachesolr_views_handler_filter_string extends views_handler_filter_string { + + /** + * Override the operators provided from the parent class. + */ + public function operators() { + $operators = parent::operators(); + foreach (array('shorterthan', 'longerthan', 'regular_expression', + 'contains', 'ends', 'not_ends') as $key) { + if (isset($operators[$key])) { + unset($operators[$key]); + } + } + return $operators; + } + + /** + * Operator for equality. + */ + public function op_equal($field) { + if ($this->operator == '!=') { + $this->real_field = '-' . $this->real_field; + } + $this->query->add_where($this->options['group'], $this->real_field, $this->value); + } + + /** + * Contains any word. + */ + public function op_word($field) { + $where_operator = $this->operator == 'word' ? ' OR ' : ' AND '; + $where = array(); + + // Don't filter on empty strings. + if (empty($this->value)) { + return; + } + + preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' ' . $this->value, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $phrase = FALSE; + // Strip off phrase quotes. + if ($match[2]{0} == '"') { + $match[2] = substr($match[2], 1, -1); + $phrase = TRUE; + } + $words = trim($match[2], ',?!();:-'); + $words = $phrase ? array($words) : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY); + foreach ($words as $word) { + $where[] = trim($word, ' ,!?') . '*'; + } + } + + if (!$where) { + return; + } + + // Previously this was a call_user_func_array but that's unnecessary + // as views will unpack an array that is a single arg. + $this->query->add_where($this->options['group'], $this->real_field, implode($where_operator, $where)); + } + + /** + * Operator for string starting with a value. + */ + public function op_starts($field) { + $this->query->add_where($this->options['group'], $this->real_field, $this->value . '*'); + } + + /** + * Operator for not string starting with a value. + */ + public function op_not_starts($field) { + $this->query->add_where($this->options['group'], '-' . $this->real_field, $this->value . '*'); + } + + /** + * Does not contain. + */ + public function op_not($field) { + $this->query->add_where($this->options['group'], '-' . $this->real_field, $this->value); + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_sort.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_sort.inc new file mode 100644 index 0000000000000000000000000000000000000000..d3e70e80ed955fe3d0782fef11665209400bb30f --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_sort.inc @@ -0,0 +1,19 @@ +<?php + +/** + * @file + * Sort handler for Apache Solr Views. + */ + +class apachesolr_views_handler_sort extends views_handler_sort { + + /** + * Places the sort into the search parameters. + */ + public function query() { + // Find out why apachesolr module adds sort_* fields + // to index and use them if needed. + $order = strtolower($this->options['order']); + $this->query->add_sort($this->real_field, $order); + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_keyword_handler_filter.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_keyword_handler_filter.inc new file mode 100644 index 0000000000000000000000000000000000000000..ab31312f4bfae5bae1b3040588c7f8a5d5ebc237 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_keyword_handler_filter.inc @@ -0,0 +1,18 @@ +<?php + +/** + * @file + * Filter handler to do fulltext keyword search. + */ + +class apachesolr_views_keyword_handler_filter extends apachesolr_views_handler_filter { + + /** + * Add this filter to the query. + */ + public function query() { + if (!empty($this->value)) { + $this->query->add_parameter('q', $this->value); + } + } +} diff --git a/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_snippet_handler_field.inc b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_snippet_handler_field.inc new file mode 100644 index 0000000000000000000000000000000000000000..f0511f0c149566dcf25c039021e07d45ef441120 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/apachesolr_views/handlers/apachesolr_views_snippet_handler_field.inc @@ -0,0 +1,60 @@ +<?php + +/** + * @file + * Snippet field handler for Apache Solr Views. + */ + +class apachesolr_views_snippet_handler_field extends views_handler_field { + + /** + * Retrieve value from Solr result document. + */ + public function get_value($doc, $field = NULL) { + $response = $this->query->apachesolr_response; + + // We default to getting snippets from the body content and comments. + $hl_fl = array('content', 'ts_comments'); + + $params = $this->query->get_params(); + if (isset($params['hl.fl'])) { + $hl_fl = $params['hl.fl']; + } + + // Start with an empty snippets array. + $snippets = array(); + + // Find the nicest available snippet. + foreach ($hl_fl as $hl_param) { + if (isset($response->highlighting->{$doc->id}->$hl_param)) { + // Merge arrays preserving keys. + foreach ($response->highlighting->{$doc->id}->$hl_param as $value) { + $snippets[$hl_param] = $value; + } + } + } + // If there's no snippet at this point, add the teaser. + if (!$snippets) { + if (isset($doc->teaser)) { + $snippets[] = truncate_utf8($doc->teaser, 256, TRUE); + } + } + + $hook = 'apachesolr_search_snippets'; + if (isset($doc->entity_type)) { + $hook .= '__' . $doc->entity_type; + } + if (!empty($doc->bundle)) { + $hook .= '__' . $doc->bundle; + } + return theme($hook, array('doc' => $doc, 'snippets' => $snippets)); + } + + /** + * Render the snippet field. + */ + public function render($values) { + $value = $this->get_value($values); + return $this->sanitize_value($value, 'xss'); + } +} diff --git a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.field_instance.inc b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.field_instance.inc index 0bd003184ac8c61f4565175be5a66b4e18d21b61..91cf95993f56ffb1ad3c15c480d929b81401d58c 100644 --- a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.field_instance.inc +++ b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.field_instance.inc @@ -138,9 +138,9 @@ function ocio_media_field_default_field_instances() { ), 'image_small' => array( 'label' => 'above', - 'module' => 'ocio_field_bases', + 'module' => 'text', 'settings' => array(), - 'type' => 'ocio_field_bases_accordion', + 'type' => 'text_default', 'weight' => 1, ), 'preview' => array( diff --git a/profiles/wcm_base/modules/custom/wcm_search/wcm_search.make b/profiles/wcm_base/modules/custom/wcm_search/wcm_search.make index fd770934093269bd02427bddde2a65c4d6ce4bce..dda9a9a5f491fab3523ac231355441808b3f0bd6 100644 --- a/profiles/wcm_base/modules/custom/wcm_search/wcm_search.make +++ b/profiles/wcm_base/modules/custom/wcm_search/wcm_search.make @@ -12,5 +12,8 @@ projects[apachesolr][subdir] = contrib projects[apachesolr_file][version] = 1.x-dev projects[apachesolr_file][subdir] = contrib +projects[apachesolr_views][version] = 1.1-beta1 +projects[apachesolr_views][subdir] = contrib + projects[search_api_attachments][version] = 1.3 projects[search_api_attachments][subdir] = contrib diff --git a/profiles/wcm_base/modules/custom/wcm_search/wcm_search.module b/profiles/wcm_base/modules/custom/wcm_search/wcm_search.module index f7011d930e10640a9731b36e54f03267b37f2d13..6784b829794fdcb6e25d691e63d2a0574a791ee6 100644 --- a/profiles/wcm_base/modules/custom/wcm_search/wcm_search.module +++ b/profiles/wcm_base/modules/custom/wcm_search/wcm_search.module @@ -72,8 +72,8 @@ function wcm_search_form_alter(&$form, &$form_state, $form_id) { else { $query = $args[1]; } + $form['search_block_form']['#default_value'] = $query; } - $form['search_block_form']['#default_value'] = $query; } } diff --git a/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.css b/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.css index 51c958fe907275615488967c50394264beeede85..19fe7c41246d2e744f7ae8f1a38af624ae81d206 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.css +++ b/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.css @@ -195,6 +195,41 @@ html body .button.ext .ext, width: 0; } +#colorbox #cboxWrapper { + border-radius: 0; + font-size: 1.1em; +} +#colorbox #cboxWrapper #cboxClose, +#colorbox #cboxWrapper #cboxPrevious, +#colorbox #cboxWrapper #cboxNext { + background-image: none; + text-indent: 0; + color: transparent; + overflow: hidden; +} +#colorbox #cboxWrapper #cboxClose:before, +#colorbox #cboxWrapper #cboxPrevious:before, +#colorbox #cboxWrapper #cboxNext:before { + font-family: FontAwesome; + bottom: -3px; + position: absolute; + color: #000; +} +#colorbox #cboxWrapper #cboxClose:before { + content: "\f00d"; + right: 0; + font-size: 1.2em; +} +#colorbox #cboxWrapper #cboxPrevious:before { + content: "\f053"; +} +#colorbox #cboxWrapper #cboxNext:before { + content: "\f054"; +} +#colorbox #cboxWrapper #cboxCurrent { + bottom: -3px; +} + span.ext { margin-left: 1px; margin-right: 2px; @@ -324,27 +359,10 @@ form .chosen-container.chosen-container-multi .chosen-choices li.search-field in width: inherit; } -.image-border, .panopoly-image-featured, -.panopoly-image-full, -.panopoly-image-half, -.panopoly-image-original, -.panopoly-image-quarter, -.panopoly-image-square, -.panopoly-image-thumbnail { +.image-border { border: 1px solid #666666; } -.node__content .panopoly-image-featured, -.node__content .panopoly-image-full, -.node__content .panopoly-image-half, -.node__content .panopoly-image-original, -.node__content .panopoly-image-quarter, -.node__content .panopoly-image-square, -.node__content .panopoly-image-thumbnail { - float: right; - margin: 0 0 20px 1.5em; -} - .ui-widget table, .ui-widget td, .ui-widget tr, .ui-widget th { border: 0; } @@ -733,6 +751,10 @@ ol ol ol { padding-left: 0.6em; } +.media-element-container { + margin-bottom: 1.5em; +} + .media-element-container, .media-element { /* @@ -741,11 +763,21 @@ ol ol ol { $separator: "-"; } */ + display: table; + table-layout: fixed; + max-width: 100%; } .media-element-container.file-default, .media-element.file-default { margin: 0 0 1em 0; } +.media-element-container.file-image-full, .media-element-container.file-image-large, .media-element-container.file-image-medium, .media-element-container.file-image-small, +.media-element.file-image-full, +.media-element.file-image-large, +.media-element.file-image-medium, +.media-element.file-image-small { + margin: 0 0 1em 0; +} .media-element-container.file-image-left, .media-element.file-image-left { float: left; @@ -763,13 +795,20 @@ ol ol ol { } .media-element-container.file-image-max, .media-element.file-image-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-image-max .content, .media-element.file-image-max .content { width: 100%; } +.media-element-container.file-video-full, .media-element-container.file-video-large, .media-element-container.file-video-medium, .media-element-container.file-video-small, +.media-element.file-video-full, +.media-element.file-video-large, +.media-element.file-video-medium, +.media-element.file-video-small { + margin: 0 0 1em 0; +} .media-element-container.file-video-left, .media-element.file-video-left { float: left; @@ -790,37 +829,31 @@ ol ol ol { } .media-element-container.file-video-max, .media-element.file-video-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-video-max .content, .media-element.file-video-max .content { width: 100%; } -.media-element-container .file-image .content, -.media-element .file-image .content { - display: table; - table-layout: fixed; - max-width: 100%; -} -.media-element-container .file-image .content img, -.media-element .file-image .content img { +.media-element-container img, +.media-element img { display: block; width: 100%; + margin: 0; } -.media-element-container .file-image .content .field--name-field-basic-image-caption, -.media-element-container .file-image .content .field-name-field-basic-image-caption, -.media-element .file-image .content .field--name-field-basic-image-caption, -.media-element .file-image .content .field-name-field-basic-image-caption { - font-size: 0.9em; - font-weight: 600; - line-height: 1.3em; - padding: 0.4em 0.7em; - background-color: #666666; - color: #fff; +.media-element-container .field--name-field-basic-image-caption, +.media-element-container .field-name-field-basic-image-caption, +.media-element .field--name-field-basic-image-caption, +.media-element .field-name-field-basic-image-caption { display: table-caption; caption-side: bottom; - font-family: Capita; + font-family: "capita", Georgia, serif; + font-size: 0.9em; + font-weight: 300; + font-style: italic; + line-height: 1.3em; + color: #606060; } /* @@ -832,41 +865,6 @@ img, media { max-width: 100%; } -#colorbox #cboxWrapper { - border-radius: 0; - font-size: 1.1em; -} -#colorbox #cboxWrapper #cboxClose, -#colorbox #cboxWrapper #cboxPrevious, -#colorbox #cboxWrapper #cboxNext { - background-image: none; - text-indent: 0; - color: transparent; - overflow: hidden; -} -#colorbox #cboxWrapper #cboxClose:before, -#colorbox #cboxWrapper #cboxPrevious:before, -#colorbox #cboxWrapper #cboxNext:before { - font-family: FontAwesome; - bottom: -3px; - position: absolute; - color: #000; -} -#colorbox #cboxWrapper #cboxClose:before { - content: "\f00d"; - right: 0; - font-size: 1.2em; -} -#colorbox #cboxWrapper #cboxPrevious:before { - content: "\f053"; -} -#colorbox #cboxWrapper #cboxNext:before { - content: "\f054"; -} -#colorbox #cboxWrapper #cboxCurrent { - bottom: -3px; -} - @media (max-width: 47.5em) { .field .media-element.media-youtube-video, .field .media-element.media-vimeo-video { @@ -883,10 +881,10 @@ img, media { } .media.media-element-container.media-image_right { float: right !important; + margin-left: 2em; } .media.media-element-container.media-image_right .field-name-field-basic-image-caption, .media.media-element-container.media-image_right .field--name-field-basic-image-caption { clear: right; - margin-left: 1.5em; } /** diff --git a/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.no-query.css b/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.no-query.css index 568ccda00b9a2ad9b180a660f42de4a7c43a4460..5a13622e4dc4e7fe26995667c6373b9318e0ca5c 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.no-query.css +++ b/profiles/wcm_base/themes/ocio_omega_base/css/layouts/ocio-default/ocio-default.layout.no-query.css @@ -195,6 +195,41 @@ html body .button.ext .ext, width: 0; } +#colorbox #cboxWrapper { + border-radius: 0; + font-size: 1.1em; +} +#colorbox #cboxWrapper #cboxClose, +#colorbox #cboxWrapper #cboxPrevious, +#colorbox #cboxWrapper #cboxNext { + background-image: none; + text-indent: 0; + color: transparent; + overflow: hidden; +} +#colorbox #cboxWrapper #cboxClose:before, +#colorbox #cboxWrapper #cboxPrevious:before, +#colorbox #cboxWrapper #cboxNext:before { + font-family: FontAwesome; + bottom: -3px; + position: absolute; + color: #000; +} +#colorbox #cboxWrapper #cboxClose:before { + content: "\f00d"; + right: 0; + font-size: 1.2em; +} +#colorbox #cboxWrapper #cboxPrevious:before { + content: "\f053"; +} +#colorbox #cboxWrapper #cboxNext:before { + content: "\f054"; +} +#colorbox #cboxWrapper #cboxCurrent { + bottom: -3px; +} + span.ext { margin-left: 1px; margin-right: 2px; @@ -323,27 +358,10 @@ form .chosen-container.chosen-container-multi .chosen-choices li.search-field in width: inherit; } -.image-border, .panopoly-image-featured, -.panopoly-image-full, -.panopoly-image-half, -.panopoly-image-original, -.panopoly-image-quarter, -.panopoly-image-square, -.panopoly-image-thumbnail { +.image-border { border: 1px solid #666666; } -.node__content .panopoly-image-featured, -.node__content .panopoly-image-full, -.node__content .panopoly-image-half, -.node__content .panopoly-image-original, -.node__content .panopoly-image-quarter, -.node__content .panopoly-image-square, -.node__content .panopoly-image-thumbnail { - float: right; - margin: 0 0 20px 1.5em; -} - .ui-widget table, .ui-widget td, .ui-widget tr, .ui-widget th { border: 0; } @@ -732,6 +750,10 @@ ol ol ol { padding-left: 0.6em; } +.media-element-container { + margin-bottom: 1.5em; +} + .media-element-container, .media-element { /* @@ -740,11 +762,21 @@ ol ol ol { $separator: "-"; } */ + display: table; + table-layout: fixed; + max-width: 100%; } .media-element-container.file-default, .media-element.file-default { margin: 0 0 1em 0; } +.media-element-container.file-image-full, .media-element-container.file-image-large, .media-element-container.file-image-medium, .media-element-container.file-image-small, +.media-element.file-image-full, +.media-element.file-image-large, +.media-element.file-image-medium, +.media-element.file-image-small { + margin: 0 0 1em 0; +} .media-element-container.file-image-left, .media-element.file-image-left { float: left; @@ -762,13 +794,20 @@ ol ol ol { } .media-element-container.file-image-max, .media-element.file-image-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-image-max .content, .media-element.file-image-max .content { width: 100%; } +.media-element-container.file-video-full, .media-element-container.file-video-large, .media-element-container.file-video-medium, .media-element-container.file-video-small, +.media-element.file-video-full, +.media-element.file-video-large, +.media-element.file-video-medium, +.media-element.file-video-small { + margin: 0 0 1em 0; +} .media-element-container.file-video-left, .media-element.file-video-left { float: left; @@ -789,37 +828,31 @@ ol ol ol { } .media-element-container.file-video-max, .media-element.file-video-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-video-max .content, .media-element.file-video-max .content { width: 100%; } -.media-element-container .file-image .content, -.media-element .file-image .content { - display: table; - table-layout: fixed; - max-width: 100%; -} -.media-element-container .file-image .content img, -.media-element .file-image .content img { +.media-element-container img, +.media-element img { display: block; width: 100%; + margin: 0; } -.media-element-container .file-image .content .field--name-field-basic-image-caption, -.media-element-container .file-image .content .field-name-field-basic-image-caption, -.media-element .file-image .content .field--name-field-basic-image-caption, -.media-element .file-image .content .field-name-field-basic-image-caption { - font-size: 0.9em; - font-weight: 600; - line-height: 1.3em; - padding: 0.4em 0.7em; - background-color: #666666; - color: #fff; +.media-element-container .field--name-field-basic-image-caption, +.media-element-container .field-name-field-basic-image-caption, +.media-element .field--name-field-basic-image-caption, +.media-element .field-name-field-basic-image-caption { display: table-caption; caption-side: bottom; - font-family: Capita; + font-family: "capita", Georgia, serif; + font-size: 0.9em; + font-weight: 300; + font-style: italic; + line-height: 1.3em; + color: #606060; } /* @@ -831,41 +864,6 @@ img, media { max-width: 100%; } -#colorbox #cboxWrapper { - border-radius: 0; - font-size: 1.1em; -} -#colorbox #cboxWrapper #cboxClose, -#colorbox #cboxWrapper #cboxPrevious, -#colorbox #cboxWrapper #cboxNext { - background-image: none; - text-indent: 0; - color: transparent; - overflow: hidden; -} -#colorbox #cboxWrapper #cboxClose:before, -#colorbox #cboxWrapper #cboxPrevious:before, -#colorbox #cboxWrapper #cboxNext:before { - font-family: FontAwesome; - bottom: -3px; - position: absolute; - color: #000; -} -#colorbox #cboxWrapper #cboxClose:before { - content: "\f00d"; - right: 0; - font-size: 1.2em; -} -#colorbox #cboxWrapper #cboxPrevious:before { - content: "\f053"; -} -#colorbox #cboxWrapper #cboxNext:before { - content: "\f054"; -} -#colorbox #cboxWrapper #cboxCurrent { - bottom: -3px; -} - .field .media-element.media-youtube-video, .field .media-element.media-vimeo-video { width: 100%; @@ -881,10 +879,10 @@ img, media { .media.media-element-container.media-image_right { float: right !important; + margin-left: 2em; } .media.media-element-container.media-image_right .field-name-field-basic-image-caption, .media.media-element-container.media-image_right .field--name-field-basic-image-caption { clear: right; - margin-left: 1.5em; } /** diff --git a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css index e084fb8b14baf71f6dce21efae6ace417e74c0c7..901a83bdf426911657b13a4b59175539152b656c 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css +++ b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.no-query.css @@ -191,6 +191,41 @@ html body .button.ext .ext, width: 0; } +#colorbox #cboxWrapper { + border-radius: 0; + font-size: 1.1em; +} +#colorbox #cboxWrapper #cboxClose, +#colorbox #cboxWrapper #cboxPrevious, +#colorbox #cboxWrapper #cboxNext { + background-image: none; + text-indent: 0; + color: transparent; + overflow: hidden; +} +#colorbox #cboxWrapper #cboxClose:before, +#colorbox #cboxWrapper #cboxPrevious:before, +#colorbox #cboxWrapper #cboxNext:before { + font-family: FontAwesome; + bottom: -3px; + position: absolute; + color: #000; +} +#colorbox #cboxWrapper #cboxClose:before { + content: "\f00d"; + right: 0; + font-size: 1.2em; +} +#colorbox #cboxWrapper #cboxPrevious:before { + content: "\f053"; +} +#colorbox #cboxWrapper #cboxNext:before { + content: "\f054"; +} +#colorbox #cboxWrapper #cboxCurrent { + bottom: -3px; +} + span.ext { margin-left: 1px; margin-right: 2px; @@ -319,27 +354,10 @@ form .chosen-container.chosen-container-multi .chosen-choices li.search-field in width: inherit; } -.image-border, .panopoly-image-featured, -.panopoly-image-full, -.panopoly-image-half, -.panopoly-image-original, -.panopoly-image-quarter, -.panopoly-image-square, -.panopoly-image-thumbnail { +.image-border { border: 1px solid #666666; } -.node__content .panopoly-image-featured, -.node__content .panopoly-image-full, -.node__content .panopoly-image-half, -.node__content .panopoly-image-original, -.node__content .panopoly-image-quarter, -.node__content .panopoly-image-square, -.node__content .panopoly-image-thumbnail { - float: right; - margin: 0 0 20px 1.5em; -} - .ui-widget table, .ui-widget td, .ui-widget tr, .ui-widget th { border: 0; } @@ -728,6 +746,10 @@ ol ol ol { padding-left: 0.6em; } +.media-element-container { + margin-bottom: 1.5em; +} + .media-element-container, .media-element { /* @@ -736,11 +758,21 @@ ol ol ol { $separator: "-"; } */ + display: table; + table-layout: fixed; + max-width: 100%; } .media-element-container.file-default, .media-element.file-default { margin: 0 0 1em 0; } +.media-element-container.file-image-full, .media-element-container.file-image-large, .media-element-container.file-image-medium, .media-element-container.file-image-small, +.media-element.file-image-full, +.media-element.file-image-large, +.media-element.file-image-medium, +.media-element.file-image-small { + margin: 0 0 1em 0; +} .media-element-container.file-image-left, .media-element.file-image-left { float: left; @@ -758,13 +790,20 @@ ol ol ol { } .media-element-container.file-image-max, .media-element.file-image-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-image-max .content, .media-element.file-image-max .content { width: 100%; } +.media-element-container.file-video-full, .media-element-container.file-video-large, .media-element-container.file-video-medium, .media-element-container.file-video-small, +.media-element.file-video-full, +.media-element.file-video-large, +.media-element.file-video-medium, +.media-element.file-video-small { + margin: 0 0 1em 0; +} .media-element-container.file-video-left, .media-element.file-video-left { float: left; @@ -785,37 +824,31 @@ ol ol ol { } .media-element-container.file-video-max, .media-element.file-video-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-video-max .content, .media-element.file-video-max .content { width: 100%; } -.media-element-container .file-image .content, -.media-element .file-image .content { - display: table; - table-layout: fixed; - max-width: 100%; -} -.media-element-container .file-image .content img, -.media-element .file-image .content img { +.media-element-container img, +.media-element img { display: block; width: 100%; + margin: 0; } -.media-element-container .file-image .content .field--name-field-basic-image-caption, -.media-element-container .file-image .content .field-name-field-basic-image-caption, -.media-element .file-image .content .field--name-field-basic-image-caption, -.media-element .file-image .content .field-name-field-basic-image-caption { - font-size: 0.9em; - font-weight: 600; - line-height: 1.3em; - padding: 0.4em 0.7em; - background-color: #666666; - color: #fff; +.media-element-container .field--name-field-basic-image-caption, +.media-element-container .field-name-field-basic-image-caption, +.media-element .field--name-field-basic-image-caption, +.media-element .field-name-field-basic-image-caption { display: table-caption; caption-side: bottom; - font-family: Capita; + font-family: "capita", Georgia, serif; + font-size: 0.9em; + font-weight: 300; + font-style: italic; + line-height: 1.3em; + color: #606060; } /* @@ -827,41 +860,6 @@ img, media { max-width: 100%; } -#colorbox #cboxWrapper { - border-radius: 0; - font-size: 1.1em; -} -#colorbox #cboxWrapper #cboxClose, -#colorbox #cboxWrapper #cboxPrevious, -#colorbox #cboxWrapper #cboxNext { - background-image: none; - text-indent: 0; - color: transparent; - overflow: hidden; -} -#colorbox #cboxWrapper #cboxClose:before, -#colorbox #cboxWrapper #cboxPrevious:before, -#colorbox #cboxWrapper #cboxNext:before { - font-family: FontAwesome; - bottom: -3px; - position: absolute; - color: #000; -} -#colorbox #cboxWrapper #cboxClose:before { - content: "\f00d"; - right: 0; - font-size: 1.2em; -} -#colorbox #cboxWrapper #cboxPrevious:before { - content: "\f053"; -} -#colorbox #cboxWrapper #cboxNext:before { - content: "\f054"; -} -#colorbox #cboxWrapper #cboxCurrent { - bottom: -3px; -} - .field .media-element.media-youtube-video, .field .media-element.media-vimeo-video { width: 100%; @@ -877,10 +875,10 @@ img, media { .media.media-element-container.media-image_right { float: right !important; + margin-left: 2em; } .media.media-element-container.media-image_right .field-name-field-basic-image-caption, .media.media-element-container.media-image_right .field--name-field-basic-image-caption { clear: right; - margin-left: 1.5em; } /** @@ -2876,20 +2874,6 @@ hr { padding-bottom: 0.5em; } -/* -adds a style to image captions - it was too hard to separate from normal body text -For some reason the field class in the live and local environments were different at the time so I added both -[ MM ] -*/ -.field-name-field-basic-image-caption, .field--name-field-basic-image-caption { - color: #666666; - font-style: italic; - margin-top: -15px; - font-size: 12px; - font-size: 1.2rem; - line-height: 125%; -} - .l-content { min-height: 4em; } diff --git a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css index 16582f83bf001fa644fdbd492a711e260f896942..9f42994db02078f161128d3109b38e1a596f16c4 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css +++ b/profiles/wcm_base/themes/ocio_omega_base/css/ocio-omega-base.styles.css @@ -191,6 +191,41 @@ html body .button.ext .ext, width: 0; } +#colorbox #cboxWrapper { + border-radius: 0; + font-size: 1.1em; +} +#colorbox #cboxWrapper #cboxClose, +#colorbox #cboxWrapper #cboxPrevious, +#colorbox #cboxWrapper #cboxNext { + background-image: none; + text-indent: 0; + color: transparent; + overflow: hidden; +} +#colorbox #cboxWrapper #cboxClose:before, +#colorbox #cboxWrapper #cboxPrevious:before, +#colorbox #cboxWrapper #cboxNext:before { + font-family: FontAwesome; + bottom: -3px; + position: absolute; + color: #000; +} +#colorbox #cboxWrapper #cboxClose:before { + content: "\f00d"; + right: 0; + font-size: 1.2em; +} +#colorbox #cboxWrapper #cboxPrevious:before { + content: "\f053"; +} +#colorbox #cboxWrapper #cboxNext:before { + content: "\f054"; +} +#colorbox #cboxWrapper #cboxCurrent { + bottom: -3px; +} + span.ext { margin-left: 1px; margin-right: 2px; @@ -320,27 +355,10 @@ form .chosen-container.chosen-container-multi .chosen-choices li.search-field in width: inherit; } -.image-border, .panopoly-image-featured, -.panopoly-image-full, -.panopoly-image-half, -.panopoly-image-original, -.panopoly-image-quarter, -.panopoly-image-square, -.panopoly-image-thumbnail { +.image-border { border: 1px solid #666666; } -.node__content .panopoly-image-featured, -.node__content .panopoly-image-full, -.node__content .panopoly-image-half, -.node__content .panopoly-image-original, -.node__content .panopoly-image-quarter, -.node__content .panopoly-image-square, -.node__content .panopoly-image-thumbnail { - float: right; - margin: 0 0 20px 1.5em; -} - .ui-widget table, .ui-widget td, .ui-widget tr, .ui-widget th { border: 0; } @@ -729,6 +747,10 @@ ol ol ol { padding-left: 0.6em; } +.media-element-container { + margin-bottom: 1.5em; +} + .media-element-container, .media-element { /* @@ -737,11 +759,21 @@ ol ol ol { $separator: "-"; } */ + display: table; + table-layout: fixed; + max-width: 100%; } .media-element-container.file-default, .media-element.file-default { margin: 0 0 1em 0; } +.media-element-container.file-image-full, .media-element-container.file-image-large, .media-element-container.file-image-medium, .media-element-container.file-image-small, +.media-element.file-image-full, +.media-element.file-image-large, +.media-element.file-image-medium, +.media-element.file-image-small { + margin: 0 0 1em 0; +} .media-element-container.file-image-left, .media-element.file-image-left { float: left; @@ -759,13 +791,20 @@ ol ol ol { } .media-element-container.file-image-max, .media-element.file-image-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-image-max .content, .media-element.file-image-max .content { width: 100%; } +.media-element-container.file-video-full, .media-element-container.file-video-large, .media-element-container.file-video-medium, .media-element-container.file-video-small, +.media-element.file-video-full, +.media-element.file-video-large, +.media-element.file-video-medium, +.media-element.file-video-small { + margin: 0 0 1em 0; +} .media-element-container.file-video-left, .media-element.file-video-left { float: left; @@ -786,37 +825,31 @@ ol ol ol { } .media-element-container.file-video-max, .media-element.file-video-max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; } .media-element-container.file-video-max .content, .media-element.file-video-max .content { width: 100%; } -.media-element-container .file-image .content, -.media-element .file-image .content { - display: table; - table-layout: fixed; - max-width: 100%; -} -.media-element-container .file-image .content img, -.media-element .file-image .content img { +.media-element-container img, +.media-element img { display: block; width: 100%; + margin: 0; } -.media-element-container .file-image .content .field--name-field-basic-image-caption, -.media-element-container .file-image .content .field-name-field-basic-image-caption, -.media-element .file-image .content .field--name-field-basic-image-caption, -.media-element .file-image .content .field-name-field-basic-image-caption { - font-size: 0.9em; - font-weight: 600; - line-height: 1.3em; - padding: 0.4em 0.7em; - background-color: #666666; - color: #fff; +.media-element-container .field--name-field-basic-image-caption, +.media-element-container .field-name-field-basic-image-caption, +.media-element .field--name-field-basic-image-caption, +.media-element .field-name-field-basic-image-caption { display: table-caption; caption-side: bottom; - font-family: Capita; + font-family: "capita", Georgia, serif; + font-size: 0.9em; + font-weight: 300; + font-style: italic; + line-height: 1.3em; + color: #606060; } /* @@ -828,41 +861,6 @@ img, media { max-width: 100%; } -#colorbox #cboxWrapper { - border-radius: 0; - font-size: 1.1em; -} -#colorbox #cboxWrapper #cboxClose, -#colorbox #cboxWrapper #cboxPrevious, -#colorbox #cboxWrapper #cboxNext { - background-image: none; - text-indent: 0; - color: transparent; - overflow: hidden; -} -#colorbox #cboxWrapper #cboxClose:before, -#colorbox #cboxWrapper #cboxPrevious:before, -#colorbox #cboxWrapper #cboxNext:before { - font-family: FontAwesome; - bottom: -3px; - position: absolute; - color: #000; -} -#colorbox #cboxWrapper #cboxClose:before { - content: "\f00d"; - right: 0; - font-size: 1.2em; -} -#colorbox #cboxWrapper #cboxPrevious:before { - content: "\f053"; -} -#colorbox #cboxWrapper #cboxNext:before { - content: "\f054"; -} -#colorbox #cboxWrapper #cboxCurrent { - bottom: -3px; -} - @media (max-width: 47.5em) { .field .media-element.media-youtube-video, .field .media-element.media-vimeo-video { @@ -879,10 +877,10 @@ img, media { } .media.media-element-container.media-image_right { float: right !important; + margin-left: 2em; } .media.media-element-container.media-image_right .field-name-field-basic-image-caption, .media.media-element-container.media-image_right .field--name-field-basic-image-caption { clear: right; - margin-left: 1.5em; } /** @@ -2920,20 +2918,6 @@ hr { padding-bottom: 0.5em; } -/* -adds a style to image captions - it was too hard to separate from normal body text -For some reason the field class in the live and local environments were different at the time so I added both -[ MM ] -*/ -.field-name-field-basic-image-caption, .field--name-field-basic-image-caption { - color: #666666; - font-style: italic; - margin-top: -15px; - font-size: 12px; - font-size: 1.2rem; - line-height: 125%; -} - .l-content { min-height: 4em; } diff --git a/profiles/wcm_base/themes/ocio_omega_base/sass/base/_colorbox.scss b/profiles/wcm_base/themes/ocio_omega_base/sass/base/_colorbox.scss new file mode 100644 index 0000000000000000000000000000000000000000..75115f0cae0e1b30d21d6edc6f73fb5680fe3530 --- /dev/null +++ b/profiles/wcm_base/themes/ocio_omega_base/sass/base/_colorbox.scss @@ -0,0 +1,39 @@ +#colorbox { + #cboxWrapper { + border-radius: 0; + font-size: 1.1em; + #cboxClose, + #cboxPrevious, + #cboxNext { + background-image: none; + text-indent: 0; + color: transparent; + overflow: hidden; + + &:before { + font-family: FontAwesome; + bottom: -3px; + position: absolute; + color: $black; + } + } + + #cboxClose:before { + content: "\f00d"; + right: 0; + font-size: 1.2em; + } + + #cboxPrevious:before { + content: "\f053"; + } + + #cboxNext:before { + content: "\f054"; + } + + #cboxCurrent { + bottom: -3px; + } + } +} diff --git a/profiles/wcm_base/themes/ocio_omega_base/sass/base/_images.scss b/profiles/wcm_base/themes/ocio_omega_base/sass/base/_images.scss index 8abca0e82db055ebf23b3a828d347cca44dc8e06..c9c18b56e9a4be18d38b9899159184e206d9400e 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/sass/base/_images.scss +++ b/profiles/wcm_base/themes/ocio_omega_base/sass/base/_images.scss @@ -5,29 +5,3 @@ .image-border { border: 1px solid $md-gray; } - -//panopoly image styles - -.panopoly-image-featured, -.panopoly-image-full, -.panopoly-image-half, -.panopoly-image-original, -.panopoly-image-quarter, -.panopoly-image-square, -.panopoly-image-thumbnail { - @extend .image-border; -} - -//default float right in nodes -.node__content { - .panopoly-image-featured, - .panopoly-image-full, - .panopoly-image-half, - .panopoly-image-original, - .panopoly-image-quarter, - .panopoly-image-square, - .panopoly-image-thumbnail { - float: right; - margin: 0 0 $vert-spacing-unit $horz-spacing-unit; - } -} diff --git a/profiles/wcm_base/themes/ocio_omega_base/sass/base/_media.scss b/profiles/wcm_base/themes/ocio_omega_base/sass/base/_media.scss index 1429b022b07c0541184067c7c66ddb5fd297855d..19de260159ebe8c5a536f97cd1e2a87cc02629dc 100644 --- a/profiles/wcm_base/themes/ocio_omega_base/sass/base/_media.scss +++ b/profiles/wcm_base/themes/ocio_omega_base/sass/base/_media.scss @@ -15,6 +15,13 @@ } @each $type in $types { + + &.#{$prefix}-#{$type}#{$separator}full, + &.#{$prefix}-#{$type}#{$separator}large, + &.#{$prefix}-#{$type}#{$separator}medium, + &.#{$prefix}-#{$type}#{$separator}small { + margin: 0 0 1em 0; + } &.#{$prefix}-#{$type}#{$separator}left { float: left; @@ -44,7 +51,7 @@ } &.#{$prefix}-#{$type}#{$separator}max { - margin-right: 0; + margin: 0 0 1em 0; width: 100%; @if $mode == "view" { @@ -56,32 +63,34 @@ } } + +.media-element-container { + margin-bottom: 1.5em; +} + .media-element-container, .media-element { @include media-element("view"); + display: table; + table-layout: fixed; + max-width: 100%; - .file-image .content { - display: table; - table-layout: fixed; - max-width: 100%; - - img { - display: block; - width: 100%; - } + img { + display: block; + width: 100%; + margin: 0; + } - .field--name-field-basic-image-caption, - .field-name-field-basic-image-caption { - font-size: 0.9em; - font-weight: 600; - line-height: 1.3em; - padding: 0.4em 0.7em; - background-color: $md-gray; - color: $white; - display: table-caption; - caption-side: bottom; - font-family: Capita; - } + .field--name-field-basic-image-caption, + .field-name-field-basic-image-caption { + display: table-caption; + caption-side: bottom; + font-family: $capita; + font-size: 0.9em; + font-weight: 300; + font-style: italic; + line-height: 1.3em; + color: lighten($dk-gray, 20%); } } @@ -95,45 +104,6 @@ img, media { max-width: 100%; } -#colorbox { - #cboxWrapper { - border-radius: 0; - font-size: 1.1em; - #cboxClose, - #cboxPrevious, - #cboxNext { - background-image: none; - text-indent: 0; - color: transparent; - overflow: hidden; - - &:before { - font-family: FontAwesome; - bottom: -3px; - position: absolute; - color: $black; - } - } - - #cboxClose:before { - content: "\f00d"; - right: 0; - font-size: 1.2em; - } - - #cboxPrevious:before { - content: "\f053"; - } - - #cboxNext:before { - content: "\f054"; - } - - #cboxCurrent { - bottom: -3px; - } - } -} @include breakpoint($small, true) { .field { @@ -156,9 +126,9 @@ img, media { //styles to fix alignment of captions on images that are using image-right style .media.media-element-container.media-image_right { float:right !important; + margin-left: 2em; .field-name-field-basic-image-caption, .field--name-field-basic-image-caption { clear:right; - margin-left:1.5em; } } diff --git a/profiles/wcm_base/themes/ocio_omega_base/sass/components/fields/_field-basic-image-caption.scss b/profiles/wcm_base/themes/ocio_omega_base/sass/components/fields/_field-basic-image-caption.scss deleted file mode 100644 index e91f61e0471381c3d9c33d8ce718dd4e754afd46..0000000000000000000000000000000000000000 --- a/profiles/wcm_base/themes/ocio_omega_base/sass/components/fields/_field-basic-image-caption.scss +++ /dev/null @@ -1,13 +0,0 @@ -/* -adds a style to image captions - it was too hard to separate from normal body text -For some reason the field class in the live and local environments were different at the time so I added both -[ MM ] -*/ - -.field-name-field-basic-image-caption, .field--name-field-basic-image-caption { - color:$md-gray; - font-style:italic; - margin-top:-15px; - @include font-size(1.2); - line-height:125%; -} \ No newline at end of file