select2_locale.js.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
  3. * Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/core/js/select2_locale.js.php
  20. * \brief File that include javascript functions for timepicker
  21. */
  22. //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
  23. //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
  24. if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
  25. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
  26. if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
  27. if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
  28. if (! defined('NOLOGIN')) define('NOLOGIN',1);
  29. if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
  30. if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
  31. if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
  32. session_cache_limiter(FALSE);
  33. require_once '../../main.inc.php';
  34. // Define javascript type
  35. top_httphead('text/javascript; charset=UTF-8');
  36. // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
  37. if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
  38. else header('Cache-Control: no-cache');
  39. ?>
  40. /**
  41. * Select2 French translation
  42. */
  43. (function ($) {
  44. "use strict";
  45. $.fn.select2.locales['xx'] = {
  46. formatMatches: function (matches) { return matches + " <?php echo dol_escape_js($langs->trans("Select2ResultFoundUseArrows")); ?>"; },
  47. formatNoMatches: function () { return "<?php echo dol_escape_js($langs->trans("Select2NotFound")); ?>"; },
  48. formatInputTooShort: function (input, min) { var n = min - input.length;
  49. if (n > 1) return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacters")); ?>";
  50. else return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacter")); ?>"
  51. },
  52. formatLoadMore: function (pageNumber) { return "<?php echo dol_escape_js($langs->trans("Select2LoadingMoreResults")); ?>"; },
  53. formatSearching: function () { return "<?php echo dol_escape_js($langs->trans("Select2SearchInProgress")); ?>"; }
  54. };
  55. $.extend($.fn.select2.defaults, $.fn.select2.locales['xx']);
  56. })(jQuery);
  57. <?php
  58. if (is_object($db)) $db->close();