Support inactive layers icons.

This commit is contained in:
David Molineus
2015-01-07 12:38:31 +01:00
parent b47e6ccb8a
commit 17df30da3f
5 changed files with 9 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

View File

@@ -49,11 +49,18 @@ class Layer
: $GLOBALS['TL_LANG']['leaflet_layer'][$row['type']][1];
if (!empty($this->layers[$row['type']]['icon'])) {
$icon = \Image::getHtml($this->layers[$row['type']]['icon'], $alt, sprintf('title="%s"', $title));
$src = $this->layers[$row['type']]['icon'];
} else {
$icon = \Image::getHtml('iconPLAIN.gif', $alt, sprintf('title="%s"', $title));
$src = 'iconPLAIN.gif';
}
if (!$row['active']) {
$src = preg_replace('/(\.[^\.]+)$/', '_1$1', $src);
}
$icon = \Image::getHtml($src, $alt, sprintf('title="%s"', $title));
return $icon . ' ' . $label;
}