public function __construct(\SS_List $list, $request = array()) { parent::__construct($list, $request); if (!$this->request->isAjax()) { $this->initRequirements(); } }
/** * Constructs a new paginated list instance around a list. * * @param SS_List $list The list to paginate. The getRange method will * be used to get the subset of objects to show. * @param int the default length of a page if none is set * @param array|ArrayAccess Either a map of request parameters or * request object that the pagination offset is read from. */ public function __construct(SS_List $list, $request = array(), $defaultLength = 0) { if (!is_array($request) && !$request instanceof ArrayAccess) { throw new Exception('The request must be readable as an array.'); } $this->request = $request; if (!$defaultLength) { $defaultLength = $this->getPageLength(); } if ($length = $this->request[$this->getLengthGetVar()]) { if ($length == $this->unlimitedLengthText) { $length = $this->unlimitedLength; } } else { $length = $defaultLength; } $this->setPageLength($length); parent::__construct($list, $request); }