예제 #1
0
 function showGenerateurl()
 {
     $thisRequest = fvRequest::getInstance();
     $transliterator = new Translit();
     $url = $transliterator->Transliterate($thisRequest->getRequestParameter("name"));
     $this->__assign('url', $url);
     return $this->__display('generateurl.tpl');
 }
예제 #2
0
$safe_latin_chars = isset($_REQUEST['safe_latin_chars']) ? $_REQUEST['safe_latin_chars'] : '';
$p = '';
$p1 = '';
$p3 = '';
$p4 = '';
$p5 = '';
if (!empty($source)) {
    $p1 = $source;
    if (!isset($Encrypt) || empty($Encrypt)) {
        $Encrypt = new Encrypt();
    }
    $p1 = $Encrypt->fix_filename_str($p1);
    if (!isset($Translit) || empty($Translit)) {
        $Translit = new Translit();
    }
    $p1 = $Translit->Transliterate($p1);
    $p1 = $Encrypt->unix_filename($p1);
    $p = $source;
    if (!isset($Entities) || empty($Entities)) {
        $Entities = new Entities();
    }
    $p = $Entities->ipa_text_to_dec_ents($p);
    /* this replacement should be done before any other
    	  conversion to numeric entities */
    //$p = $Entities->text_digits_to_dec_ents($p);
    $p = $Entities->text_symbs_to_dec_ents($p);
    $p = $Entities->named_symbs_to_dec_ents($p);
    //$p = $Entities->latin_text_chars_to_dec_ents($p);
    $p = $Entities->acc_text_to_dec_ents($p);
    $p = $Entities->acc_named_to_dec_ents($p);
    $p = $Entities->cyr_text_chars_to_dec_ents($p);
예제 #3
0
파일: func.php 프로젝트: ASDAFF/bitrix-2
 public static function UrlTranslit($string){
   $string = preg_replace("/[_\s\.,?!\[\](){}]+/", "-", $string);
   $string = preg_replace("/-{2,}/", "--", $string);
   $string = preg_replace("/_-+_/", "--", $string);
   $string = preg_replace("/[_\-]+$/", "", $string);
   $string = Translit::Transliterate($string);
   $string = strtolower($string);
   $string = preg_replace("/j{2,}/", "j", $string);
   $string = preg_replace("/[^0-9a-z_\-]+/", "", $string);
   return $string;
 }