homepage.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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: (activeInfo.mobile) ? "list" : "'.$GLOBALS['calendarDefault'].'",
  29. firstDay: "'.$GLOBALS['calendarFirstDay'].'",
  30. timeFormat: "'.$GLOBALS['calendarTimeFormat'].'",
  31. handleWindowResize: true,
  32. header: {
  33. left: "prev,next",
  34. center: "title",
  35. right: (activeInfo.mobile) ? "" : "month,basicWeek,basicDay,list",
  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. list: { buttonText: window.lang.translate("List"), duration: {months: 1} },
  43. },
  44. timezone: "local",
  45. editable: false,
  46. droppable: false, // this allows things to be dropped onto the calendar !!!
  47. selectable: false,
  48. height: "auto",
  49. eventRender: function eventRender( event, element, view ) {
  50. if (typeof filter !== "undefined") {
  51. if(filter === "all"){
  52. return event.imagetype === event.imagetype;
  53. }else if(filter !== "all"){
  54. return filter === event.imagetype;
  55. }
  56. if(filter === null){
  57. return event.imagetype === event.imagetype;
  58. }
  59. }else {
  60. return event.imagetype === event.imagetype;
  61. }
  62. },
  63. });
  64. },
  65. //init CalendarApp
  66. $.CalendarApp = new CalendarApp, $.CalendarApp.Constructor = CalendarApp
  67. }(window.jQuery),
  68. //initializing CalendarApp
  69. function($) {
  70. "use strict";
  71. $.CalendarApp.init()
  72. }(window.jQuery);
  73. </script>
  74. <div class="container-fluid p-t-30" id="homepage-items">
  75. '.buildHomepage().'
  76. </div>
  77. <div id="open-youtube" class="white-popup mfp-with-anim mfp-hide">
  78. <div class="col-md-8 col-md-offset-2 youtube-div"> </div>
  79. </div>
  80. <!-- /.container-fluid -->
  81. ';
  82. }