homepage.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. customButtons: {
  29. filterCalendar: {
  30. text: \'Filter\',
  31. click: function() {
  32. $(\'#calendar-filter-modal\').modal(\'show\');
  33. }
  34. }
  35. },
  36. defaultView: (activeInfo.mobile) ? "list" : "' . $GLOBALS['calendarDefault'] . '",
  37. firstDay: "' . $GLOBALS['calendarFirstDay'] . '",
  38. timeFormat: "' . $GLOBALS['calendarTimeFormat'] . '",
  39. handleWindowResize: true,
  40. header: {
  41. left: "prev,next,today",
  42. center: "title",
  43. right: (activeInfo.mobile) ? "filterCalendar" : "filterCalendar,month,basicWeek,basicDay,list",
  44. },
  45. views: {
  46. basicDay: { buttonText: window.lang.translate("Day"), eventLimit: ' . $GLOBALS['calendarLimit'] . ' },
  47. basicWeek: { buttonText: window.lang.translate("Week"), eventLimit: ' . $GLOBALS['calendarLimit'] . ' },
  48. month: { buttonText: window.lang.translate("Month"), eventLimit: ' . $GLOBALS['calendarLimit'] . ' },
  49. list: { buttonText: window.lang.translate("List"), duration: {days: 15} },
  50. },
  51. timezone: "local",
  52. editable: false,
  53. navLinks: true, // can click day/week names to navigate views
  54. droppable: false, // this allows things to be dropped onto the calendar !!!
  55. selectable: false,
  56. height: "auto",
  57. eventRender: function eventRender( event, element, view ) {
  58. if (typeof filter !== "undefined") {
  59. if(filter === "all"){
  60. return event.imagetypeFilter === event.imagetypeFilter;
  61. }else if(filter !== "all"){
  62. return filter === event.imagetypeFilter;
  63. }
  64. if(filter === null){
  65. return event.imagetypeFilter === event.imagetypeFilter;
  66. }
  67. }else {
  68. return event.imagetypeFilter === event.imagetypeFilter;
  69. }
  70. },
  71. });
  72. },
  73. //init CalendarApp
  74. $.CalendarApp = new CalendarApp, $.CalendarApp.Constructor = CalendarApp
  75. }(window.jQuery),
  76. //initializing CalendarApp
  77. function($) {
  78. "use strict";
  79. $.CalendarApp.init()
  80. }(window.jQuery);
  81. </script>
  82. <div class="container-fluid p-t-30" id="homepage-items">
  83. ' . buildHomepage() . '
  84. </div>
  85. <div id="open-youtube" class="white-popup mfp-with-anim mfp-hide">
  86. <div class="col-md-8 col-md-offset-2 youtube-div"> </div>
  87. </div>
  88. <!-- /.container-fluid -->
  89. <!-- modal content -->
  90. <div id="calendar-filter-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;">
  91. <div class="modal-dialog modal-sm">
  92. <div class="modal-content">
  93. <div class="modal-header">
  94. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  95. <h4 class="modal-title" id="mySmallModalLabel" lane="en">Filter Calendar</h4> </div>
  96. <div class="modal-body">
  97. <div class="row">
  98. <div class="col-md-12">
  99. <label class="control-label" lang="en">Choose Media Type</label>
  100. <select class="form-control form-white" data-placeholder="Choose media type" id="choose-calender-filter">
  101. <option value="all">All</option>
  102. <option value="tv">TV</option>
  103. <option value="film">Movie</option>
  104. <option value="music">Music</option>
  105. </select>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <!-- /.modal-content -->
  111. </div>
  112. <!-- /.modal-dialog -->
  113. </div>
  114. <!-- /.modal -->
  115. ';
  116. }