dataController的predispatch中添加导航信息,data/doi中引用breadcrumbs模板

This commit is contained in:
Li Jianxuan 2013-05-13 02:50:06 +00:00
parent 9268e8e35d
commit 114d7e315d
3 changed files with 18 additions and 8 deletions

View File

@ -11,6 +11,11 @@ class DataController extends Zend_Controller_Action
$this->view->messages = $this->messenger->getMessages(); $this->view->messages = $this->messenger->getMessages();
$this->view->theme = new Theme(); $this->view->theme = new Theme();
$this->view->main_nav_pageID = "data"; $this->view->main_nav_pageID = "data";
$this->view->nav = array(
array('link'=>'/','title'=>'<i class="icon-home"></i>'),
array('link'=>'/data','title'=>$this->view->config->title->data),
);
} }
function indexAction() function indexAction()
{ {

View File

@ -1,4 +1,11 @@
<?php <?php if(!empty($this->nav)){ ?>
echo implode(', ', array_map( <nav>
create_function('$a', 'return $a->getLabel();'), <ul class="breadcrumb">
$this->pages));?> <?php foreach ($this->nav as $k=>$v){?>
<li>
<a href="<?= $v['link'] ?>"><?= $v['title']?></a> <?php if(isset($this->nav[$k+1])) {?> <span class="divider">/</span> <?php } ?>
</li>
<?php } ?>
</ul>
</nav>
<?php } ?>

View File

@ -3,14 +3,12 @@ $this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data); $this->headTitle($this->config->title->data);
$this->headTitle('DOI浏览'); $this->headTitle('DOI浏览');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->breadcrumb('<a href="/">首页</a>'); $this->nav[] = array('link'=>"/data/doi",'title'=>'DOI浏览');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/data/doi">DOI浏览</a>');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'colorbox'); $this->theme->AppendPlus($this,'colorbox');
?> ?>
<div class='row-fluid'> <div class='row-fluid'>
<div><?= $this->breadcrumb() ?> </div> <?= $this->render('breadcrumbs.phtml') ?>
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml'); ?>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li id="Nav-doi-publish"><a href="/data/doi">已发布DOI的数据</a></li> <li id="Nav-doi-publish"><a href="/data/doi">已发布DOI的数据</a></li>