You are here

function transliteration_menu in Transliteration 5.2

Same name and namespace in other branches
  1. 5 transliteration.module \transliteration_menu()
  2. 6.3 transliteration.module \transliteration_menu()
  3. 7.3 transliteration.module \transliteration_menu()

Implementation of hook_menu().

Transliterate and clean the names of files currently being uploaded.

File

./transliteration.module, line 43
Provides transliteration for UTF-8 text input and sanitzes file names.

Code

function transliteration_menu($may_cache) {
  if (!$may_cache && !empty($_FILES['files'])) {
    require_once drupal_get_path('module', 'transliteration') . '/transliteration.inc';
    foreach ($_FILES['files']['name'] as $field => $filename) {

      // Keep a copy of the unaltered file name.
      $_FILES['files']['orig_name'][$field] = $filename;
      $_FILES['files']['name'][$field] = transliteration_clean_filename($filename);
    }
  }
}