updated webform localization and phone, uuid, term_merge, spambot, performance
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Plugin definition for duplicate suggestion based on description.
|
||||
*/
|
||||
|
||||
$plugin = array(
|
||||
'title' => t('Terms description are the same'),
|
||||
'description' => t('Mark terms as duplicates if they have the same description.'),
|
||||
'hash callback' => 'term_merge_duplicate_suggestion_description_hash',
|
||||
);
|
||||
|
||||
/**
|
||||
* Hash term based on its description.
|
||||
*/
|
||||
function term_merge_duplicate_suggestion_description_hash($term) {
|
||||
return drupal_strtoupper($term->description);
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Plugin definition for duplicate suggestion based on names.
|
||||
*/
|
||||
|
||||
$plugin = array(
|
||||
'title' => t('Terms names are the same'),
|
||||
'description' => t('Mark terms as duplicates if they have the same name.'),
|
||||
'hash callback' => 'term_merge_duplicate_suggestion_name_hash',
|
||||
'weight' => -10,
|
||||
);
|
||||
|
||||
/**
|
||||
* Hash term based on its name.
|
||||
*/
|
||||
function term_merge_duplicate_suggestion_name_hash($term) {
|
||||
// Making upper case.
|
||||
$name = drupal_strtoupper($term->name);
|
||||
// Trying transliteration, if available.
|
||||
if (module_exists('transliteration')) {
|
||||
$name = transliteration_get($name);
|
||||
// Keeping only ASCII chars.
|
||||
$name = preg_replace('#\W#', '', $name);
|
||||
}
|
||||
return $name;
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Plugin definition for duplicate suggestion based on parents.
|
||||
*/
|
||||
|
||||
$plugin = array(
|
||||
'title' => t('Terms parents are the same'),
|
||||
'description' => t('Mark terms as duplicates if they have the same parent.'),
|
||||
'hash callback' => 'term_merge_duplicate_suggestion_parent_hash',
|
||||
);
|
||||
|
||||
/**
|
||||
* Hash term based on its parent.
|
||||
*/
|
||||
function term_merge_duplicate_suggestion_parent_hash($term) {
|
||||
return $term->parents[0];
|
||||
}
|
Reference in New Issue
Block a user