diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2013-12-08 06:36:27 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2013-12-08 06:36:27 +0400 |
commit | 4cafa9e3c79051476c54ad81a3e73e7242e7775a (patch) | |
tree | 431054418bf63b5094e5c4be961ab420278d289e /core/Settings | |
parent | 87d676dbff31adb4c1cf389cd66511434ab925ab (diff) |
Refs #4200 revised some of class/method docs.
Diffstat (limited to 'core/Settings')
-rw-r--r-- | core/Settings/Setting.php | 32 | ||||
-rw-r--r-- | core/Settings/SystemSetting.php | 4 | ||||
-rw-r--r-- | core/Settings/UserSetting.php | 6 |
3 files changed, 20 insertions, 22 deletions
diff --git a/core/Settings/Setting.php b/core/Settings/Setting.php index ba58abbc34..670ba37c88 100644 --- a/core/Settings/Setting.php +++ b/core/Settings/Setting.php @@ -31,9 +31,9 @@ abstract class Setting public $type = null; /** - * Describes how the setting should be manipulated through Piwik's UI. + * Describes what HTML element should be used to manipulate the setting through Piwik's UI. * - * See {@link Piwik\Plugin\Settings} for a list of supportted control types. + * See {@link Piwik\Plugin\Settings} for a list of supported control types. * * @var string */ @@ -73,7 +73,7 @@ abstract class Setting public $introduction = null; /** - * Text that will be appear directly underneath the setting title in the _Plugin Settings_ admin + * Text that will appear directly underneath the setting title in the _Plugin Settings_ admin * page. If set, should be a short description of the setting. * * @var null|string @@ -98,13 +98,11 @@ abstract class Setting * * **Example** * - * ``` - * $setting->validate = function ($value, Setting $setting) { - * if ($value > 60) { - * throw new \Exception('The time limit is not allowed to be greater than 60 minutes.'); + * $setting->validate = function ($value, Setting $setting) { + * if ($value > 60) { + * throw new \Exception('The time limit is not allowed to be greater than 60 minutes.'); + * } * } - * } - * ``` * * @var null|\Closure */ @@ -120,15 +118,13 @@ abstract class Setting * * **Example** * - * ``` - * $setting->transform = function ($value, Setting $setting) { - * if ($value > 30) { - * $value = 30; - * } + * $setting->transform = function ($value, Setting $setting) { + * if ($value > 30) { + * $value = 30; + * } * - * return (int) $value; - * } - * ``` + * return (int) $value; + * } * * @var null|\Closure */ @@ -185,7 +181,7 @@ abstract class Setting } /** - * Returns true if this setting can be displayed for the current user, false if otherwise. + * Returns `true` if this setting can be displayed for the current user, `false` if otherwise. * * @return bool */ diff --git a/core/Settings/SystemSetting.php b/core/Settings/SystemSetting.php index e96f1a1fb0..50e79e11c6 100644 --- a/core/Settings/SystemSetting.php +++ b/core/Settings/SystemSetting.php @@ -16,6 +16,8 @@ use Piwik\Piwik; /** * Describes a system wide setting. Only the super user can change this type of setting and * the value of this setting will affect all users. + * + * See {@link \Piwik\Plugin\Settings}. * * @package Piwik * @subpackage Settings @@ -38,7 +40,7 @@ class SystemSetting extends Setting } /** - * Returns the display order. User settings are displayed after system settings. + * Returns the display order. System settings are displayed before user settings. * * @return int */ diff --git a/core/Settings/UserSetting.php b/core/Settings/UserSetting.php index 7512f693c4..696d940b42 100644 --- a/core/Settings/UserSetting.php +++ b/core/Settings/UserSetting.php @@ -14,8 +14,8 @@ use Piwik\Common; use Piwik\Piwik; /** - * Describes a per user setting. Each user will be able to change this setting but each user - * can set a different value. Changes from one user will not affect other users. + * Describes a per user setting. Each user will be able to change this setting for themselves, + * but not for other users. * * @package Piwik * @subpackage Settings @@ -39,7 +39,7 @@ class UserSetting extends Setting $this->setUserLogin($userLogin); - $this->displayedForCurrentUser = !Piwik::isUserIsAnonymous() && Piwik::isUserHasSomeViewAccess(); + $this->displayedForCurrentUser = Piwik::isUserHasSomeViewAccess(); } /** |