1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
reversepagenavigation.php
См. документацию.
1
<?php
8
namespace
Bitrix\Main\UI;
9
10
class
ReversePageNavigation
extends
PageNavigation
11
{
16
public
function
__construct
(
$id
,
$count
)
17
{
18
parent::__construct(
$id
);
19
$this->
setRecordCount
(
$count
);
20
}
21
26
public
function
getPageCount
()
27
{
28
if
($this->allRecords)
29
{
30
return
1;
31
}
32
$maxPages = (int)floor($this->recordCount/$this->pageSize);
33
if
($this->recordCount > 0 && $maxPages == 0)
34
{
35
$maxPages = 1;
36
}
37
return
$maxPages;
38
}
39
44
public
function
getCurrentPage
()
45
{
46
if
($this->currentPage !==
null
)
47
{
48
return
$this->currentPage
;
49
}
50
return
$this->
getPageCount
();
51
}
52
57
public
function
getOffset
()
58
{
59
if
($this->allRecords)
60
{
61
return
0;
62
}
63
64
$offset = 0;
65
$pageCount = $this->
getPageCount
();
66
$currentPage
= $this->
getCurrentPage
();
67
68
if
(
$currentPage <>
$pageCount)
69
{
70
//counting the last page (wich is the first one on reverse paging)
71
$offset += ($this->recordCount %
$this->pageSize
);
72
}
73
74
$offset += ($pageCount -
$currentPage
) * $this->pageSize;
75
76
return
$offset;
77
}
78
83
public
function
getLimit
()
84
{
85
if
($this->allRecords)
86
{
87
return
$this->
getRecordCount
();
88
}
89
if
($this->
getCurrentPage
() == $this->
getPageCount
())
90
{
91
//the last page (displayed first)
92
return
$this->pageSize + ($this->recordCount %
$this->pageSize
);
93
}
94
else
95
{
96
return
$this->pageSize
;
97
}
98
}
99
}
$count
$count
Определения
admin_tab.php:4
Bitrix\Main\UI\PageNavigation
Определения
pagenavigation.php:27
Bitrix\Main\UI\PageNavigation\getRecordCount
getRecordCount()
Определения
pagenavigation.php:192
Bitrix\Main\UI\PageNavigation\setRecordCount
setRecordCount($n)
Определения
pagenavigation.php:182
Bitrix\Main\UI\PageNavigation\$pageSize
$pageSize
Определения
pagenavigation.php:30
Bitrix\Main\UI\PageNavigation\$id
$id
Определения
pagenavigation.php:28
Bitrix\Main\UI\PageNavigation\$currentPage
$currentPage
Определения
pagenavigation.php:32
Bitrix\Main\UI\ReversePageNavigation
Определения
reversepagenavigation.php:11
Bitrix\Main\UI\ReversePageNavigation\__construct
__construct($id, $count)
Определения
reversepagenavigation.php:16
Bitrix\Main\UI\ReversePageNavigation\getCurrentPage
getCurrentPage()
Определения
reversepagenavigation.php:44
Bitrix\Main\UI\ReversePageNavigation\getPageCount
getPageCount()
Определения
reversepagenavigation.php:26
Bitrix\Main\UI\ReversePageNavigation\getLimit
getLimit()
Определения
reversepagenavigation.php:83
Bitrix\Main\UI\ReversePageNavigation\getOffset
getOffset()
Определения
reversepagenavigation.php:57
bitrix
modules
main
lib
ui
reversepagenavigation.php
Создано системой
1.14.0