westdc-zf1/application/default/views/scripts/data/category.phtml

43 lines
1.7 KiB
PHTML
Executable File

<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$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="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/data/category">分类浏览</a>');
if (!empty($this->codename)) $this->breadcrumb($this->codename);
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='tools'>
<?= $this->partial('data/tools.phtml'); ?>
</div>
<div id='leftnav'>
<fieldset><legend>数据集类别</legend>
<ul>
<?php foreach($this->category as $cg) : ?>
<li><a href='/data/category/code/<?php echo $cg['code']; ?>'><?php (empty($cg['name_zh']))?print($cg['name']):print($cg['name_zh']); ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
<?php endforeach; ?>
</ul></fieldset>
</div>
<?php if (!empty($this->metadata)) : ?>
<div id='metacontent'>
<h1>当前浏览:<?php echo $this->codename; ?></h1>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) : ?>
<div class="mditem">
<div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a>
</h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>
</div>
<?php endforeach; ?>
<?php echo $this->page->getNavigation(); ?>
</div>
<?php endif; ?>