hotspot_lang_conversion.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /*
  3. DOKEOS - elearning and course management software
  4. For a full list of contributors, see documentation/credits.html
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. See "documentation/licence.html" more details.
  10. Contact:
  11. Dokeos
  12. Rue des Palais 44 Paleizenstraat
  13. B-1030 Brussels - Belgium
  14. Tel. +32 (2) 211 34 56
  15. */
  16. /**
  17. * Hotspot languae conversion
  18. * @package dokeos.exercise
  19. * @author
  20. * @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
  21. */
  22. include_once('../inc/global.inc.php');
  23. $hotspot_lang_file = api_get_path(SYS_LANG_PATH);
  24. if(isset($_GET['lang']))
  25. {
  26. $search = array('../','\\0');
  27. $lang = str_replace($search,'',urldecode($_GET['lang']));
  28. if(file_exists($hotspot_lang_file . $lang . '/hotspot.inc.php'))
  29. $hotspot_lang_file .= $lang . '/hotspot.inc.php';
  30. else
  31. $hotspot_lang_file .= 'english/hotspot.inc.php';
  32. }
  33. else
  34. $hotspot_lang_file .= 'english/hotspot.inc.php';
  35. $file = file($hotspot_lang_file);
  36. $temp = array();
  37. foreach($file as $value)
  38. {
  39. $explode = explode('=', $value);
  40. if(count($explode) > 1)
  41. {
  42. $explode[0] = trim($explode[0]);
  43. $explode[0] = '&' . substr($explode[0], 1, strlen($explode[0]));
  44. $explode[1] = trim($explode[1]);
  45. $explode[1] = substr($explode[1], 0, strlen($explode[1]) - 1);
  46. $explode[1] = ereg_replace('"', '', $explode[1]);
  47. $temp[] = $explode[0] . '=' . $explode[1];
  48. }
  49. }
  50. foreach($temp as $value)
  51. {
  52. echo $value . ' ';
  53. }
  54. ?>