50 lines
1.7 KiB
PHTML
Executable File
50 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 (count($this->paginator)): ?>
|
|
<div id='metacontent'>
|
|
<hr />
|
|
<?php
|
|
$i=0;
|
|
foreach ($this->paginator as $item):
|
|
$i++;
|
|
if (mb_strlen($item['description'])>700)
|
|
{
|
|
$item['description'] = mb_substr($item['description'],0,400,'UTF-8').'...';
|
|
}
|
|
if($i%2==0) $style="style='background:#fafafa;'";
|
|
else $style="";
|
|
echo '<div class="mditem" '.$style.'>
|
|
<div class="thumb"><img src="/data/thumb/id/'.$item['id'].'" /></div>
|
|
<h2><a href="/data/'.$item['uuid'].'">'.$this->escape($item['title']).'</a>
|
|
</h2>
|
|
<p>'.$item['description'].'</p>
|
|
</div>';
|
|
endforeach;
|
|
?>
|
|
</div>
|
|
<?= $this->paginator; ?>
|
|
<?php endif; ?>
|