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
60c317ca
Commit
60c317ca
authored
Aug 15, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring pagination class.
parent
20186dca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
paginator.php
system/paginator.php
+4
-15
No files found.
system/paginator.php
View file @
60c317ca
...
...
@@ -116,22 +116,11 @@ class Paginator {
{
if
(
$this
->
last_page
<=
1
)
return
''
;
return
'<div class="pagination">'
.
$this
->
previous
()
.
$this
->
numbers
(
$adjacent
)
.
$this
->
next
()
.
'</div>'
;
}
/**
* Generate the HTML numeric page links.
*
* If there are not enough pages to make it worth sliding, all of the pages will be listed.
*
* @param int $adjacent
* @return string
*/
private
function
numbers
(
$adjacent
=
3
)
{
// The hard-coded "7" is to account for all of the constant elements in a sliding range.
// Namely: The the current page, the two ellipses, the two beginning pages, and the two ending pages.
return
(
$this
->
last_page
<
7
+
(
$adjacent
*
2
))
?
$this
->
range
(
1
,
$this
->
last_page
)
:
$this
->
slider
(
$adjacent
);
$numbers
=
(
$this
->
last_page
<
7
+
(
$adjacent
*
2
))
?
$this
->
range
(
1
,
$this
->
last_page
)
:
$this
->
slider
(
$adjacent
);
return
'<div class="pagination">'
.
$this
->
previous
()
.
$numbers
.
$this
->
next
()
.
'</div>'
;
}
/**
...
...
@@ -246,7 +235,7 @@ class Paginator {
$append
.=
'&'
.
$key
.
'='
.
$value
;
}
return
HTML
::
link
(
Request
::
uri
()
.
'?page='
.
$page
.
$append
,
$text
,
array
(
'class'
=>
$class
),
Request
::
is_secure
());
return
HTML
::
link
(
Request
::
uri
()
.
'?page='
.
$page
.
$append
,
$text
,
compact
(
'class'
),
Request
::
is_secure
());
}
/**
...
...
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