Merge "Localisation updates from https://translatewiki.net."
[lhc/web/wiklou.git] / includes / Preferences.php
index 1825cce..493626a 100644 (file)
@@ -71,8 +71,8 @@ class Preferences {
 
        /**
         * @throws MWException
-        * @param $user User
-        * @param $context IContextSource
+        * @param User $user
+        * @param IContextSource $context
         * @return array|null
         */
        static function getPreferences( $user, IContextSource $context ) {
@@ -143,10 +143,10 @@ class Preferences {
        /**
         * Pull option from a user account. Handles stuff like array-type preferences.
         *
-        * @param $name
-        * @param $info
-        * @param $user User
-        * @return array|String
+        * @param string $name
+        * @param array $info
+        * @param User $user
+        * @return array|string
         */
        static function getOptionFromUser( $name, $info, $user ) {
                $val = $user->getOption( $name );
@@ -186,9 +186,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         * @return void
         */
        static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) {
@@ -301,14 +301,6 @@ class Preferences {
                                'section' => 'personal/info',
                        );
                }
-               if ( $wgCookieExpiration > 0 ) {
-                       $defaultPreferences['rememberpassword'] = array(
-                               'type' => 'toggle',
-                               'label' => $context->msg( 'tog-rememberpassword' )->numParams(
-                                       ceil( $wgCookieExpiration / ( 3600 * 24 ) ) )->text(),
-                               'section' => 'personal/info',
-                       );
-               }
                // Only show prefershttps if secure login is turned on
                if ( $wgSecureLogin && wfCanIPUseHTTPS( $context->getRequest()->getIP() ) ) {
                        $defaultPreferences['prefershttps'] = array(
@@ -570,9 +562,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         * @return void
         */
        static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) {
@@ -614,9 +606,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences Array
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         */
        static function filesPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                ## Files #####################################
@@ -635,9 +627,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         * @return void
         */
        static function datetimePreferences( $user, IContextSource $context, &$defaultPreferences ) {
@@ -708,9 +700,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences Array
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         */
        static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                ## Diffs ####################################
@@ -768,9 +760,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences Array
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         */
        static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                global $wgAllowUserCssPrefs;
@@ -856,9 +848,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences Array
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         */
        static function rcPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                global $wgRCMaxAge, $wgRCShowWatchingUsers;
@@ -913,9 +905,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         */
        static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge;
@@ -1017,9 +1009,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences Array
+        * @param User $user
+        * @param IContextSource $context
+        * @param array $defaultPreferences
         */
        static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                global $wgContLang;
@@ -1054,9 +1046,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User The User object
-        * @param $context IContextSource
-        * @return Array: text/links to display as key; $skinkey as value
+        * @param User $user The User object
+        * @param IContextSource $context
+        * @return array Text/links to display as key; $skinkey as value
         */
        static function generateSkinOptions( $user, IContextSource $context ) {
                global $wgDefaultSkin, $wgAllowUserCss, $wgAllowUserJs;
@@ -1112,7 +1104,7 @@ class Preferences {
        }
 
        /**
-        * @param $context IContextSource
+        * @param IContextSource $context
         * @return array
         */
        static function getDateOptions( IContextSource $context ) {
@@ -1147,7 +1139,7 @@ class Preferences {
        }
 
        /**
-        * @param $context IContextSource
+        * @param IContextSource $context
         * @return array
         */
        static function getImageSizes( IContextSource $context ) {
@@ -1165,7 +1157,7 @@ class Preferences {
        }
 
        /**
-        * @param $context IContextSource
+        * @param IContextSource $context
         * @return array
         */
        static function getThumbSizes( IContextSource $context ) {
@@ -1183,9 +1175,9 @@ class Preferences {
        }
 
        /**
-        * @param $signature string
-        * @param $alldata array
-        * @param $form HTMLForm
+        * @param string $signature
+        * @param array $alldata
+        * @param HTMLForm $form
         * @return bool|string
         */
        static function validateSignature( $signature, $alldata, $form ) {
@@ -1208,9 +1200,9 @@ class Preferences {
        }
 
        /**
-        * @param $signature string
-        * @param $alldata array
-        * @param $form HTMLForm
+        * @param string $signature
+        * @param array $alldata
+        * @param HTMLForm $form
         * @return string
         */
        static function cleanSignature( $signature, $alldata, $form ) {
@@ -1226,10 +1218,10 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $formClass string
-        * @param array $remove array of items to remove
+        * @param User $user
+        * @param IContextSource $context
+        * @param string $formClass
+        * @param array $remove Array of items to remove
         * @return HtmlForm
         */
        static function getFormObject(
@@ -1268,7 +1260,7 @@ class Preferences {
        }
 
        /**
-        * @param $context IContextSource
+        * @param IContextSource $context
         * @return array
         */
        static function getTimezoneOptions( IContextSource $context ) {
@@ -1342,8 +1334,8 @@ class Preferences {
        }
 
        /**
-        * @param $value
-        * @param $alldata
+        * @param string $value
+        * @param array $alldata
         * @return int
         */
        static function filterIntval( $value, $alldata ) {
@@ -1351,8 +1343,8 @@ class Preferences {
        }
 
        /**
-        * @param $tz
-        * @param $alldata
+        * @param string $tz
+        * @param array $alldata
         * @return string
         */
        static function filterTimezoneInput( $tz, $alldata ) {
@@ -1385,8 +1377,8 @@ class Preferences {
        /**
         * Handle the form submission if everything validated properly
         *
-        * @param $formData
-        * @param $form PreferencesForm
+        * @param array $formData
+        * @param PreferencesForm $form
         * @return bool|Status|string
         */
        static function tryFormSubmit( $formData, $form ) {
@@ -1445,8 +1437,8 @@ class Preferences {
        }
 
        /**
-        * @param $formData
-        * @param $form PreferencesForm
+        * @param array $formData
+        * @param PreferencesForm $form
         * @return Status
         */
        public static function tryUISubmit( $formData, $form ) {
@@ -1475,10 +1467,10 @@ class Preferences {
         * Caller is responsible for checking $wgAuth and 'editmyprivateinfo'
         * right.
         *
-        * @deprecated in 1.20; use User::setEmailWithConfirmation() instead.
-        * @param $user User
+        * @deprecated since 1.20; use User::setEmailWithConfirmation() instead.
+        * @param User $user
         * @param string $newaddr New email address
-        * @return Array (true on success or Status on failure, info string)
+        * @return array (true on success or Status on failure, info string)
         */
        public static function trySetUserEmail( User $user, $newaddr ) {
                wfDeprecated( __METHOD__, '1.20' );
@@ -1492,8 +1484,8 @@ class Preferences {
        }
 
        /**
-        * @deprecated in 1.19
-        * @param $user User
+        * @deprecated since 1.19
+        * @param User $user
         * @return array
         */
        public static function loadOldSearchNs( $user ) {
@@ -1521,7 +1513,7 @@ class PreferencesForm extends HTMLForm {
        private $modifiedUser;
 
        /**
-        * @param $user User
+        * @param User $user
         */
        public function setModifiedUser( $user ) {
                $this->modifiedUser = $user;
@@ -1549,8 +1541,8 @@ class PreferencesForm extends HTMLForm {
        }
 
        /**
-        * @param $html string
-        * @return String
+        * @param string $html
+        * @return string
         */
        function wrapForm( $html ) {
                $html = Xml::tags( 'div', array( 'id' => 'preferences' ), $html );
@@ -1559,7 +1551,7 @@ class PreferencesForm extends HTMLForm {
        }
 
        /**
-        * @return String
+        * @return string
         */
        function getButtons() {
                if ( !$this->getModifiedUser()->isAllowedAny( 'editmyprivateinfo', 'editmyoptions' ) ) {
@@ -1582,7 +1574,7 @@ class PreferencesForm extends HTMLForm {
        /**
         * Separate multi-option preferences into multiple preferences, since we
         * have to store them separately
-        * @param $data array
+        * @param array $data
         * @return array
         */
        function filterDataForSubmit( $data ) {
@@ -1611,7 +1603,7 @@ class PreferencesForm extends HTMLForm {
        /**
         * Get the "<legend>" for a given section key. Normally this is the
         * prefs-$key message but we'll allow extensions to override it.
-        * @param $key string
+        * @param string $key
         * @return string
         */
        function getLegend( $key ) {