| [ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 /** 3 * The Horde_UI_Language:: class provides a widget for changing the 4 * currently selected language. 5 * 6 * $Horde: framework/UI/UI/Language.php,v 1.5.10.7 2006/06/20 09:08:45 jan Exp $ 7 * 8 * Copyright 2003-2006 Jason M. Felice <jfelice@cronosys.com> 9 * 10 * See the enclosed file COPYING for license information (LGPL). If you 11 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 12 * 13 * @since Horde_UI 0.0.1 14 * @package Horde_UI 15 */ 16 class Horde_UI_Language { 17 18 /** 19 * Render the language selection. 20 * 21 * @abstract 22 * 23 * @param boolean $form Return the selection box as an complete standalone 24 * form. 25 * 26 * @return string The HTML selection box. 27 */ 28 function render() 29 { 30 $html = ''; 31 if (!$GLOBALS['prefs']->isLocked('language')) { 32 Horde::addScriptFile('language.js', 'horde'); 33 $_SESSION['horde_language'] = NLS::select(); 34 $html = sprintf('<form name="language" action="%s">', 35 Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/language.php', false, -1)); 36 $html .= '<input type="hidden" name="url" value="' . @htmlspecialchars(Horde::selfUrl(false, false, true)) . '" />'; 37 $html .= '<select name="new_lang" onchange="document.language.submit()">'; 38 foreach ($GLOBALS['nls']['languages'] as $key => $val) { 39 $sel = ($key == $_SESSION['horde_language']) ? ' selected="selected"' : ''; 40 $html .= "<option value=\"$key\"$sel>$val</option>"; 41 } 42 $html .= '</select></form>'; 43 } 44 return $html; 45 } 46 47 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |