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,44 +1,56 @@
<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>
<!-- First page link -->
<?php if (isset($this->previous)): ?> <p>
<a href="<?php echo $this->url(array('page' => $this->first)); ?>"> <!-- First page link -->
First <?php if (isset($this->previous)): ?>
</a> | <a href="<?php echo $this->url(array('page' => $this->first)); ?>">
<?php else: ?> First
<span class="disabled">First</span> | </a> |
<?php endif; ?> <?php else: ?>
<span class="disabled">First</span> |
<!-- Previous page link --> <?php endif; ?>
<?php if (isset($this->previous)): ?>
<a href="<?php echo $this->url(array('page' => $this->previous)); ?>"> <!-- Previous page link -->
&lt; Previous <?php if (isset($this->previous)): ?>
</a> | <a href="<?php echo $this->url(array('page' => $this->previous)); ?>">
<?php else: ?> &lt; Previous
<span class="disabled">&lt; Previous</span> | </a> |
<?php endif; ?> <?php else: ?>
<span class="disabled">&lt; Previous</span> |
<!-- Next page link --> <?php endif; ?>
<?php if (isset($this->next)): ?>
<a href="<?php echo $this->url(array('page' => $this->next)); ?>"> <!-- current pages links -->
Next &gt; <?php foreach ($this->pagesInRange as $page): ?>
</a> | <?php if ($this->current != $page): ?>
<?php else: ?> <a href="<?php echo $this->url(array('page' => $page));?>"><?php echo $page; ?></a>
<span class="disabled">Next &gt;</span> | <?php else: ?>
<?php endif; ?> <?php echo $page; ?>
<?php endif; ?>
<!-- Last page link --> <?php endforeach; ?>
<?php if (isset($this->next)): ?>
<a href="<?php echo $this->url(array('page' => $this->last)); ?>"> <!-- Next page link -->
Last <?php if (isset($this->next)): ?>
</a> <a href="<?php echo $this->url(array('page' => $this->next)); ?>">
<?php else: ?> Next &gt;
<span class="disabled">Last</span> </a> |
<?php endif; ?> <?php else: ?>
<span class="disabled">Next &gt;</span> |
</div> <?php endif; ?>
<?php endif; ?>
<!-- Last page link -->
<?php if (isset($this->next)): ?>
<a href="<?php echo $this->url(array('page' => $this->last)); ?>">
Last
</a>
<?php else: ?>
<span class="disabled">Last</span>
<?php endif; ?>
</div>
<?php endif; ?>
</p>