Advertisement
Guest User

Untitled

a guest
Aug 26th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Controller code:
  2.  
  3. function PortfolioItems() {
  4. if (!isset($this->urlParams['Action']) || $this->urlParams['Action'] == 'All')
  5. $typeFilter = "";
  6. else
  7. $typeFilter = "AND `PortfolioPage`.ProjectType='" . $this->urlParams['Action'] . "'";
  8.  
  9. $records = PortfolioPage::get()->filter(array(
  10. "ParentID => $this->ID,
  11. ))->where($typeFilter)->limit(3);
  12.  
  13. return PaginatedList::create($records, $this->request);
  14.  
  15. }
  16.  
  17.  
  18. // template render:
  19.  
  20. <% if PortfolioItems.MoreThanOnePage %>
  21. <div class="pagination">
  22. <% if PortfolioItems.PrevLink %>
  23. <a href="$PortfolioItems.PrevLink"><span><img src="/themes/LittleMonkey2011/images/buttons/previous_off.png" id="previous" width="27" height="27" alt="previous" /></span></a>
  24. <% end_if %>
  25.  
  26. <% control PortfolioItems.Pages %>
  27. <% if CurrentBool %>
  28. <span><img src="/themes/XX/images/buttons/page{$PageNum}_on.png" id="page{$PageNum}" width="27" height="27" alt="page{$PageNum}" /></span>
  29. <% else %>
  30. <a href="$Link"><span><img src="/themes/XX/images/buttons/page{$PageNum}_off.png" id="page{$PageNum}" width="27" height="27" alt="page{$PageNum}" /></span></a>
  31. <% end_if %>
  32. <% end_control %>
  33. <% if PortfolioItems.NextLink %>
  34. <a href="$PortfolioItems.NextLink"><span><img src="/themes/XX/images/buttons/next_off.png" id="next" width="27" height="27" alt="next" /></span></a>
  35. <% end_if %>
  36. </div>
  37. <% end_if %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement