protected function _initFrame()
 {
     if (!$this->helper->isActiveEngine()) {
         return parent::_initFrame();
     }
     if (!$this->isFrameInitialized()) {
         $start = 0;
         $end = 0;
         $lastPageNum = $this->getLastPageNum();
         $currentPage = $this->getCurrentPage();
         if ($lastPageNum <= $this->getFrameLength()) {
             $start = 1;
             $end = $lastPageNum;
         } else {
             $half = ceil($this->getFrameLength() / 2);
             if ($currentPage >= $half && $currentPage <= $lastPageNum - $half) {
                 $start = $currentPage - $half + 1;
                 $end = $start + $this->getFrameLength() - 1;
             } elseif ($currentPage < $half) {
                 $start = 1;
                 $end = $this->getFrameLength();
             } elseif ($currentPage > $lastPageNum - $half) {
                 $end = $lastPageNum;
                 $start = $end - $this->getFrameLength() + 1;
             }
         }
         $this->_frameStart = $start;
         $this->_frameEnd = $end;
         $this->_setFrameInitialized(true);
     }
     return $this;
 }