updated webform localization and phone, uuid, term_merge, spambot, performance

This commit is contained in:
Bachir Soussi Chiadmi
2016-11-05 17:14:57 +01:00
parent fdefc824d8
commit 0521608bb7
57 changed files with 3592 additions and 1629 deletions

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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];
}