getSystemSettings() 공개 메소드

Get user settings implemented by a specific plugin (if implemented by this plugin).
public getSystemSettings ( string $pluginName ) : SystemSettings | null
$pluginName string
리턴 Piwik\Settings\Plugin\SystemSettings | null
예제 #1
0
파일: Controller.php 프로젝트: piwik/piwik
 public function activate($redirectAfter = true)
 {
     $pluginName = $this->initPluginModification(static::ACTIVATE_NONCE);
     $this->dieIfPluginsAdminIsDisabled();
     $this->pluginManager->activatePlugin($pluginName);
     if ($redirectAfter) {
         $message = $this->translator->translate('CorePluginsAdmin_SuccessfullyActicated', array($pluginName));
         if ($this->settingsProvider->getSystemSettings($pluginName)) {
             $target = sprintf('<a href="index.php%s#%s">', Url::getCurrentQueryStringWithParametersModified(array('module' => 'CoreAdminHome', 'action' => 'generalSettings')), $pluginName);
             $message .= ' ' . $this->translator->translate('CorePluginsAdmin_ChangeSettingsPossible', array($target, '</a>'));
         }
         $notification = new Notification($message);
         $notification->raw = true;
         $notification->title = $this->translator->translate('General_WellDone');
         $notification->context = Notification::CONTEXT_SUCCESS;
         Notification\Manager::notify('CorePluginsAdmin_PluginActivated', $notification);
         $redirectTo = Common::getRequestVar('redirectTo', '', 'string');
         if (!empty($redirectTo) && $redirectTo === 'marketplace') {
             $this->redirectToIndex('Marketplace', 'overview');
         } elseif (!empty($redirectTo) && $redirectTo === 'referrer') {
             $this->redirectAfterModification($redirectAfter);
         } else {
             $plugin = $this->pluginManager->loadPlugin($pluginName);
             $actionToRedirect = 'plugins';
             if ($plugin->isTheme()) {
                 $actionToRedirect = 'themes';
             }
             $this->redirectToIndex('CorePluginsAdmin', $actionToRedirect);
         }
     }
 }