-
Notifications
You must be signed in to change notification settings - Fork 0
/
MeasurableSettings.php
44 lines (37 loc) · 1.55 KB
/
MeasurableSettings.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
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\MozWidgetByAmperage;
use Piwik\Settings\Setting;
use Piwik\Settings\FieldConfig;
/**
* Defines Settings for MozWidgetByAmperage.
*
* Usage like this:
* // require Piwik\Plugin\SettingsProvider via Dependency Injection eg in constructor of your class
* $settings = $settingsProvider->getMeasurableSettings('MozWidgetByAmperage', $idSite);
* $settings->appId->getValue();
* $settings->contactEmails->getValue();
*/
class MeasurableSettings extends \Piwik\Settings\Measurable\MeasurableSettings
{
/** @var Setting */
public $mozCustomReportURLSetting;
protected function init()
{
$this->mozCustomReportURLSetting = $this->makeMozCustomReportURLSetting();
}
private function makeMozCustomReportURLSetting()
{
return $this->makeSetting('mozCustomReportURL', $default = '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$field->title = 'Moz.com Custom Report Preview URL';
$field->uiControl = FieldConfig::UI_CONTROL_TEXT;
$field->uiControlAttributes = array('size' => 3);
$field->description = 'The Moz.com URL for previewing your preferred custom report. For example, `https://analytics.moz.com/pro/analytics/reports/12345/12345/preview/12345` is obtained by going to Moz Pro Campaign => Custom Reports => Preview & Download (under Actions for the preferred custom report.)';
});
}
}