import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
34
modules/news/views/scripts/index/index.phtml
Normal file
34
modules/news/views/scripts/index/index.phtml
Normal file
@ -0,0 +1,34 @@
|
||||
<?php if ($this->user->role == Users_Model_User::ROLE_ADMIN): ?>
|
||||
<div class="linksTopRightContainer">
|
||||
<h2><?php echo $this->translate('Latest News') ?></h2>
|
||||
<div class="linksTopRight">
|
||||
<a href="<?php echo $this->base ?>/news/edit/add"><?php echo $this->translate('Add New Article') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php if (count($this->paginator) == 0): ?>
|
||||
<div><?= $this->translate('There are no news articles yet') ?></div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($this->paginator as $article): ?>
|
||||
<div class="post">
|
||||
<h3><a href="<?php echo $this->base . '/news/' . $article->id ?>"><?php echo $article->title ?></a></h3>
|
||||
<div class="article_date">
|
||||
<?php echo $this->translate("Published on %s", $article->date) ?>
|
||||
</div>
|
||||
<p><?php echo $article->excerpt ?></p>
|
||||
<p class="more">
|
||||
<a href="<?php echo $this->base . '/news/' . $article->id ?>">
|
||||
<?php echo $this->translate('read more') ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif ?>
|
||||
<?php if ($this->paginator->count() > 1): ?>
|
||||
<?php echo $this->paginationControl($this->paginator,
|
||||
'Sliding',
|
||||
'index/pagination.phtml',
|
||||
array(
|
||||
'base' => $this->base
|
||||
)) ?>
|
||||
<?php endif ?>
|
36
modules/news/views/scripts/index/pagination.phtml
Normal file
36
modules/news/views/scripts/index/pagination.phtml
Normal file
@ -0,0 +1,36 @@
|
||||
<!--
|
||||
See http://developer.yahoo.com/ypatterns/pattern.php?pattern=searchpagination
|
||||
-->
|
||||
|
||||
<?php if ($this->pageCount): ?>
|
||||
<div class="paginationControl">
|
||||
<!-- Previous page link -->
|
||||
<?php if (isset($this->previous)): ?>
|
||||
<a href="<?php echo $this->base . '/news?page=' . $this->previous ?>">
|
||||
< <?php echo $this->translate('Previous') ?>
|
||||
</a> |
|
||||
<?php else: ?>
|
||||
<span class="disabled">< <?php echo $this->translate('Previous') ?></span> |
|
||||
<?php endif ?>
|
||||
|
||||
<!-- Numbered page links -->
|
||||
<?php foreach ($this->pagesInRange as $page): ?>
|
||||
<?php if ($page != $this->current): ?>
|
||||
<a href="<?php echo $this->base . '/news?page=' . $page ?>">
|
||||
<?php echo $page; ?>
|
||||
</a> |
|
||||
<?php else: ?>
|
||||
<?php echo $page; ?> |
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
<!-- Next page link -->
|
||||
<?php if (isset($this->next)): ?>
|
||||
<a href="<?php echo $this->base . '/news?page=' . $this->next ?>">
|
||||
<?php echo $this->translate('Next') ?> >
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<span class="disabled"><?php echo $this->translate('Next') ?> ></span>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
Reference in New Issue
Block a user