diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index ca530614..16487ca4 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -32,10 +32,11 @@ class UniversalLanguageSelectorHooks { $out->addModules( 'ext.uls.displaysettings' ); return true; } + /** * ResourceLoaderTestModules hook handler. - * @param $testModules: array of javascript testing modules. 'qunit' is fed using tests/qunit/QUnitTestResources.php. - * @param $resourceLoader object + * @param $testModules array of javascript testing modules. 'qunit' is fed using tests/qunit/QUnitTestResources.php. + * @param $resourceLoader ResourceLoader * @return bool */ public static function addTestModules( array &$testModules, ResourceLoader &$resourceLoader ) { @@ -47,6 +48,7 @@ class UniversalLanguageSelectorHooks { ); return true; } + /** * Add some tabs for navigation for users who do not use Ajax interface. * Hooks: SkinTemplateNavigation, SkinTemplateTabs @@ -93,6 +95,7 @@ class UniversalLanguageSelectorHooks { $code = RequestContext::sanitizeLangCode( $code ); return true; } + /** * Hook: ResourceLoaderGetConfigVars * @param $vars Array @@ -107,6 +110,9 @@ class UniversalLanguageSelectorHooks { /** * Add the template for the ULS to the body. * Hooks: SkinAfterContent + * @param $data string + * @param $skin Skin + * @return bool * TODO: move to JavaScript side * TODO: hardcoded English */ diff --git a/data/LanguageNameIndexer.php b/data/LanguageNameIndexer.php index a2530830..7ef08536 100644 --- a/data/LanguageNameIndexer.php +++ b/data/LanguageNameIndexer.php @@ -39,7 +39,7 @@ class LanguageNameIndexer extends Maintenance { foreach ( $languages as $code => $name ) { $all[$code][strtolower( $name )] = true; $langnames = LanguageNames::getNames( $code, 0, 2 ); - foreach ( $langnames as $code => $name ) { + foreach ( $langnames as $code => $name ) { // FIXME: Variable pollution $all[$code][] = strtolower( $name ); } } diff --git a/data/LanguageNameSearch.php b/data/LanguageNameSearch.php index 8d43f2bd..49196e7b 100644 --- a/data/LanguageNameSearch.php +++ b/data/LanguageNameSearch.php @@ -19,9 +19,11 @@ */ class LanguageNameSearch { static $languagenames; + public static function init() { self::$languagenames = unserialize( file_get_contents( __DIR__ . '/langnames.ser' ) ); } + public static function search( $searchKey, $typos = 0 ) { if ( self::$languagenames === null ) { self::init(); @@ -61,6 +63,7 @@ class LanguageNameSearch { /** * Get the code point of first letter of string * + * @param $str string * @return integer Code point of first letter of string */ static function getCodepoint( $str ) { @@ -84,6 +87,7 @@ class LanguageNameSearch { } } } + /** * Calculate the Levenshtein distance between two strings * @param $str1 diff --git a/resources/images/display.png b/resources/images/display.png index 6638099e..92c80289 100644 Binary files a/resources/images/display.png and b/resources/images/display.png differ