/** * Flatten an array, using the content language for any messages. * * @param array $vals Array of values * @param string $type Type of array (either lang, ul, ol). * lang = language assoc array with keys being the lang code * ul = unordered list, ol = ordered list * type can also come from the '_type' member of $vals. * @param bool $noHtml If to avoid returning anything resembling HTML. * (Ugly hack for backwards compatibility with old MediaWiki). * @param bool|IContextSource $context * @return string Single value (in wiki-syntax). * @since 1.23 */ public static function flattenArrayContentLang($vals, $type = 'ul', $noHtml = false, $context = false) { global $wgContLang; $obj = new FormatMetadata(); if ($context) { $obj->setContext($context); } $context = new DerivativeContext($obj->getContext()); $context->setLanguage($wgContLang); $obj->setContext($context); return $obj->flattenArrayReal($vals, $type, $noHtml); }
/** * Flatten an array, using the user language for any messages. * * @param array $vals Array of values * @param string $type Type of array (either lang, ul, ol). * lang = language assoc array with keys being the lang code * ul = unordered list, ol = ordered list * type can also come from the '_type' member of $vals. * @param bool $noHtml If to avoid returning anything resembling HTML. * (Ugly hack for backwards compatibility with old MediaWiki). * @param bool|IContextSource $context * @return string Single value (in wiki-syntax). */ public static function flattenArray($vals, $type = 'ul', $noHtml = false, $context = false) { $obj = new FormatMetadata(); if ($context) { $obj->setContext($context); } return $obj->flattenArrayReal($vals, $type, $noHtml); }