diff --git a/libraries/joomla/access/access.php b/libraries/joomla/access/access.php index bf53ec72a6..e96114af10 100644 --- a/libraries/joomla/access/access.php +++ b/libraries/joomla/access/access.php @@ -323,7 +323,7 @@ public static function getAuthorisedViewLevels($userId) // Initialise the authorised array. $authorised = array(1); - // Find the authorized levels. + // Find the authorised levels. foreach (self::$viewLevels as $level => $rule) { foreach ($rule as $id) diff --git a/libraries/joomla/application/menu.php b/libraries/joomla/application/menu.php index 16b244b2c2..a266e6b27f 100644 --- a/libraries/joomla/application/menu.php +++ b/libraries/joomla/application/menu.php @@ -280,7 +280,7 @@ public function getMenu() * object and optionally an access extension object * * @param integer $id The menu id - * @return boolean True if authorized + * @return boolean True if authorised * @since 11.1 */ public function authorise($id) diff --git a/libraries/joomla/html/pane.php b/libraries/joomla/html/pane.php index d827cc75ca..da51f74428 100644 --- a/libraries/joomla/html/pane.php +++ b/libraries/joomla/html/pane.php @@ -29,6 +29,7 @@ abstract class JPane extends JObject * @param string $behavior The behavior to use. * @param boolean $useCookies Use cookies to remember the state of the panel. * @param array $params Associative array of values. + * * @return object */ public static function getInstance($behavior = 'Tabs', $params = array()) diff --git a/libraries/joomla/language/help.php b/libraries/joomla/language/help.php index 9c84312f93..d72ce58e4f 100644 --- a/libraries/joomla/language/help.php +++ b/libraries/joomla/language/help.php @@ -38,10 +38,10 @@ static function createURL($ref, $useComponent = false, $override = null, $compon $component = JApplicationHelper::getComponentName(); } - /* - * Determine the location of the help file. At this stage the URL - * can contain substitution codes that will be replaced later. - */ + + // Determine the location of the help file. At this stage the URL + // can contain substitution codes that will be replaced later. + if ($override) { $url = $override; } diff --git a/libraries/joomla/language/helper.php b/libraries/joomla/language/helper.php index b82729891e..f602426947 100644 --- a/libraries/joomla/language/helper.php +++ b/libraries/joomla/language/helper.php @@ -23,6 +23,8 @@ class JLanguageHelper * @param string Client key for the area * @param string Base path to use * @param array An array of arrays (text, value, selected) + * + * @return array List of system languages * @since 11.1 */ public static function createLanguageList($actualLanguage, $basePath = JPATH_BASE, $caching = false, $installed = false) @@ -77,12 +79,12 @@ public static function detectLanguage() $systemLangs = self::getLanguages(); foreach ($browserLangs as $browserLang) { - // slice out the part before ; on first step, the part before - on second, place into array + // Slice out the part before ; on first step, the part before - on second, place into array $browserLang = substr($browserLang, 0, strcspn($browserLang, ';')); $primary_browserLang = substr($browserLang, 0, 2); foreach($systemLangs as $systemLang) { - // take off 3 letters iso code languages as they can't match browsers' languages and default them to en + // Take off 3 letters iso code languages as they can't match browsers' languages and default them to en $Jinstall_lang = $systemLang->lang_code; if (strlen($Jinstall_lang) < 6) @@ -109,6 +111,7 @@ public static function detectLanguage() * Get available languages * * @param string array key + * * @return array of published languages * @since 11.1 */ diff --git a/libraries/joomla/language/language.php b/libraries/joomla/language/language.php index 3c4da5626e..66e1cd9151 100644 --- a/libraries/joomla/language/language.php +++ b/libraries/joomla/language/language.php @@ -135,12 +135,12 @@ class JLanguage extends JObject protected $transliterator = null; /** - * Name of the pluralSufficesCallback function for this language + * Name of the pluralSuffixesCallback function for this language * * @var string * @since 11.1 */ - protected $pluralSufficesCallback = null; + protected $pluralSuffixesCallback = null; /** * Name of the ignoredSearchWordsCallback function for this language @@ -227,7 +227,7 @@ public function __construct($lang = null, $debug = false) $this->transliterator = array($class, 'transliterate'); } if (method_exists($class, 'getPluralSuffixes')) { - $this->pluralSufficesCallback = array($class, 'getPluralSuffixes'); + $this->pluralSuffixesCallback = array($class, 'getPluralSuffixes'); } if (method_exists($class, 'getIgnoredSearchWords')) { $this->ignoredSearchWordsCallback = array($class, 'getIgnoredSearchWords'); @@ -308,7 +308,7 @@ public function _($string, $jsSafe = false, $interpretBackSlashes = true) $string = addslashes($string); } elseif ($interpretBackSlashes) { - // interpret \n and \t characters + // Interpret \n and \t characters $string = str_replace(array('\\\\','\t','\n'),array("\\", "\t","\n"),$string); } @@ -373,8 +373,8 @@ public function setTransliterator($function) * @since 11.1 */ public function getPluralSuffixes($count) { - if ($this->pluralSufficesCallback !== null) { - return call_user_func($this->pluralSufficesCallback, $count); + if ($this->pluralSuffixesCallback !== null) { + return call_user_func($this->pluralSuffixesCallback, $count); } else { return array((string)$count); @@ -382,24 +382,35 @@ public function getPluralSuffixes($count) { } /** - * Getter for pluralSufficesCallback function + * Getter for pluralSuffixesCallback function * * @return string|function Function name or the actual function for PHP 5.3 * @since 11.1 + * @deprecated */ - public function getPluralSuffixesCallback() { - return $this->pluralSufficesCallback; + public function getPluralSufficesCallback() { + return $this->getPluralSuffixesCallback(); } + /** + * Getter for pluralSuffixesCallback function + * + * @return string|function Function name or the actual function for PHP 5.3 + * @since 11.1 + * + */ + public function getPluralSuffixesCallback() { + return $this->pluralSuffixesCallback; + } /** - * Set the pluralSuffices function + * Set the pluralSuffixes function * * @return string|function Function name or the actual function for PHP 5.3 * @since 11.1 */ - public function setPluralSufficesCallback($function) { - $previous = $this->pluralSufficesCallback; - $this->pluralSufficesCallback = $function; + public function setPluralSuffixesCallback($function) { + $previous = $this->pluralSuffixesCallback; + $this->pluralSuffixesCallback = $function; return $previous; } @@ -566,6 +577,7 @@ public function setSearchDisplayedCharactersNumberCallback($function) { * * @param string $lang Language to check * @param string $basePath Optional path to check + * * @return boolean True if the language exists * @since 11.1 */ @@ -602,6 +614,7 @@ public static function exists($lang, $basePath = JPATH_BASE) * @param string $lang The language to load, default null for the current language * @param boolean $reload Flag that will force a language to be reloaded if set to true * @param boolean $default Flag that force the default language to be loaded if the current does not exist + * * @return boolean True, if the file has successfully loaded. * @since 11.1 */ @@ -619,13 +632,13 @@ public function load($extension = 'joomla', $basePath = JPATH_BASE, $lang = null $result = false; if (isset($this->paths[$extension][$filename]) && ! $reload) { - // Strings for this file have already been loaded + // Strings for this file have already been loaded. $result = true; } else { // Load the language file $result = $this->loadLanguage($filename, $extension); - // Check if there was a problem with loading the file + // Check whether there was a problem with loading the file if ($result === false && $default) { // No strings, so either file doesn't exist or the file is invalid $oldFilename = $filename; @@ -651,6 +664,7 @@ public function load($extension = 'joomla', $basePath = JPATH_BASE, $lang = null * * @param string The name of the file * @param string The name of the extension + * * @return boolean True if new strings have been added to the language * @see JLanguage::load() * @since 11.1 @@ -772,10 +786,11 @@ protected function parse($filename) } /** - * Get a matadata language property + * Get a metadata language property * * @param string $property The name of the property * @param mixed $default The default value + * * @return mixed The value of the property * @since 11.1 */ @@ -840,6 +855,7 @@ public function getName() { * Get a list of language files that have been loaded * * @param string $extension An option extension name + * * @return array * @since 11.1 */ @@ -868,7 +884,7 @@ public function getErrorFiles() } /** - * Get for the language tag (as defined in RFC 3066) + * Getter for the language tag (as defined in RFC 3066) * * @return string The language tag * @since 11.1 @@ -998,6 +1014,7 @@ public static function getMetadata($lang) * Returns a list of known languages for an area * * @param string $basePath The basepath to use + * * @return array key/value pair with the language file and real name * @since 11.1 */ @@ -1014,6 +1031,7 @@ public static function getKnownLanguages($basePath = JPATH_BASE) * * @param string $basePath The basepath to use * @param string $language The language tag + * * @return string language related path or null * @since 11.1 */ @@ -1032,6 +1050,7 @@ public static function getLanguagePath($basePath = JPATH_BASE, $language = null) * Once called, the language still needs to be loaded using JLanguage::load() * * @param string $lang Language code + * * @return string Previous value * @since 11.1 */ @@ -1095,6 +1114,7 @@ public static function _parseLanguageFiles($dir = null) * Searches for language directories within a certain base dir * * @param string $dir directory of files + * * @return array Array holding the found languages as filename => real name pairs * @since 11.1 */ @@ -1157,6 +1177,7 @@ public static function parseXMLLanguageFiles($dir = null) * Parse XML file for language information. * * @param string $path Path to the xml files + * * @return array Array holding the found metadata as a key => value pair * @deprecated use parseXMLLanguageFile instead * @since 11.1 @@ -1170,6 +1191,7 @@ public static function _parseXMLLanguageFile($path) * Parse XML file for language information. * * @param string $path Path to the xml files + * * @return array Array holding the found metadata as a key => value pair * @since 11.1 */ @@ -1194,4 +1216,3 @@ public static function parseXMLLanguageFile($path) return $metadata; } } - diff --git a/libraries/joomla/language/latin_transliterate.php b/libraries/joomla/language/latin_transliterate.php index eb216592df..d375310194 100644 --- a/libraries/joomla/language/latin_transliterate.php +++ b/libraries/joomla/language/latin_transliterate.php @@ -8,9 +8,31 @@ */ defined('JPATH_PLATFORM') or die; +/** + * @package Joomla.Platform + * @subpackage Language + * @static + * @since 11.1 + */ +/** + * Class to transliterate strings + * + * @static + * @package Joomla.Platform + * @subpackage Language + * @since 11.1 + */ class JLanguageTransliterate { + /** + * Returns strings transliterated from UTF-8 to Latin + * + * @param string $string + * @param boolean $case Optionally specify upper or lower case. Default to null. + * + * @return string transliterated string + */ static function utf8_latin_to_ascii( $string, $case=0 ){ static $UTF8_LOWER_ACCENTS = NULL;