header.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?
  2. # Generic XHTML 1.1 header
  3. function printHeader($title) {
  4. print <<<ENDOLA
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  6. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
  10. <title>${title}</title>
  11. ENDOLA;
  12. printJQuery();
  13. echo '</head><body>';
  14. }
  15. # Generic XHTML 1.1 footer
  16. function printFooter() {
  17. print <<<ENDOLA
  18. </body>
  19. </html>
  20. ENDOLA;
  21. }
  22. function printJQuery() {
  23. # Determine our protocol
  24. $protocol = 'http';
  25. if ($_SERVER['HTTPS']) {
  26. $protocol = 'https';
  27. }
  28. # Print
  29. echo <<<ENDOLA
  30. <!-- Default JQuery -->
  31. <script src="${protocol}://code.jquery.com/jquery-1.9.1.min.js"></script>
  32. <!-- Provide # support in JQuery-mobile autodividers -->
  33. <!-- Must be loaded before JQuery-mobile -->
  34. <script>
  35. $( document ).on( "mobileinit", function() {
  36. $.mobile.listview.prototype.options.autodividersSelector = function( elt ) {
  37. var text = $.trim( elt.text() ) || null;
  38. if ( !text ) {
  39. return null;
  40. }
  41. if ( !isNaN(parseFloat(text)) ) {
  42. return "#";
  43. } else {
  44. text = text.slice( 0, 1 ).toUpperCase();
  45. return text;
  46. }
  47. };
  48. });
  49. </script>
  50. <!-- Default JQuery-mobile -->
  51. <link rel="stylesheet" href="${protocol}://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
  52. <script src="${protocol}://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
  53. <!-- Custom code for the linkbar -->
  54. <script src="autodividers-linkbar.js"></script>
  55. <link rel="stylesheet" href="autodividers-linkbar.css">
  56. ENDOLA;
  57. }
  58. ?>