Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Yeray Santana Hualde
syncEnrollments
Commits
f7f79030
Commit
f7f79030
authored
Jul 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added lang method to Paginator.
parent
be2b7fec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
paginator.php
system/paginator.php
+25
-9
No files found.
system/paginator.php
View file @
f7f79030
...
...
@@ -37,6 +37,13 @@ class Paginator {
*/
public
$last_page
;
/**
* The language being used by the paginator.
*
* @var string
*/
public
$language
;
/**
* Create a new Paginator instance.
*
...
...
@@ -81,14 +88,13 @@ class Paginator {
* Create the HTML pagination links.
*
* @param int $adjacent
* @param string $language
* @return string
*/
public
function
links
(
$adjacent
=
3
,
$language
=
null
)
public
function
links
(
$adjacent
=
3
)
{
if
(
$this
->
last_page
()
>
1
)
{
return
'<div class="pagination">'
.
$this
->
previous
(
$language
)
.
$this
->
numbers
(
$adjacent
)
.
$this
->
next
(
$language
);
return
'<div class="pagination">'
.
$this
->
previous
(
)
.
$this
->
numbers
(
$adjacent
)
.
$this
->
next
(
);
}
return
''
;
...
...
@@ -139,12 +145,11 @@ class Paginator {
/**
* Generate the "previous" HTML link.
*
* @param string $language
* @return string
*/
public
function
previous
(
$language
=
null
)
public
function
previous
()
{
$text
=
Lang
::
line
(
'pagination.previous'
)
->
get
(
$
language
,
'« Previous'
);
$text
=
Lang
::
line
(
'pagination.previous'
)
->
get
(
$
this
->
language
);
if
(
$this
->
page
>
1
)
{
...
...
@@ -157,12 +162,11 @@ class Paginator {
/**
* Generate the "next" HTML link.
*
* @param string $language
* @return string
*/
public
function
next
(
$language
=
null
)
public
function
next
()
{
$text
=
Lang
::
line
(
'pagination.next'
)
->
get
(
$
language
,
'Next »'
);
$text
=
Lang
::
line
(
'pagination.next'
)
->
get
(
$
this
->
language
);
if
(
$this
->
page
<
$this
->
last_page
())
{
...
...
@@ -223,4 +227,16 @@ class Paginator {
return
$pages
;
}
/**
* Set the paginator language.
*
* @param string $language
* @return Paginator
*/
public
function
lang
(
$language
)
{
$this
->
language
=
$language
;
return
$this
;
}
}
\ No newline at end of file
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