//small fix
This commit is contained in:
+3
-14
@@ -431,25 +431,13 @@ class DispatcherCore
|
|||||||
foreach (Language::getLanguages() as $lang)
|
foreach (Language::getLanguages() as $lang)
|
||||||
$this->addRoute(
|
$this->addRoute(
|
||||||
$route_id,
|
$route_id,
|
||||||
$custom_route,
|
$custom_route ? $custom_route : $route['rule'],
|
||||||
$route_data['controller'],
|
$route_data['controller'],
|
||||||
$lang['id_lang'],
|
$lang['id_lang'],
|
||||||
$route_data['keywords'],
|
$route_data['keywords'],
|
||||||
isset($route_data['params']) ? $route_data['params'] : array()
|
isset($route_data['params']) ? $route_data['params'] : array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set default routes
|
|
||||||
foreach (Language::getLanguages() as $lang)
|
|
||||||
foreach ($this->default_routes as $id => $route)
|
|
||||||
$this->addRoute(
|
|
||||||
$id,
|
|
||||||
$route['rule'],
|
|
||||||
$route['controller'],
|
|
||||||
$lang['id_lang'],
|
|
||||||
$route['keywords'],
|
|
||||||
isset($route['params']) ? $route['params'] : array()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -581,7 +569,6 @@ class DispatcherCore
|
|||||||
return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : '').$anchor;
|
return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : '').$anchor;
|
||||||
}
|
}
|
||||||
$route = $this->routes[$id_lang][$route_id];
|
$route = $this->routes[$id_lang][$route_id];
|
||||||
|
|
||||||
// Check required fields
|
// Check required fields
|
||||||
$query_params = isset($route['params']) ? $route['params'] : array();
|
$query_params = isset($route['params']) ? $route['params'] : array();
|
||||||
foreach ($route['keywords'] as $key => $data)
|
foreach ($route['keywords'] as $key => $data)
|
||||||
@@ -598,8 +585,10 @@ class DispatcherCore
|
|||||||
// Build an url which match a route
|
// Build an url which match a route
|
||||||
if ($this->use_routes || $force_routes)
|
if ($this->use_routes || $force_routes)
|
||||||
{
|
{
|
||||||
|
|
||||||
$url = $route['rule'];
|
$url = $route['rule'];
|
||||||
$add_param = array();
|
$add_param = array();
|
||||||
|
|
||||||
foreach ($params as $key => $value)
|
foreach ($params as $key => $value)
|
||||||
{
|
{
|
||||||
if (!isset($route['keywords'][$key]))
|
if (!isset($route['keywords'][$key]))
|
||||||
|
|||||||
Reference in New Issue
Block a user