Advertisement
Guest User

Untitled

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