Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
58e6a729
Commit
58e6a729
authored
Oct 23, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #991 for gridview summary, use ITU message format
parent
cfc57c20
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
BaseListView.php
framework/yii/widgets/BaseListView.php
+13
-11
No files found.
framework/yii/widgets/BaseListView.php
View file @
58e6a729
...
@@ -131,30 +131,32 @@ abstract class BaseListView extends Widget
...
@@ -131,30 +131,32 @@ abstract class BaseListView extends Widget
public
function
renderSummary
()
public
function
renderSummary
()
{
{
$count
=
$this
->
dataProvider
->
getCount
();
$count
=
$this
->
dataProvider
->
getCount
();
if
((
$pagination
=
$this
->
dataProvider
->
getPagination
())
!==
false
&&
$count
>
0
)
{
if
((
$pagination
=
$this
->
dataProvider
->
getPagination
())
!==
false
)
{
$totalCount
=
$this
->
dataProvider
->
getTotalCount
();
$totalCount
=
$this
->
dataProvider
->
getTotalCount
();
$begin
=
$pagination
->
getPage
()
*
$pagination
->
pageSize
+
1
;
$begin
=
$pagination
->
getPage
()
*
$pagination
->
pageSize
+
1
;
$end
=
$begin
+
$count
-
1
;
$end
=
$begin
+
$count
-
1
;
$page
=
$pagination
->
getPage
()
+
1
;
$page
=
$pagination
->
getPage
()
+
1
;
$pageCount
=
$pagination
->
pageCount
;
$pageCount
=
$pagination
->
pageCount
;
if
((
$summaryContent
=
$this
->
summary
)
===
null
)
{
if
((
$summaryContent
=
$this
->
summary
)
===
null
)
{
$summaryContent
=
'<div class="summary">'
.
Yii
::
t
(
'yii'
,
'Showing <b>{begin}-{end}</b> of <b>{totalCount}</b> {0, plural, =1{item} other{items}}.'
,
$totalCount
)
.
'</div>'
;
$summaryContent
=
'<div class="summary">'
.
Yii
::
t
(
'yii'
,
'Showing <b>{totalCount, plural, =0{0} other{{begin}-{end}}}</b> of <b>{totalCount}</b> {totalCount, plural, one{item} other{items}}.'
)
.
'</div>'
;
}
}
}
else
{
}
else
{
$begin
=
$page
=
$pageCount
=
1
;
$begin
=
$page
=
$pageCount
=
1
;
$end
=
$totalCount
=
$count
;
$end
=
$totalCount
=
$count
;
if
((
$summaryContent
=
$this
->
summary
)
===
null
)
{
if
((
$summaryContent
=
$this
->
summary
)
===
null
)
{
$summaryContent
=
'<div class="summary">'
.
Yii
::
t
(
'yii'
,
'Total <b>{count}</b> {
0, plural, =1{item} other{items}}.'
,
$count
)
.
'</div>'
;
$summaryContent
=
'<div class="summary">'
.
Yii
::
t
(
'yii'
,
'Total <b>{count}</b> {
count, plural, one{item} other{items}}.'
)
.
'</div>'
;
}
}
}
}
return
strtr
(
$summaryContent
,
[
return
Yii
::
$app
->
getI18n
()
->
format
(
$summaryContent
,
[
'
{begin}
'
=>
$begin
,
'
begin
'
=>
$begin
,
'
{end}
'
=>
$end
,
'
end
'
=>
$end
,
'
{count}
'
=>
$count
,
'
count
'
=>
$count
,
'
{totalCount}
'
=>
$totalCount
,
'
totalCount
'
=>
$totalCount
,
'
{page}
'
=>
$page
,
'
page
'
=>
$page
,
'
{pageCount}
'
=>
$pageCount
,
'
pageCount
'
=>
$pageCount
,
]);
]
,
Yii
::
$app
->
language
);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment