โค้ด: เลือกทั้งหมด
<?php echo $this->pagination->getPagesLinks(); ?>
Moderator: mindphp, ผู้ดูแลกระดาน
โค้ด: เลือกทั้งหมด
<?php echo $this->pagination->getPagesLinks(); ?>
โค้ด: เลือกทั้งหมด
function pagination_item_active(&$item)
{
$class = ' class="page-item"';
// Check for "Start" item
if ($item->text === JText::_('JLIB_HTML_START'))
{
$display = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M493.6 445c-11.2 5.3-24.5 3.6-34.1-4.4L288 297.7V416c0 12.4-7.2 23.7-18.4 29s-24.5 3.6-34.1-4.4L64 297.7V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V96C0 78.3 14.3 64 32 64s32 14.3 32 32V214.3L235.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S288 83.6 288 96V214.3L459.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S512 83.6 512 96V416c0 12.4-7.2 23.7-18.4 29z"/></svg>';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
}
// Check for "Prev" item
if ($item->text === JText::_('JPREV'))
{
$display = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3V256v41.7L459.5 440.6zM256 352V256 128 96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V352z"/></svg>';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
}
// Check for "Next" item
if ($item->text === JText::_('JNEXT'))
{
$display = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3V256v41.7L52.5 440.6zM256 352V256 128 96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29V352z"/></svg>';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
}
// Check for "End" item
if ($item->text === JText::_('JLIB_HTML_END'))
{
$display = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7V416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7V416c0 17.7 14.3 32 32 32s32-14.3 32-32V96c0-17.7-14.3-32-32-32s-32 14.3-32 32V214.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96V214.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96V416c0 12.4 7.2 23.7 18.4 29z"/></svg>';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
}
// If the display object isn't set already, just render the item with its text
if (!isset($display))
{
$display = $item->text;
$aria = JText::sprintf('JLIB_HTML_GOTO_PAGE', $item->text);
$class = ' class="page-item hidden-phone"';
}
return '<li' . $class . '><a title="' . $item->text . '" href="' . $item->link . '" class="page-link" aria-label="' . $aria . '">' . $display . '</a></li>';
}
/**
* Renders an inactive item in the pagination block
*
* @param JPaginationObject $item The current pagination object
*
* @return string HTML markup for inactive item
*
* @since 3.0
*/
function pagination_item_inactive(&$item)
{
// Check for "Start" item
if ($item->text === JText::_('JLIB_HTML_START'))
{
return '<li class="page-item disabled"><a class="page-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M493.6 445c-11.2 5.3-24.5 3.6-34.1-4.4L288 297.7V416c0 12.4-7.2 23.7-18.4 29s-24.5 3.6-34.1-4.4L64 297.7V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V96C0 78.3 14.3 64 32 64s32 14.3 32 32V214.3L235.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S288 83.6 288 96V214.3L459.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S512 83.6 512 96V416c0 12.4-7.2 23.7-18.4 29z"/></svg>
</a></li>';
}
// Check for "Prev" item
if ($item->text === JText::_('JPREV'))
{
return '<li class="page-item disabled"><a class="page-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3V256v41.7L459.5 440.6zM256 352V256 128 96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V352z"/></svg>
</a></li>';
}
// Check for "Next" item
if ($item->text === JText::_('JNEXT'))
{
return '<li class="page-item disabled"><a class="page-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3V256v41.7L52.5 440.6zM256 352V256 128 96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29V352z"/></svg>
</a></li>';
}
// Check for "End" item
if ($item->text === JText::_('JLIB_HTML_END'))
{
return '<li class="page-item disabled"><a class="page-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="10"><path d="M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7V416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7V416c0 17.7 14.3 32 32 32s32-14.3 32-32V96c0-17.7-14.3-32-32-32s-32 14.3-32 32V214.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96V214.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96V416c0 12.4 7.2 23.7 18.4 29z"/></svg>
</a></li>';
}
// Check if the item is the active page
if (isset($item->active) && $item->active)
{
$aria = JText::sprintf('JLIB_HTML_PAGE_CURRENT', $item->text);
return '<li class="page-item active hidden-phone"><a class="page-link" aria-current="true" aria-label="' . $aria . '">' . $item->text . '</a></li>';
}
// Doesn't match any other condition, render a normal item
return '<li class="page-item disabled hidden-phone"><a class="page-link">' . $item->text . '</a></li>';
}
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 98