From: Michael M Slusarz Date: Wed, 24 Nov 2010 15:35:03 +0000 (-0700) Subject: Bug #9404: Fix flag image generation X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b365696169bbf17dfa8fbf45ce5a344259ebb40c;p=horde.git Bug #9404: Fix flag image generation --- diff --git a/framework/Core/lib/Horde/Core/Ui/FlagImage.php b/framework/Core/lib/Horde/Core/Ui/FlagImage.php index 17f8bef24..cff7b916e 100644 --- a/framework/Core/lib/Horde/Core/Ui/FlagImage.php +++ b/framework/Core/lib/Horde/Core/Ui/FlagImage.php @@ -16,12 +16,11 @@ class Horde_Core_Ui_FlagImage { /** - * Render the language selection. + * Generate a flag image tag. * - * @param boolean $form Return the selection box as a complete standalone - * form. + * @param string $host The hostname. * - * @return string The HTML selection box. + * @return string An HTML IMG tag (or empty if host is not found). */ static public function generateFlagImageByHost($host) { @@ -30,9 +29,10 @@ class Horde_Core_Ui_FlagImage return ''; } - $img = $data['code'] . '.png'; - return file_exists($GLOBALS['registry']->get('themesfs', 'horde') . '/graphics/flags/' . $img) - ? Horde::img('flags/' . $img, $data['name'], array('title' => $data['name'])) + $img = strval(Horde::img('flags/' . $data['code'] . '.png', $data['name'], array('title' => $data['name']))); + + return $img + ? $img : '[' . $data['name'] . ']'; }