homepage.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. if(file_exists('config'.DIRECTORY_SEPARATOR.'config.php')){
  3. $pageHomepage = '
  4. <script>
  5. !function($) {
  6. "use strict";
  7. var CalendarApp = function() {
  8. this.$body = $("body")
  9. this.$calendar = $("#calendar"),
  10. this.$event = ("#calendar-events div.calendar-events"),
  11. this.$categoryForm = $("#add-new-event form"),
  12. this.$extEvents = $("#calendar-events"),
  13. this.$modal = $("#my-event"),
  14. this.$saveCategoryBtn = $(".save-category"),
  15. this.$calendarObj = null
  16. };
  17. /* Initializing */
  18. CalendarApp.prototype.init = function() {
  19. /* Initialize the calendar */
  20. var date = new Date();
  21. var d = date.getDate();
  22. var m = date.getMonth();
  23. var y = date.getFullYear();
  24. var form = "";
  25. var today = new Date($.now());
  26. var $this = this;
  27. $this.$calendarObj = $this.$calendar.fullCalendar({
  28. defaultView: "'.$GLOBALS['calendarDefault'].'",
  29. firstDay: "'.$GLOBALS['calendarFirstDay'].'",
  30. timeFormat: "'.$GLOBALS['calendarTimeFormat'].'",
  31. handleWindowResize: true,
  32. header: {
  33. left: "prev,next",
  34. center: "title",
  35. right: "month,basicWeek,basicDay"
  36. },
  37. views: {
  38. basicDay: { buttonText: window.lang.translate("Day"), eventLimit: '.$GLOBALS['calendarLimit'].' },
  39. basicWeek: { buttonText: window.lang.translate("Week"), eventLimit: '.$GLOBALS['calendarLimit'].' },
  40. month: { buttonText: window.lang.translate("Month"), eventLimit: '.$GLOBALS['calendarLimit'].' },
  41. today: { buttonText: window.lang.translate("Today") },
  42. },
  43. timezone: "local",
  44. editable: false,
  45. droppable: false, // this allows things to be dropped onto the calendar !!!
  46. selectable: false,
  47. height: "auto",
  48. eventRender: function eventRender( event, element, view ) {
  49. if (typeof filter !== "undefined") {
  50. if(filter === "all"){
  51. return event.imagetype === event.imagetype;
  52. }else if(filter !== "all"){
  53. return filter === event.imagetype;
  54. }
  55. if(filter === null){
  56. return event.imagetype === event.imagetype;
  57. }
  58. }else {
  59. return event.imagetype === event.imagetype;
  60. }
  61. },
  62. });
  63. },
  64. //init CalendarApp
  65. $.CalendarApp = new CalendarApp, $.CalendarApp.Constructor = CalendarApp
  66. }(window.jQuery),
  67. //initializing CalendarApp
  68. function($) {
  69. "use strict";
  70. $.CalendarApp.init()
  71. }(window.jQuery);
  72. </script>
  73. <link href="plugins/bower_components/owl.carousel/owl.carousel.min.css" rel="stylesheet" type="text/css" />
  74. <link href="plugins/bower_components/owl.carousel/owl.theme.default.css" rel="stylesheet" type="text/css" />
  75. <div class="container-fluid p-t-10" id="homepage-items">
  76. '.buildHomepage().'
  77. </div>
  78. <!-- /.container-fluid -->
  79. ';
  80. }