indexmobile.php
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php if($this->view->isAjax):?>
<div id="news_page" total="<?php echo $this->view->total;?>" page="<?php echo $this->view->page;?>">
<?php $this->_widget('news_listmobile', array('list'=> $this->view->list));?>
</div>
<?php else:?>
<?php $this->_extends('layout/default_layout_mobile');?>
<?php $this->_block('main');?>
<div class="news-select">
<select>
<?php
array_unshift($this->view->tags, array('tag' => '', 'num'=> $this->view->total));
foreach ($this->view->tags as $tag): if(empty($tag['num'])) continue;?>
<option value ="<?php echo url('news/index',array('tag' => $tag['tag']))?>"
<?php echo ($this->view->current_tag == $tag['tag']) ?'selected':''?>>
<?php echo sprintf("%s(%s)", $tag['tag'] == '' ? '全部资讯': $tag['tag'], $tag['num']); ?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="news-main content-main current">
<div class="news-content">
<div class="main-layout clearfix" total="<?php echo $this->view->pageTotal;?>" page="<?php echo $this->view->page;?>"
client="<?php echo $this->view->client;?>" total_times="3" current_tag="<?php echo $this->view->current_tag;?>" limit="<?php echo $this->view->limit;?>">
<?php $this->_widget('news_listmobile', array('list'=> $this->view->list));?>
</div>
</div>
</div>
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<script type="text/javascript">
seajs.use("mobile", function(mobile)
{
mobile.news();
});
</script>
<?php $this->_endblock();?>
<?php endif;?>