formatSettings() public method

public formatSettings ( Settings[] $allSettings ) : array
$allSettings Piwik\Settings\Settings[] A list of Settings instead by pluginname
return array
Example #1
0
File: API.php Project: piwik/piwik
 public function getSiteSettings($idSite)
 {
     Piwik::checkUserHasAdminAccess($idSite);
     $measurableSettings = $this->settingsProvider->getAllMeasurableSettings($idSite, $idMeasurableType = false);
     return $this->settingsMetadata->formatSettings($measurableSettings);
 }
Example #2
0
File: API.php Project: piwik/piwik
 /**
  * @internal
  * @return array
  * @throws \Piwik\NoAccessException
  */
 public function getUserSettings()
 {
     Piwik::checkUserIsNotAnonymous();
     $userSettings = $this->settingsProvider->getAllUserSettings();
     return $this->settingsMetadata->formatSettings($userSettings);
 }
Example #3
0
File: API.php Project: piwik/piwik
 /**
  * Returns all available measurable types.
  * Marked as deprecated so it won't appear in API page. It won't be a public API for now.
  * @deprecated
  * @return array
  */
 public function getAvailableMeasurableTypes()
 {
     Piwik::checkUserHasSomeViewAccess();
     $typeManager = new TypeManager();
     $types = $typeManager->getAllTypes();
     $available = array();
     foreach ($types as $type) {
         $measurableSettings = $this->settingsProvider->getAllMeasurableSettings($idSite = 0, $type->getId());
         $settingsMetadata = new SettingsMetadata();
         $available[] = array('id' => $type->getId(), 'name' => Piwik::translate($type->getName()), 'description' => Piwik::translate($type->getDescription()), 'howToSetupUrl' => $type->getHowToSetupUrl(), 'settings' => $settingsMetadata->formatSettings($measurableSettings));
     }
     return $available;
 }