more module updates
This commit is contained in:
@@ -15,8 +15,10 @@ $base = array(
|
||||
// Overrides for Danish input.
|
||||
$variant['da'] = array(
|
||||
0xC5 => 'Aa',
|
||||
0xC6 => 'Ae',
|
||||
0xD8 => 'Oe',
|
||||
0xE5 => 'aa',
|
||||
0xE6 => 'ae',
|
||||
0xF8 => 'oe',
|
||||
);
|
||||
|
||||
|
@@ -44,3 +44,13 @@ $variant['kg'] = array(
|
||||
0xE8 => 'Q',
|
||||
0xE9 => 'q',
|
||||
);
|
||||
|
||||
// Overrides for Ukrainian input.
|
||||
$variant['uk'] = array(
|
||||
0x90 => 'G',
|
||||
0x91 => 'g',
|
||||
0x04 => 'YE',
|
||||
0x54 => 'ye',
|
||||
0x18 => 'Y',
|
||||
0x38 => 'y',
|
||||
);
|
||||
|
@@ -9,7 +9,7 @@ $base = array(
|
||||
0x50 => 'Zi ', 'Jie ', 'Jue ', 'Jue ', 'Kong ', 'Yun ', 'Zi ', 'Zi ', 'Cun ', 'Sun ', 'Fu ', 'Bei ', 'Zi ', 'Xiao ', 'Xin ', 'Meng ',
|
||||
0x60 => 'Si ', 'Tai ', 'Bao ', 'Ji ', 'Gu ', 'Nu ', 'Xue ', NULL, 'Zhuan ', 'Hai ', 'Luan ', 'Sun ', 'Huai ', 'Mie ', 'Cong ', 'Qian ',
|
||||
0x70 => 'Shu ', 'Chan ', 'Ya ', 'Zi ', 'Ni ', 'Fu ', 'Zi ', 'Li ', 'Xue ', 'Bo ', 'Ru ', 'Lai ', 'Nie ', 'Nie ', 'Ying ', 'Luan ',
|
||||
0x80 => 'Mian ', 'Zhu ', 'Rong ', 'Ta ', 'Gui ', 'Zhai ', 'Qiong ', 'Yu ', 'Shou ', 'An ', 'Tu ', 'Song ', 'Wan ', 'Rou ', 'Yao ', 'Hong ',
|
||||
0x80 => 'Mian ', 'Ning ', 'Rong ', 'Ta ', 'Gui ', 'Zhai ', 'Qiong ', 'Yu ', 'Shou ', 'An ', 'Tu ', 'Song ', 'Wan ', 'Rou ', 'Yao ', 'Hong ',
|
||||
0x90 => 'Yi ', 'Jing ', 'Zhun ', 'Mi ', 'Zhu ', 'Dang ', 'Hong ', 'Zong ', 'Guan ', 'Zhou ', 'Ding ', 'Wan ', 'Yi ', 'Bao ', 'Shi ', 'Shi ',
|
||||
0xA0 => 'Chong ', 'Shen ', 'Ke ', 'Xuan ', 'Shi ', 'You ', 'Huan ', 'Yi ', 'Tiao ', 'Shi ', 'Xian ', 'Gong ', 'Cheng ', 'Qun ', 'Gong ', 'Xiao ',
|
||||
0xB0 => 'Zai ', 'Zha ', 'Bao ', 'Hai ', 'Yan ', 'Xiao ', 'Jia ', 'Shen ', 'Chen ', 'Rong ', 'Huang ', 'Mi ', 'Kou ', 'Kuan ', 'Bin ', 'Su ',
|
||||
|
@@ -8,7 +8,7 @@ $base = array(
|
||||
0x40 => 'Zheng ', 'Xu ', 'Mi ', 'Wei ', 'Wo ', 'Fu ', 'Yi ', 'Bang ', 'Ping ', 'Tazuna ', 'Gong ', 'Pan ', 'Huang ', 'Dao ', 'Mi ', 'Jia ',
|
||||
0x50 => 'Teng ', 'Hui ', 'Zhong ', 'Shan ', 'Man ', 'Mu ', 'Biao ', 'Guo ', 'Ze ', 'Mu ', 'Bang ', 'Zhang ', 'Jiong ', 'Chan ', 'Fu ', 'Zhi ',
|
||||
0x60 => 'Hu ', 'Fan ', 'Chuang ', 'Bi ', 'Hei ', NULL, 'Mi ', 'Qiao ', 'Chan ', 'Fen ', 'Meng ', 'Bang ', 'Chou ', 'Mie ', 'Chu ', 'Jie ',
|
||||
0x70 => 'Xian ', 'Lan ', 'Gan ', 'Ping ', 'Nian ', 'Qian ', 'Bing ', 'Bing ', 'Xing ', 'Gan ', 'Yao ', 'Huan ', 'You ', 'You ', 'Ji ', 'Yan ',
|
||||
0x70 => 'Xian ', 'Lan ', 'Gan ', 'Ping ', 'Nian ', 'Qian ', 'Bing ', 'Bing ', 'Xing ', 'Gan ', 'Yao ', 'Huan ', 'You ', 'You ', 'Ji ', 'Guang ',
|
||||
0x80 => 'Pi ', 'Ting ', 'Ze ', 'Guang ', 'Zhuang ', 'Mo ', 'Qing ', 'Bi ', 'Qin ', 'Dun ', 'Chuang ', 'Gui ', 'Ya ', 'Bai ', 'Jie ', 'Xu ',
|
||||
0x90 => 'Lu ', 'Wu ', NULL, 'Ku ', 'Ying ', 'Di ', 'Pao ', 'Dian ', 'Ya ', 'Miao ', 'Geng ', 'Ci ', 'Fu ', 'Tong ', 'Pang ', 'Fei ',
|
||||
0xA0 => 'Xiang ', 'Yi ', 'Zhi ', 'Tiao ', 'Zhi ', 'Xiu ', 'Du ', 'Zuo ', 'Xiao ', 'Tu ', 'Gui ', 'Ku ', 'Pang ', 'Ting ', 'You ', 'Bu ',
|
||||
|
@@ -13,7 +13,7 @@ $base = array(
|
||||
0x90 => 'Hu ', 'Xu ', 'Xing ', 'Tan ', 'Jiu ', 'Chun ', 'Yun ', 'Po ', 'Ke ', 'Sou ', 'Mi ', 'Quan ', 'Chou ', 'Cuo ', 'Yun ', 'Yong ',
|
||||
0xA0 => 'Ang ', 'Zha ', 'Hai ', 'Tang ', 'Jiang ', 'Piao ', 'Shan ', 'Yu ', 'Li ', 'Zao ', 'Lao ', 'Yi ', 'Jiang ', 'Pu ', 'Jiao ', 'Xi ',
|
||||
0xB0 => 'Tan ', 'Po ', 'Nong ', 'Yi ', 'Li ', 'Ju ', 'Jiao ', 'Yi ', 'Niang ', 'Ru ', 'Xun ', 'Chou ', 'Yan ', 'Ling ', 'Mi ', 'Mi ',
|
||||
0xC0 => 'Niang ', 'Xin ', 'Jiao ', 'Xi ', 'Mi ', 'Yan ', 'Bian ', 'Cai ', 'Shi ', 'You ', 'Shi ', 'Shi ', 'Li ', 'Zhong ', 'Ye ', 'Liang ',
|
||||
0xC0 => 'Niang ', 'Xin ', 'Jiao ', 'Xi ', 'Mi ', 'Yan ', 'Bian ', 'Cai ', 'Shi ', 'You ', 'Shi ', 'Shi ', 'Li ', 'Chong ', 'Ye ', 'Liang ',
|
||||
0xD0 => 'Li ', 'Jin ', 'Jin ', 'Qiu ', 'Yi ', 'Diao ', 'Dao ', 'Zhao ', 'Ding ', 'Po ', 'Qiu ', 'He ', 'Fu ', 'Zhen ', 'Zhi ', 'Ba ',
|
||||
0xE0 => 'Luan ', 'Fu ', 'Nai ', 'Diao ', 'Shan ', 'Qiao ', 'Kou ', 'Chuan ', 'Zi ', 'Fan ', 'Yu ', 'Hua ', 'Han ', 'Gong ', 'Qi ', 'Mang ',
|
||||
0xF0 => 'Ri ', 'Di ', 'Si ', 'Xi ', 'Yi ', 'Chai ', 'Shi ', 'Tu ', 'Xi ', 'Nu ', 'Qian ', 'Ishiyumi ', 'Jian ', 'Pi ', 'Ye ', 'Yin ',
|
||||
|
@@ -149,6 +149,11 @@ function transliteration_file_query() {
|
||||
$regex = '/[a-z0-9_.-]+$';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
$operator = 'LIKE';
|
||||
$regex = '%[^a-z0-9_.-]%';
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
@@ -3,9 +3,9 @@ description = Converts non-latin text to US-ASCII and sanitizes file names.
|
||||
core = 7.x
|
||||
configure = admin/config/media/file-system
|
||||
|
||||
; Information added by drupal.org packaging script on 2012-06-01
|
||||
version = "7.x-3.1"
|
||||
; Information added by Drupal.org packaging script on 2014-03-17
|
||||
version = "7.x-3.2"
|
||||
core = "7.x"
|
||||
project = "transliteration"
|
||||
datestamp = "1338540713"
|
||||
datestamp = "1395079444"
|
||||
|
||||
|
@@ -31,3 +31,13 @@ function transliteration_uninstall() {
|
||||
variable_del('transliteration_file_lowercase');
|
||||
variable_del('transliteration_search');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove unnecessary Drupal 6 variables.
|
||||
*/
|
||||
function transliteration_update_7300() {
|
||||
// Delete all the transliteration_filter_no_known_transliteration_* variables
|
||||
// and then clear the variable cache.
|
||||
db_query("DELETE FROM {variable} WHERE name LIKE 'transliteration_filter_no_known_transliteration_%'");
|
||||
cache_clear_all('variables', 'cache');
|
||||
}
|
||||
|
@@ -47,11 +47,27 @@ function transliteration_form_system_file_system_settings_alter(&$form, &$form_s
|
||||
'#description' => t('Enable to convert file names to US-ASCII character set for cross-platform compatibility.'),
|
||||
'#default_value' => variable_get('transliteration_file_uploads', TRUE),
|
||||
);
|
||||
$form['transliteration']['transliteration_file_uploads_display_name'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Transliterate the displayed file name.'),
|
||||
'#description' => t('Enable to also convert the file name that is displayed within the site (for example, in link text).'),
|
||||
'#default_value' => variable_get('transliteration_file_uploads_display_name', TRUE),
|
||||
'#states' => array(
|
||||
'invisible' => array(
|
||||
'input[name="transliteration_file_uploads"]' => array('checked' => FALSE),
|
||||
),
|
||||
),
|
||||
);
|
||||
$form['transliteration']['transliteration_file_lowercase'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Lowercase transliterated file names.'),
|
||||
'#default_value' => variable_get('transliteration_file_lowercase', TRUE),
|
||||
'#description' => t('This is a recommended setting to prevent issues with case-insensitive file systems. It has no effect if transliteration has been disabled.'),
|
||||
'#states' => array(
|
||||
'invisible' => array(
|
||||
'input[name="transliteration_file_uploads"]' => array('checked' => FALSE),
|
||||
),
|
||||
),
|
||||
);
|
||||
$form['buttons']['#weight'] = 1;
|
||||
}
|
||||
@@ -102,6 +118,9 @@ function transliteration_clean_filename($filename, $source_langcode = NULL) {
|
||||
}
|
||||
return $filename;
|
||||
}
|
||||
|
||||
// Allow other modules to alter the filename prior to processing.
|
||||
drupal_alter('transliteration_clean_filename_prepare', $filename, $source_langcode);
|
||||
$filename = transliteration_get($filename, '', $source_langcode);
|
||||
// Replace whitespace.
|
||||
$filename = str_replace(' ', '_', $filename);
|
||||
@@ -170,6 +189,23 @@ function transliteration_init() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_file_presave().
|
||||
*/
|
||||
function transliteration_file_presave($file) {
|
||||
// If an uploaded file had its name altered in transliteration_init() and if
|
||||
// the human-readable display name is not being transliterated, restore the
|
||||
// original version as the human-readable name before saving. (The
|
||||
// transliterated version will still be used in the file URI, which is the
|
||||
// only place where it matters.)
|
||||
if (!empty($_FILES['files']['name']) && variable_get('transliteration_file_uploads', TRUE) && !variable_get('transliteration_file_uploads_display_name', TRUE)) {
|
||||
$key = array_search($file->filename, $_FILES['files']['name']);
|
||||
if ($key !== FALSE && isset($_FILES['files']['orig_name'][$key])) {
|
||||
$file->filename = $_FILES['files']['orig_name'][$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_search_preprocess().
|
||||
*
|
||||
|
Reference in New Issue
Block a user