index.act.php 541 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * Action script for example date plugin.
  4. *
  5. * @package chamilo.plugin.date
  6. */
  7. /**
  8. * Initialization.
  9. */
  10. $convert_lang_to_code = [
  11. "english" => "en_US",
  12. "french" => "fr_BE",
  13. "dutch" => "nl_NL",
  14. "german" => "de_DE",
  15. "japanese" => "ja_JP",
  16. "danish" => "da_DK",
  17. ];
  18. if (!empty($_SESSION['user_language_choice']) && !empty($convert_lang_to_code[$_SESSION['user_language_choice']])) {
  19. $code = $convert_lang_to_code[$_SESSION['user_language_choice']];
  20. $locale = setlocale(LC_TIME, $code);
  21. }
  22. $date = strftime('%c');