[ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 3 $block_name = _("Current Time"); 4 5 /** 6 * $Horde: horde/lib/Block/time.php,v 1.16 2004/11/23 15:17:53 chuck Exp $ 7 * 8 * @package Horde_Block 9 */ 10 class Horde_Block_Horde_time extends Horde_Block { 11 12 var $_app = 'horde'; 13 14 function _params() 15 { 16 return $params = array('time' => array('type' => 'enum', 17 'name' => _("Time format"), 18 'default' => '24-hour', 19 'values' => array('24-hour' => _("24 Hour Format"), 20 '12-hour' => _("12 Hour Format")))); 21 } 22 23 /** 24 * The title to go in this block. 25 * 26 * @return string The title text. 27 */ 28 function _title() 29 { 30 return _("Current Time"); 31 } 32 33 /** 34 * The content to go in this block. 35 * 36 * @return string The content 37 */ 38 function _content() 39 { 40 if (empty($this->_params['time'])) { 41 $this->_params['time'] = '24-hour'; 42 } 43 44 // Set the timezone variable, if available. 45 NLS::setTimeZone(); 46 47 $html = '<table width="100%" height="100%"><tr><td style="font-family:verdana;font-size:18px;" align="center" valign="middle">'; 48 $html .= strftime('%A, %B %d, %Y '); 49 if ($this->_params['time'] == '24-hour') { 50 $html .= strftime('%H:%M'); 51 } else { 52 $html .= strftime('%I:%M %p'); 53 } 54 $html .= '</td></tr></table>'; 55 56 return $html; 57 } 58 59 }
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 |