-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathView.php
59 lines (46 loc) · 1.89 KB
/
View.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
<?php
namespace FalloutGrabber;
class View
{
public function introCardSet(): string {
return ' <div class="col-sm-10">
<h2 class="mt-5">CardSet Overview</h2>
<h5>CardSet overview over different CardTypes.</h5>
<p>Select CardType</p>
</div>';
}
public function showCardSet($set, $cards): string {
$content = '<div class="col-sm-10">
<h2 class="mt-5">Cardset</h2>
<h5>' . $set . '
<button type="button" hx-get="/?action=downloadSet&set=' . $set . '" class="bi-cloud-download btn btn-primary"> </button></h5>
<p>Overview over set</p>';
$content .= ' <div class="row">';
for ($i = 0; $i < $cards[3]; $i++) {
$content .= $this->showDetailCard($i, $set, $cards[4],$cards['Names'][$i]);
}
$content .= ' </div>
</div>';
return $content;
}
public function showCards($cards): string {
$content = ' <div class="row">';
foreach ($cards as $card){
$content .=$this->showDetailCard((int)reset($card), key($card),$card[0]);
}
$content .= ' </div>';
return $content;
}
public function showDetailCard(int $cardNr, string $set, $row, $title = null): string {
$cardRow = floor($cardNr / $row);
$cardColumn = $cardNr % $row;
return $this->showCard($title,
'/storage/imageCache/' . $set . '/' . $cardRow . '-' . $cardColumn . '.png',
$set.'-'.$cardNr,
$this->addButton($set, $cardRow, $cardColumn),
$this->loadButton($set, $cardNr));
}
public function showCard($cardTitle, $imageUrl, $cardName, $addButton = null, $loadButton = null, $size = 3): string {
return (' ');
}
}