- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/dbresult.php
- Класс: CAllDBResult
- Вызов: CAllDBResult::NavStart
public function NavStart($nPageSize = 0, $bShowAll = true, $iNumPage = false)
{
if ($this->bFromLimited)
{
return;
}
if (is_array($nPageSize))
{
$this->InitNavStartVars($nPageSize);
}
else
{
$this->InitNavStartVars(intval($nPageSize), $bShowAll, $iNumPage);
}
if ($this->bFromArray)
{
$this->NavRecordCount = count($this->arResult);
if ($this->NavRecordCount < 1)
{
return;
}
if ($this->NavShowAll)
{
$this->NavPageSize = $this->NavRecordCount;
}
$this->NavPageCount = floor($this->NavRecordCount / $this->NavPageSize);
if ($this->NavRecordCount % $this->NavPageSize > 0)
{
$this->NavPageCount++;
}
$useSession = (CPageOption::GetOptionString("main", "nav_page_in_session", "Y") == "Y");
$this->calculatePageNumber(1, $useSession);
$NavFirstRecordShow = $this->NavPageSize * ($this->NavPageNomer - 1);
$NavLastRecordShow = $this->NavPageSize * $this->NavPageNomer;
$this->arResult = array_slice($this->arResult, $NavFirstRecordShow, $NavLastRecordShow - $NavFirstRecordShow);
}
else
{
$this->DBNavStart();
}
}