Exemple #1
0
 /**
  * Apply the mode of identito vigilance
  *
  * @param String $string                  String
  * @param Bool   $firstname               Apply the lower and the capitalize
  * @param string $mode_identito_vigilance Identito-vigilance mode
  * @param bool   $anonyme                 Is anonyme
  *
  * @return string
  */
 static function applyModeIdentitoVigilance($string, $firstname = false, $mode_identito_vigilance = null, $anonyme = false)
 {
     $mode = $mode_identito_vigilance ? $mode_identito_vigilance : CAppUI::conf("dPpatients CPatient mode_identito_vigilance", CGroups::loadCurrent());
     switch ($mode) {
         case "medium":
             $result = CMbString::removeBanCharacter($string, true);
             $result = $firstname ? CMbString::capitalize(CMbString::lower($result)) : CMbString::upper($result);
             break;
         case "strict":
             $result = CMbString::upper(CMbString::removeBanCharacter($string, $anonyme));
             break;
         default:
             $result = $firstname ? CMbString::capitalize(CMbString::lower($string)) : CMbString::upper($string);
     }
     return $result;
 }