Merge pull request #9 from qzminski/master

Fix compatibility with Contao 5
This commit is contained in:
David Molineus
2022-11-29 10:30:39 +01:00
committed by GitHub
3 changed files with 11 additions and 6 deletions

View File

@@ -24,8 +24,8 @@
"source": "https://github.com/contao-bootstrap/core"
},
"require": {
"php": ">=5.6.0",
"contao/core-bundle": "^4.4.0",
"php": "^7.4 || ^8.0",
"contao/core-bundle": "^4.13 || ^5.0",
"netzmacht/contao-leaflet-libraries": "~1.3"
},
"require-dev": {

View File

@@ -12,13 +12,17 @@
namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget;
use Contao\BackendTemplate;
use Contao\StringUtil;
use Contao\Widget;
/**
* Class GeocodeWidget
*
* @property int size
* @property bool multiple
*/
class GeocodeWidget extends \Widget
class GeocodeWidget extends Widget
{
/**
* Submit user input.
@@ -111,12 +115,12 @@ class GeocodeWidget extends \Widget
$buffer = '';
for ($index = 0; $index < $this->size; $index++) {
$template = new \BackendTemplate($this->widgetTemplate);
$template = new BackendTemplate($this->widgetTemplate);
$template->setData(
[
'wrapperClass' => $wrapperClass,
'widget' => $this,
'value' => \StringUtil::specialchars($this->value[$index]),
'value' => StringUtil::specialchars($this->value[$index]),
'class' => $this->strClass ? ' ' . $this->strClass : '',
'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''),
'name' => $this->strName . (($this->size > 1) ? '[]' : ''),

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget;
use Contao\BackendTemplate;
use Contao\StringUtil;
use Contao\TextField;
/**
@@ -66,7 +67,7 @@ class RadiusWidget extends TextField
[
'wrapperClass' => trim($wrapperClass),
'widget' => $this,
'value' => \StringUtil::specialchars($this->value[$index]),
'value' => StringUtil::specialchars($this->value[$index]),
'class' => $this->strClass ? ' ' . $this->strClass : '',
'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''),
'name' => $this->strName . (($this->size > 1) ? '[]' : ''),