1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 00:41:52 +02:00

Fixied missing legacy route list/all

This commit is contained in:
secretr
2012-07-18 06:13:16 +00:00
parent e8f701dc47
commit 2b57902e68
5 changed files with 20 additions and 1 deletions

View File

@@ -30,7 +30,8 @@ class core_news_sef_full_url extends eUrlConfig
'/' => array('list/items', 'allowVars' => array('page'), 'legacyQuery' => 'default.0.{page}', ),
'Category' => array('list/items', 'allowVars' => array('page'), 'legacyQuery' => 'default.0.{page}', ),
'Category/<name:{sefsecure}>' => array('list/category', 'allowVars' => array('page'), 'mapVars' => array('category_sef' => 'name'), 'legacyQuery' => 'list.{name}.{page}', 'parseCallback' => 'categoryIdByTitle'),
'All' => array('list/all', 'allowVars' => array('page'), 'legacyQuery' => 'all.0.{page}'),
'Short/<name:{sefsecure}>' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_sef' => 'name'), 'legacyQuery' => 'cat.{name}.{page}', 'parseCallback' => 'categoryIdByTitle'),
'Short/<id:{number}>' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_id' => 'id'), 'legacyQuery' => 'cat.{id}.{page}'),
'Day/<id:{number}>' => array('list/day', 'allowVars' => array('page'), 'legacyQuery' => 'day.{id}.{page}'),

View File

@@ -89,6 +89,11 @@ class core_news_sef_noid_url extends eUrlConfig
$r[0] = '';
if($page) $parm = array('page' => $page); // news?page=xxx
break;
case 'all':
$r[0] = 'All';
if($page) $parm = array('page' => $page); // news/All?page=xxx
break;
case 'category':
case 'short':

View File

@@ -80,6 +80,9 @@ class core_news_sef_url extends eUrlConfig
// 'View/<name:{sefsecure}>' => array('view/item', 'mapVars' => array('news_sef' => 'name', 'news_id' => 'id'), 'legacyQuery' => 'extend.{name}', 'parseCallback' => 'itemIdByTitle'),
// 'View/<id:{number}>' => array('view/item', 'mapVars' => array('news_id' => 'id'), 'legacyQuery' => 'extend.{id}'),
## All news
'All' => array('list/all', 'allowVars' => array('page'), 'legacyQuery' => 'all.0.{page}'),
## URL with ID and Title - no DB call, balanced performance!
'Short/<id:{number}>/<name:{sefsecure}>' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_id' => 'id', 'category_sef' => 'name'), 'legacyQuery' => 'cat.{id}.{page}'),
## fallback when name is not provided

View File

@@ -129,6 +129,10 @@ class core_news_url extends eUrlConfig
if(!vartrue($params['id'])) $url .= 'default.0.'.$page;
else $url .= 'list.'.$params['id'].'.'.$page;
break;
case 'all':
$url .= 'all.'.$params['id'].'.'.$page;
break;
case 'short':
$url .= 'cat.'.$params['id'].'.'.$page;

View File

@@ -116,6 +116,11 @@ $nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
break;
}
}
elseif($action == 'all')
{
$newsRoute = 'list/all';
$newsUrlparms['id'] = $sub_action;
}
else $newsRoute = 'list/items';
$newsRoute = 'news/'.$newsRoute;
@@ -254,6 +259,7 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
// $parms = $news_total.",".$amount.",".$newsfrom.",".e_SELF.'?'.$action.".".$category.".[FROM]";
//
// $text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
$amount = ($action == "all") ? NEWSALL_LIMIT : NEWSLIST_LIMIT;
$nitems = defined('NEWS_NEXTPREV_NAVCOUNT') ? '&navcount='.NEWS_NEXTPREV_NAVCOUNT : '' ;
$url = rawurlencode(e107::getUrl()->create($newsRoute, $newsUrlparms));