1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-14 02:24:08 +02:00

Better routing/URL assembling, inline documentation, large number of fixes, news area improvements - should work flowless with every URL configuration. Awaiting testing results for more stability fixes.

This commit is contained in:
secretr
2011-11-30 15:14:02 +00:00
parent 076f03b696
commit 078816befe
12 changed files with 299 additions and 94 deletions

View File

@@ -105,6 +105,12 @@ $nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
$newsRoute = 'list/short';
break;
case 'day':
case 'month':
$newsUrlparms['id'] = $sub_action;
$newsRoute = 'list/'.$action;
break;
default:
$newsRoute = 'list/items';
break;
@@ -680,9 +686,10 @@ else
$param['current_action'] = $action;
// NEW - news category title when in list
if($sub_action && vartrue($newsAr[1]['category_name']))
if($sub_action && 'list' == $action && vartrue($newsAr[1]['category_name']))
{
$category_name = $newsAr[1]['category_name'];
// we know category name - pass it to the nexprev url
$category_name = $newsUrlparms['name'] = $newsAr[1]['category_name'];
if(!isset($NEWSLISTCATTITLE))
{
$NEWSLISTCATTITLE = "<h1 class='newscatlist-title'>".$tp->toHTML($category_name,FALSE,'TITLE')."</h1>";
@@ -717,6 +724,8 @@ else
$amount = ITEMVIEW;
$nitems = defined('NEWS_NEXTPREV_NAVCOUNT') ? '&navcount='.NEWS_NEXTPREV_NAVCOUNT : '' ;
$url = rawurlencode(e107::getUrl()->create($newsRoute, $newsUrlparms));
// Example of passing route data instead building the URL outside the shortcode - for a reference only
// $url = rawurlencode('url::'.$newsRoute.'::'.http_build_query($newsUrlparms, null, '&'));
$parms = 'tmpl_prefix='.deftrue('NEWS_NEXTPREV_TMPL', 'default').'&total='.$news_total.'&amount='.$amount.'&current='.$newsfrom.$nitems.'&url='.$url;
echo $tp->parseTemplate("{NEXTPREV={$parms}}");