*/
public function render($arEvents)
{
+ $links = '';
+ if (isset($_SERVER['HTTP_HOST'])) {
+ if (!isset($_SERVER['REQUEST_SCHEME'])) {
+ $_SERVER['REQUEST_SCHEME'] = 'http';
+ }
+ $links = ' <link rel="alternate" type="text/calendar" href="'
+ . $_SERVER['REQUEST_SCHEME'] . '://'
+ . $_SERVER['HTTP_HOST']
+ . preg_replace('#\?.+$#', '', $_SERVER['REQUEST_URI'])
+ . '?renderer=ical'
+ . '"/>'
+ . "\n";
+ $links .= ' <link rel="alternate" type="text/plain" href="'
+ . $_SERVER['REQUEST_SCHEME'] . '://'
+ . $_SERVER['HTTP_HOST']
+ . preg_replace('#\?.+$#', '', $_SERVER['REQUEST_URI'])
+ . '?renderer=console'
+ . '"/>'
+ . "\n";
+ }
+
$tr = new Renderer_HtmlTable();
$table = $tr->render($arEvents);
+ $css = static::getCss();
$s = <<<HTM
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head>
<title>bdrem</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <style type="text/css">
+$links <style type="text/css">$css</style>
+ </head>
+ <body>
+$table
+ </body>
+</html>
+HTM;
+ return $s;
+ }
+
+ /**
+ * Get the CSS for the HTML table
+ */
+ public static function getCss()
+ {
+ return <<<CSS
table {
border: 1px solid black;
border-collapse: collapse;
tr.d3 td.icon:before {
content: "\342\227\224"
}
- </style>
- </head>
- <body>
-$table
- </body>
-</html>
-HTM;
- return $s;
+CSS;
}
}
?>