Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ui/include/classes/widgets/fields/CWidgetFieldLatLng.php')
-rw-r--r--ui/include/classes/widgets/fields/CWidgetFieldLatLng.php36
1 files changed, 10 insertions, 26 deletions
diff --git a/ui/include/classes/widgets/fields/CWidgetFieldLatLng.php b/ui/include/classes/widgets/fields/CWidgetFieldLatLng.php
index 798a8a21d92..60494f70cf4 100644
--- a/ui/include/classes/widgets/fields/CWidgetFieldLatLng.php
+++ b/ui/include/classes/widgets/fields/CWidgetFieldLatLng.php
@@ -19,39 +19,23 @@
**/
-class CWidgetFieldLatLng extends CWidgetField {
+namespace Zabbix\Widgets\Fields;
- /**
- * @var string
- */
- private $placeholder;
+use Zabbix\Widgets\CWidgetField;
- /**
- * @var int
- */
- private $width;
+class CWidgetFieldLatLng extends CWidgetField {
+
+ public const DEFAULT_VALUE = '';
/**
* Latitude, longitude and zoom level input text box widget field.
- *
- * @param string $name field name in form
- * @param string $label label for the field in form
*/
- public function __construct($name, $label) {
+ public function __construct(string $name, string $label = null) {
parent::__construct($name, $label);
- $this->setSaveType(ZBX_WIDGET_FIELD_TYPE_STR);
- $this->setValidationRules(['type' => API_LAT_LNG_ZOOM, 'length' => 255]);
- $this->placeholder = '40.6892494,-74.0466891';
- $this->width = ZBX_TEXTAREA_MEDIUM_WIDTH;
- $this->setDefault('');
- }
-
- public function getPlaceholder() {
- return $this->placeholder;
- }
-
- public function getWidth() {
- return $this->width;
+ $this
+ ->setDefault(self::DEFAULT_VALUE)
+ ->setSaveType(ZBX_WIDGET_FIELD_TYPE_STR)
+ ->setValidationRules(['type' => API_LAT_LNG_ZOOM, 'length' => 255]);
}
}