Skip to content

Commit

Permalink
Update v4.9.20231119
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilkware committed Nov 25, 2023
1 parent de6bca1 commit fa11bdc
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions libs/VisualisationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait VisualisationHelper
/**
* Pre-defined waste types with assoziated color and search term.
*/
private const WASTE_TYPES = [
private static $WASTE_TYPES = [
['Type' => 'blue', 'Term' => 'Recyclable Waste', 'Color'=> 1155315, 'Match'=> 'papier|pappe|zeitung'],
['Type' => 'green', 'Term' => 'Organic Waste', 'Color'=> 5810438, 'Match'=> 'bio|grün|garten|baum|schnittgut'],
['Type' => 'yellow', 'Term' => 'Mixed Recycling Waste', 'Color'=> 16761095, 'Match'=> 'gelb|plaste|pvc'],
Expand All @@ -37,7 +37,7 @@ trait VisualisationHelper
protected function GetWasteValues()
{
$values = [];
foreach (self::WASTE_TYPES as $value) {
foreach (self::$WASTE_TYPES as $value) {
$value['Term'] = $this->Translate($value['Term']);
$values[] = $value;
}
Expand Down Expand Up @@ -94,7 +94,7 @@ protected function BuildWidget(array $waste, string $skin, array $custom)
$svg .= '<svg class="icon icon--' . $table[$i]['type'] . '" aria-hidden="true"><use xlink:href="#icon-waste" href="#icon-waste" /></svg>';
$wn .= $table[$i]['name'];
if ($i != ($pickups - 1)) {
$wn .= ',';
$wn .= ', ';
}
}
// (*) build html texts
Expand Down Expand Up @@ -156,7 +156,7 @@ protected function BuildWidget(array $waste, string $skin, array $custom)
$tbc = ($skin == 'light') ? '#D7D6D6' : '#4A4B4D';
$wic = '';
foreach ($custom as $color) {
$wic .= ' .icon--' . $color['Type'] . ' {fill: #' . sprintf('%06X', $color['Color']) . ';}' . PHP_EOL;
$wic .= PHP_EOL . ' .icon--' . $color['Type'] . ' {fill: #' . sprintf('%06X', $color['Color']) . ';}';
}

$html = '
Expand All @@ -174,8 +174,7 @@ protected function BuildWidget(array $waste, string $skin, array $custom)
#col1 {width: 50%; height: 100%; display: flex; float: left;}
#col2 {width: 50%; height: 100%; float: left; text-align: left;}
#row1 {width: 100%; height: 65%; display: flex;}
.icon {width: 100%; height: 100%;}' .
$wic . '
.icon {width: 100%; height: 100%;}' . $wic . '
.text {font-size: 1.2em;}
.hidden {width:0; height:0; position:absolute;}
table.wwx {border-collapse: collapse; width: 100%;}
Expand All @@ -201,17 +200,15 @@ protected function BuildWidget(array $waste, string $skin, array $custom)
<!-- Small Cards -->
<div class="cardS">
<div id="grid">
<div id="row1">'
. $svg . '
<div id="row1">' . $svg . '
</div>
<div id="row2" class="text">' . $textS . '</div>
</div>
</div>
<!-- Medium Cards -->
<div class="cardM">
<div id="grid">
<div id="col1">'
. $svg . '
<div id="col1">' . $svg . '
</div>
<div id="col2" class="text">' . $textM . '</div>
</div>
Expand Down

0 comments on commit fa11bdc

Please sign in to comment.