From: <li...@us...> - 2013-03-30 23:20:31
|
Revision: 45362 http://sourceforge.net/p/tikiwiki/code/45362 Author: lindonb Date: 2013-03-30 23:20:28 +0000 (Sat, 30 Mar 2013) Log Message: ----------- [ENH] trackerlist parameter: Allow the url parameter tr_offset to be used. Helpful in allowing pagination for single tracker items displayed using a custom template Modified Paths: -------------- trunk/lib/core/Tracker/Field/Abstract.php Modified: trunk/lib/core/Tracker/Field/Abstract.php =================================================================== --- trunk/lib/core/Tracker/Field/Abstract.php 2013-03-30 21:30:17 UTC (rev 45361) +++ trunk/lib/core/Tracker/Field/Abstract.php 2013-03-30 23:20:28 UTC (rev 45362) @@ -52,8 +52,12 @@ 'class' => implode(' ', $classList), 'href' => $href, ); - if (!empty($context['url']) && strpos($context['url'], 'itemId') !== false) { - $context['url'] = preg_replace('/([&|\?])itemId=?[^&]*/', '\\1itemId=' . $itemId, $context['url']); + if (!empty($context['url'])) { + if (strpos($context['url'], 'itemId') !== false) { + $context['url'] = preg_replace('/([&|\?])itemId=?[^&]*/', '\\1itemId=' . $itemId, $context['url']); + } elseif (isset($context['reloff']) && strpos($context['url'], 'offset') !== false) { + $context['url'] = preg_replace('/([&|\?])tr_offset=?[^&]*/', '\\1tr_offset=' . $context['reloff'], $context['url']); + } $arguments['href'] = $context['url']; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |