-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid.php
117 lines (88 loc) · 2.97 KB
/
grid.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
include_once ("php/VideoController.php");
include_once ("php/helper.php");
$vc = new VideoController();
$helper = new Helper();
?>
<div id="gridContent">
<div class="wrapper">
<div class="distance">
<div class="contentBox">
<div class="naviPages" style="display: none;">
<ul>
<li class="current"></li>
</ul>
</div>
<div class="gridContainer">
<div class="slider">
<?php
$page = 1;
$max_videos = $vc->getNumOfVideos();
$num_pages = 1;
if ($max_videos-11 > 0) {
//There are still more videos to show on pages
$num_pages = ceil(($max_videos-11)/10);
$num_pages++;
}
for($i=1;$i<=$num_pages;$i++) {
if ($i == 1) {
$max_elements = 11;
$page_plus_one = 0;
$is_shown = " is_shown";
$style = "";
}
else {
$max_elements = 11;
$page_plus_one = 1;
$is_shown = "";
$style = ' style="opacity: 0;"';
}
print '<ul class="page'.$is_shown.'" id="'.$i.'"'.$style.'>';
$grid_elements = json_decode($vc->getMatrixViewWithImages(($i-1)*$max_elements+$page_plus_one,($i*$max_elements)+1));
foreach($grid_elements as $element) {
print $helper->getVideoTemplate($element->Video_ID,$element->title,$element->description,$element->images);
}
print "</ul>";
}
?>
</div>
</div>
<div class="playList">
<?php
$playlist = '';
if ($_COOKIE["playlist"] != null && $_COOKIE["playlist"] != "") {
$ids = explode("-",$_COOKIE["playlist"]);
$num_playlist = count($ids);
foreach ($ids as $id) {
$playlist .= $helper->getVideoTemplateById($id);
}
}
?>
<div class="info">
<?php
if ($playlist == '') {
?>
<p>Um eine Playlist zu erstellen, ziehen Sie bitte die gewünschten Filme von der rechten Seite auf die hier markierten Flächen.</p>
<?php
}
?>
</div>
<ul>
<?php print $playlist ?>
</ul>
<?php
$not_active = "";
if ($num_playlist <= 3) {
$not_active = ' inactive';
}
?>
<div class="playlistDown<?php print $not_active ?>"></div>
<div class="playlistUp inactive"></div>
<div class="playButtonPlaylist"></div>
<div class="deleteButtonPlaylist"></div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>