function _content() { if (empty($this->_params['location'])) { return _("No location is set."); } // Set the timezone variable, if available. NLS::setTimeZone(); list($lat, $long) = explode(':', $this->_params['location']); $rise = $this->_calculateSunset(time(), $lat, $long, false, floor(date('Z') / 3600)); $set = $this->_calculateSunset(time(), $lat, $long, true, floor(date('Z') / 3600)); $location = ''; global $coordinates; if (!is_array($coordinates)) { require HORDE_LIBS . 'Horde/NLS/coordinates.php'; } foreach ($coordinates as $country) { if (array_key_exists($this->_params['location'], $country)) { $location = $country[$this->_params['location']]; break; } } $html = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr>'; $html .= '<td colspan="2" class="control"><b>' . $location . '</b></td></tr><tr height="100%">'; $html .= '<td width="50%" align="center">'; $html .= Horde::img('block/sunrise/sunrise.gif', _("Sun Rise")); $html .= '<br/>' . $rise; $html .= '</td>'; $html .= '<td width="50%" align="center">'; $html .= Horde::img('block/sunrise/sunset.gif', _("Sun Set")); $html .= '<br/>' . $set; $html .= '</td>'; $html .= '</tr></table>'; return $html; }
/** * The content to go in this block. * * @return string The content */ function _content() { // Set the timezone variable, if available. NLS::setTimeZone(); $html = '<table width="100%" height="100%"><tr><td style="font-family:verdana;font-size:18px;" align="center" valign="center">'; $html .= strftime('%A, %B %d, %Y '); if ($this->_params['time'] == '24-hour') { $html .= strftime('%H:%M'); } else { $html .= strftime('%I:%M %p'); } $html .= '</td></tr></table>'; return $html; }