westdc-zf1/application/default/views/scripts/metadata/timeline.phtml

87 lines
2.8 KiB
PHTML
Executable File

<?php
$config = Zend_Registry::get('config');
$this->headTitle($config->title->site);
$this->headTitle($config->title->metadata);
$this->headTitle('时间轴导航');
if (!empty($this->codename)) $this->headTitle($this->codename);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/metadata.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/metadata">数据产品与服务</a>');
$this->breadcrumb('<a href="/metadata/timeline">时间轴导航</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="http://westdc.westgis.ac.cn/css/default.css" media="screen" rel="stylesheet" type="text/css">
<?php
echo $this->headTitle();
echo $this->headLink();
?>
<script src="http://simile.mit.edu/timeline/api/timeline-api.js" type="text/javascript"></script>
<script>
var tl;
var date = "Nov 22 2007 13:00:00";
var theme = Timeline.ClassicTheme.create();
theme.event.label.width = 250; // px
theme.event.bubble.width = 250;
theme.event.bubble.height = 200;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();
var bandInfos = [
Timeline.createBandInfo({
width: "70%",
intervalUnit: Timeline.DateTime.MONTH,
eventSource: eventSource,
date: date,
intervalPixels: 100,
theme: theme
}),
Timeline.createBandInfo({
width: "30%",
intervalUnit: Timeline.DateTime.YEAR,
eventSource: eventSource,
date: date,
showEventText: false,
intervalPixels: 200,
theme:theme
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl = Timeline.create(document.getElementById("tl"), bandInfos);
tl.loadXML("/time.xml", function(xml, url) {
eventSource.loadXML(xml, url);
});
}
var resizeTimerID = null;
function onResize() {
if (resizeTimerID == null) {
resizeTimerID = window.setTimeout(function() {
resizeTimerID = null;
tl.layout();
}, 500);
}
}
</script>
</head>
<body onload="onLoad();" onresize="onResize();">
<?= $this->partial('header.phtml'); ?>
<div class="clearLine"/> </div>
<div id="divBreadCrumb"><?= $this->breadcrumb() ?> </div>
<div id='tools'><?= $this->partial('metadata/tools.phtml'); ?></div>
<div id="divContent"> </div>
<div id="tl" class="timeline-default" style="clear:left;height: 400px;"> </div>
<div class="clearLine"/> </div>
<?= $this->partial('footer.phtml'); ?>
</body>
</html>