-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMeasurableSettings.php
44 lines (37 loc) · 1.4 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\TwitterFeedWidgetByAmperage;
use Piwik\Settings\Setting;
use Piwik\Settings\FieldConfig;
/**
* Defines Settings for TwitterFeedWidgetByAmperage.
*
* Usage like this:
* // require Piwik\Plugin\SettingsProvider via Dependency Injection eg in constructor of your class
* $settings = $settingsProvider->getMeasurableSettings('TwitterFeedWidgetByAmperage', $idSite);
* $settings->appId->getValue();
* $settings->contactEmails->getValue();
*/
class MeasurableSettings extends \Piwik\Settings\Measurable\MeasurableSettings
{
/** @var Setting */
public $twitterFeedUsernameSetting;
protected function init()
{
$this->twitterFeedUsernameSetting = $this->makeTwitterFeedUsernameSetting();
}
private function makeTwitterFeedUsernameSetting()
{
return $this->makeSetting('twitterFeedUsername', $default = '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$field->title = 'Twitter Feed Username';
$field->uiControl = FieldConfig::UI_CONTROL_TEXT;
$field->uiControlAttributes = array('size' => 3);
$field->description = 'The Username for your Twitter Feed (ex. "WeMoveTheNeedle" would be for https://twitter.com/WeMoveTheNeedle.)';
});
}
}