finder_admin_import_custom_matching
- finder
| Versions | |
|---|---|
| 7.x-1.x | finder_admin_import_custom_matching(&$finder) |
Handle custom matching in imports.
Code
includes/
<?php
function finder_admin_import_custom_matching(&$finder) {
// Handle custom matching.
$custom_matching = variable_get('finder_custom_matching', array());
foreach ($finder->elements as $feid => &$element) {
$match = &$element->settings['advanced']['match'];
if (is_array($match)) {
$match_data = reset($match);
$found_key = FALSE;
foreach ($custom_matching as $custom_key => $custom_match) {
if ($custom_match['operator'] == $match_data['operator'] &&
$custom_match['value_prefix'] == $match_data['value_prefix'] &&
$custom_match['value_suffix'] == $match_data['value_suffix']) {
$found_key = $custom_key;
}
}
if ($found_key) {
$match = $found_key;
}
else {
$new = NULL;
$custom = 0;
while (is_null($new)) {
if (!isset($custom_matching['c' . $custom])) {
$new = array('c' . $custom);
break;
}
$custom++;
}
$custom_matching[$new] = $custom_match;
$match = $new;
}
}
}
variable_set('finder_custom_matching', $custom_matching);
}
?>

Comments
iqyXreqaegQn
3maLub , [url=http://wyisjfsrirrk.com/]wyisjfsrirrk[/url], [link=http://kqewdgcprapt.com/]kqewdgcprapt[/link], http://oacdeduwnqkt.com/
AJFATpattnfOGXIlqwY
I'm really into it, tkahns for this great stuff!