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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2013-10-31 23:55:31 +0400
committerThomas Steur <thomas.steur@gmail.com>2013-10-31 23:55:31 +0400
commitb3dfd3409f661ef27d5916d80a5ffc9c87fbe87a (patch)
tree9c6cb79b04cc54745808d6b4ab3173d590b95d97 /plugins/ExampleSettingsPlugin
parent7aae1abb5ed1712a8666fa96732b259cbe5f5a61 (diff)
refs #4126 added possibility to define radio boxes
Diffstat (limited to 'plugins/ExampleSettingsPlugin')
-rw-r--r--plugins/ExampleSettingsPlugin/Settings.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/ExampleSettingsPlugin/Settings.php b/plugins/ExampleSettingsPlugin/Settings.php
index 44282ddc52..140dc477cd 100644
--- a/plugins/ExampleSettingsPlugin/Settings.php
+++ b/plugins/ExampleSettingsPlugin/Settings.php
@@ -31,6 +31,9 @@ class Settings extends \Piwik\Plugin\Settings
/** @var UserSetting */
public $refreshInterval;
+ /** @var UserSetting */
+ public $color;
+
/** @var SystemSetting */
public $metric;
@@ -53,6 +56,9 @@ class Settings extends \Piwik\Plugin\Settings
// User setting --> textbox converted to int defining a validator and filter
$this->createRefreshIntervalSetting();
+ // User setting --> readio
+ $this->createColorSetting();
+
// System setting --> allows selection of a single value
$this->createMetricSetting();
@@ -60,10 +66,10 @@ class Settings extends \Piwik\Plugin\Settings
$this->createBrowsersSetting();
// System setting --> textarea
- $this->createDescriptionSetting();
+ $this->createDescriptionSetting();
// System setting --> textarea
- $this->createPasswordSetting();
+ $this->createPasswordSetting();
}
private function createAutoRefreshSetting()
@@ -95,6 +101,16 @@ class Settings extends \Piwik\Plugin\Settings
$this->addSetting($this->refreshInterval);
}
+ private function createColorSetting()
+ {
+ $this->color = new UserSetting('color', 'Color');
+ $this->color->field = static::FIELD_RADIO;
+ $this->color->description = 'Pick your favourite color';
+ $this->color->fieldOptions = array('red' => 'Red', 'blue' => 'Blue', 'green' => 'Green');
+
+ $this->addSetting($this->color);
+ }
+
private function createMetricSetting()
{
$this->metric = new SystemSetting('metric', 'Metric to display');