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');
unset($this->search_sess->page);
unset($this->search_sess->md);
$this->_helper->actionStack('contents', 'library');

View file

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

View file

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

View file

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