添加文档报告、专利与著作权支持;archive类中支持获取内容

This commit is contained in:
wlx 2012-11-30 18:16:06 +00:00
parent a673040e9a
commit 1954ce79ac
4 changed files with 102 additions and 12 deletions

View File

@ -75,7 +75,11 @@ class AboutController extends Zend_Controller_Action
$sth = $this->db->prepare($sql);
$sth->execute(array($siteid));
$rows = $sth->fetchAll();
} elseif ($ac=='patent' || $ac=='report') {
$archives=new Archive($this->db);
$rows=$archives->getArchive($ac);
$this->_helper->viewRenderer($ac);
}
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(10);
@ -83,7 +87,4 @@ class AboutController extends Zend_Controller_Action
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
}
}
}

View File

@ -0,0 +1,41 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('成果发表');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/about.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/about">关于本站</a>');
$this->breadcrumb('<a href="/about/publication">成果发表</a>');
$this->breadcrumb('专利与著作权');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('about/navi.phtml'); ?>
</div>
</div>
<div id="content">
<h2>成果发表</h2>
<div id="tabs-controller">
<ul>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/">期刊文章</a></li>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/ac/report">文档报告</a></li>
<li class="box-shadow active"><a class="text-shadow" href="/about/publication/ac/patent">专利与著作权</a></li>
</ul>
</div>
<div id="datalist">
<?php if (count($this->paginator)): ?>
<ul>
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['title']; ?>
<?php if (!empty($ref->link)) :
echo ' <a href="'.$ref->link.'">下载</a>';
endif;
?>
</li>
<?php endforeach; ?>
</ul>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,41 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('成果发表');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/about.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/about">关于本站</a>');
$this->breadcrumb('<a href="/about/publication">成果发表</a>');
$this->breadcrumb('文档报告');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('about/navi.phtml'); ?>
</div>
</div>
<div id="content">
<h2>成果发表</h2>
<div id="tabs-controller">
<ul>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/">期刊文章</a></li>
<li class="box-shadow active"><a class="text-shadow" href="/about/publication/ac/report">文档报告</a></li>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/ac/patent">专利与著作权</a></li>
</ul>
</div>
<div id="datalist">
<?php if (count($this->paginator)): ?>
<ul>
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['title']; ?>
<?php if (!empty($ref->link)) :
echo ' <a href="'.$ref->link.'">下载</a>';
endif;
?>
</li>
<?php endforeach; ?>
</ul>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>
</div>

View File

@ -221,4 +221,11 @@ class Archive
return true;
}//DeleteTags
function getArchive($code='')
{
$sql="select * from ".$this->tbl_archives;
if (!empty($code)) $sql.=" where code='".$code."'";
$rs=$this->db->query($sql);
$rows=$rs->fetchAll();
}
}