CC-1749 added pagination to media files display.

This commit is contained in:
naomiaro 2011-01-03 13:29:57 -05:00
parent ba85842fcd
commit cf4e784129
4 changed files with 58 additions and 48 deletions

View file

@ -32,6 +32,7 @@ class LibraryController extends Zend_Controller_Action
$this->_helper->layout->setLayout('library'); $this->_helper->layout->setLayout('library');
unset($this->search_sess->page);
unset($this->search_sess->md); unset($this->search_sess->md);
$this->_helper->actionStack('contents', 'library'); $this->_helper->actionStack('contents', 'library');

View file

@ -1841,7 +1841,7 @@ class StoredFile {
$paginate = " LIMIT ".$limit. " OFFSET " .$offset; $paginate = " LIMIT ".$limit. " OFFSET " .$offset;
$sql = $sql . $paginate; $sql = $sql . $paginate;
} }
echo $sql; //echo $sql;
return $CC_DBC->getAll($sql); return $CC_DBC->getAll($sql);
} }

View file

@ -22,9 +22,6 @@
<?php <?php
echo "page: " . $this->page;
echo "curr: " . $this->curr;
echo $this->paginationControl($this->paginator, echo $this->paginationControl($this->paginator,
'Sliding', 'Sliding',
'library/paginator.phtml'); 'library/paginator.phtml');

View file

@ -1,9 +1,11 @@
<p>
<?php if ($this->pageCount): ?> <?php if ($this->pageCount): ?>
<div class="paginationControl"> <div class="paginationControl">
<?php echo $this->firstItemNumber; ?> - <?php echo $this->lastItemNumber; ?> <?php echo $this->firstItemNumber; ?> - <?php echo $this->lastItemNumber; ?>
of <?php echo $this->totalItemCount; ?> of <?php echo $this->totalItemCount; ?>
</p>
<p>
<!-- First page link --> <!-- First page link -->
<?php if (isset($this->previous)): ?> <?php if (isset($this->previous)): ?>
<a href="<?php echo $this->url(array('page' => $this->first)); ?>"> <a href="<?php echo $this->url(array('page' => $this->first)); ?>">
@ -22,6 +24,15 @@ of <?php echo $this->totalItemCount; ?>
<span class="disabled">&lt; Previous</span> | <span class="disabled">&lt; Previous</span> |
<?php endif; ?> <?php endif; ?>
<!-- current pages links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($this->current != $page): ?>
<a href="<?php echo $this->url(array('page' => $page));?>"><?php echo $page; ?></a>
<?php else: ?>
<?php echo $page; ?>
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link --> <!-- Next page link -->
<?php if (isset($this->next)): ?> <?php if (isset($this->next)): ?>
<a href="<?php echo $this->url(array('page' => $this->next)); ?>"> <a href="<?php echo $this->url(array('page' => $this->next)); ?>">
@ -42,3 +53,4 @@ of <?php echo $this->totalItemCount; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</p>