-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSystemSettings.php
52 lines (46 loc) · 1.32 KB
/
SystemSettings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Piwik - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\WAIMatomoTheme;
use Piwik\Piwik;
use Piwik\Settings\FieldConfig;
use Piwik\Settings\Plugin\SystemSettings as BaseSystemSettings;
use Piwik\Validators\NotEmpty;
/**
* System Settings for WAIMatomoTheme.
*/
class SystemSettings extends BaseSystemSettings
{
/**
* WAI Portal URL setting.
*
* @var string the URL
*/
public $waiUrl;
/**
* Define system settings.
*/
protected function init()
{
$this->waiUrl = $this->createDescriptionSetting();
}
/**
* Create WAI Portal URL setting.
*
* @return \Piwik\Settings\Plugin\SystemSetting the configured setting
*/
private function createDescriptionSetting()
{
$default = 'https://localhost';
return $this->makeSetting('waiUrl', $default, FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$field->title = Piwik::translate('WAIMatomoTheme_WAIPortalBaseURLTitle');
$field->uiControl = FieldConfig::UI_CONTROL_URL;
$field->description = Piwik::translate('WAIMatomoTheme_WAIPortalBaseURLDescription');
$field->validators[] = new NotEmpty();
});
}
}