mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Remove trailing whitespace
This commit is contained in:
parent
3b0030e82b
commit
a9f72a5cd2
81 changed files with 2455 additions and 2455 deletions
|
|
@ -12,10 +12,10 @@ class Pagination
|
|||
*/
|
||||
const COUNT_STYLE_NORMAL = 1;
|
||||
const COUNT_STYLE_CONTINUOUS = 2;
|
||||
|
||||
|
||||
/**
|
||||
* Calculate the number of pages.
|
||||
*
|
||||
*
|
||||
* @param int $total_items
|
||||
* @param int $items_per_page
|
||||
* @param int $minimum (optional)
|
||||
|
|
@ -32,10 +32,10 @@ class Pagination
|
|||
return (int)max($minimum, ceil($total_items / $items_per_page));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create HTML for pagination.
|
||||
*
|
||||
*
|
||||
* @param string $base_url ($PAGE will be replaced with the page number)
|
||||
* @param int $current_page
|
||||
* @param int $total_pages
|
||||
|
|
@ -47,7 +47,7 @@ class Pagination
|
|||
$current_page = (int)$current_page;
|
||||
$total_pages = (int)$total_pages;
|
||||
$count = (int)$count;
|
||||
|
||||
|
||||
// Determine the range of pages to show.
|
||||
if ($count_style === self::COUNT_STYLE_NORMAL)
|
||||
{
|
||||
|
|
@ -72,10 +72,10 @@ class Pagination
|
|||
$first_shown = max(1, $last_shown - $count + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Open the <div> tag.
|
||||
$return = array('<div class="pagination">');
|
||||
|
||||
|
||||
// Compose the link to the first page.
|
||||
if ($first_shown > 1)
|
||||
{
|
||||
|
|
@ -87,11 +87,11 @@ class Pagination
|
|||
{
|
||||
$target_url = $base_url . 1;
|
||||
}
|
||||
|
||||
|
||||
$return[] = self::_composeLink($target_url, '<span class="arrow">«</span> <span class="page_number first_page">1</span>');
|
||||
$return[] = '<span class="ellipsis">...</span>';
|
||||
}
|
||||
|
||||
|
||||
// Compose links for each page.
|
||||
for ($page = $first_shown; $page <= $last_shown; $page++)
|
||||
{
|
||||
|
|
@ -103,7 +103,7 @@ class Pagination
|
|||
{
|
||||
$opening_span = '<span class="page_number">';
|
||||
}
|
||||
|
||||
|
||||
if (strpos($base_url, '$PAGE') !== false)
|
||||
{
|
||||
$target_url = str_replace('$PAGE', $page, $base_url);
|
||||
|
|
@ -112,10 +112,10 @@ class Pagination
|
|||
{
|
||||
$target_url = $base_url . $page;
|
||||
}
|
||||
|
||||
|
||||
$return[] = self::_composeLink($target_url, $opening_span . $page . '</span>');
|
||||
}
|
||||
|
||||
|
||||
// Compose the link to the last page.
|
||||
if ($last_shown < $total_pages)
|
||||
{
|
||||
|
|
@ -127,21 +127,21 @@ class Pagination
|
|||
{
|
||||
$target_url = $base_url . $total_pages;
|
||||
}
|
||||
|
||||
|
||||
$return[] = '<span class="ellipsis">...</span>';
|
||||
$return[] = self::_composeLink($target_url, '<span class="page_number last_page">' . $total_pages . '</span> <span class="arrow">»</span>');
|
||||
}
|
||||
|
||||
|
||||
// Close the <div> tag.
|
||||
$return[] = '</div>';
|
||||
|
||||
|
||||
// Return the completed HTML.
|
||||
return implode(' ', $return);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Link creation subroutine.
|
||||
*
|
||||
*
|
||||
* @param string $target_url
|
||||
* @param string $content
|
||||
* @return string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue