mirror of
https://github.com/netzmacht/contao-leaflet-geocode-widget.git
synced 2026-02-28 09:08:14 +01:00
Fix compatibility with Contao 5
This commit is contained in:
@@ -12,13 +12,17 @@
|
|||||||
|
|
||||||
namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget;
|
namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget;
|
||||||
|
|
||||||
|
use Contao\BackendTemplate;
|
||||||
|
use Contao\StringUtil;
|
||||||
|
use Contao\Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class GeocodeWidget
|
* Class GeocodeWidget
|
||||||
*
|
*
|
||||||
* @property int size
|
* @property int size
|
||||||
* @property bool multiple
|
* @property bool multiple
|
||||||
*/
|
*/
|
||||||
class GeocodeWidget extends \Widget
|
class GeocodeWidget extends Widget
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Submit user input.
|
* Submit user input.
|
||||||
@@ -111,12 +115,12 @@ class GeocodeWidget extends \Widget
|
|||||||
$buffer = '';
|
$buffer = '';
|
||||||
|
|
||||||
for ($index = 0; $index < $this->size; $index++) {
|
for ($index = 0; $index < $this->size; $index++) {
|
||||||
$template = new \BackendTemplate($this->widgetTemplate);
|
$template = new BackendTemplate($this->widgetTemplate);
|
||||||
$template->setData(
|
$template->setData(
|
||||||
[
|
[
|
||||||
'wrapperClass' => $wrapperClass,
|
'wrapperClass' => $wrapperClass,
|
||||||
'widget' => $this,
|
'widget' => $this,
|
||||||
'value' => \StringUtil::specialchars($this->value[$index]),
|
'value' => StringUtil::specialchars($this->value[$index]),
|
||||||
'class' => $this->strClass ? ' ' . $this->strClass : '',
|
'class' => $this->strClass ? ' ' . $this->strClass : '',
|
||||||
'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''),
|
'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''),
|
||||||
'name' => $this->strName . (($this->size > 1) ? '[]' : ''),
|
'name' => $this->strName . (($this->size > 1) ? '[]' : ''),
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget;
|
namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget;
|
||||||
|
|
||||||
use Contao\BackendTemplate;
|
use Contao\BackendTemplate;
|
||||||
|
use Contao\StringUtil;
|
||||||
use Contao\TextField;
|
use Contao\TextField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +67,7 @@ class RadiusWidget extends TextField
|
|||||||
[
|
[
|
||||||
'wrapperClass' => trim($wrapperClass),
|
'wrapperClass' => trim($wrapperClass),
|
||||||
'widget' => $this,
|
'widget' => $this,
|
||||||
'value' => \StringUtil::specialchars($this->value[$index]),
|
'value' => StringUtil::specialchars($this->value[$index]),
|
||||||
'class' => $this->strClass ? ' ' . $this->strClass : '',
|
'class' => $this->strClass ? ' ' . $this->strClass : '',
|
||||||
'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''),
|
'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''),
|
||||||
'name' => $this->strName . (($this->size > 1) ? '[]' : ''),
|
'name' => $this->strName . (($this->size > 1) ? '[]' : ''),
|
||||||
|
|||||||
Reference in New Issue
Block a user