Created
March 28, 2012 14:52
-
-
Save somatonic/2226823 to your computer and use it in GitHub Desktop.
PW search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$words = ''; | |
$q = $sanitizer->selectorValue($input->post->q); | |
$words = explode(' ', $q); | |
foreach($words as $word) { | |
$word = $sanitizer->selectorValue($word); | |
if($word) $selectorEmergencyContacts .= "title|label_$lang*=$word, "; | |
} | |
... | |
// search for Emergency Contact Addresses, match pages that have this address in "emergency_address_select" page field (in two lines!!!) | |
$address_matches = $pages->get(1458)->find( $selectorEmergencyContacts . " template=emergency-contact, include=hidden"); | |
if(count($address_matches) > 0) { | |
// if we found Contacts, we search for objects having this address added through page reference field "address_select" | |
$matchesA = $pages->get(1010)->find("emergency_address_select=$address_matches, template=object"); | |
$results->import($matchesA); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment