1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Moved experimental e_ROUTE constant to registry.

This commit is contained in:
Cameron
2021-11-01 15:46:39 -07:00
parent 7930aba4ca
commit 6d5b4f5c3a
6 changed files with 12 additions and 11 deletions

View File

@@ -194,9 +194,9 @@ class e_url
define('e_PAGE', basename($file)); define('e_PAGE', basename($file));
} }
if(!defined('e_ROUTE')) // subject to removal at any time. if(!e107::route()) // subject to removal at any time.
{ {
define('e_ROUTE', $plug.'/'.$k); e107::route($plug.'/'.$k);
} }
$fpUrl = str_replace(SITEURL, '', rtrim(e_REQUEST_URL, '?/')); $fpUrl = str_replace(SITEURL, '', rtrim(e_REQUEST_URL, '?/'));

View File

@@ -4109,12 +4109,12 @@ class e107
*/ */
public static function route($route = null) public static function route($route = null)
{ {
if(defined('e_ROUTE')) if($route === null)
{ {
return e_ROUTE; return self::getRegistry('core/e107/route', false);
} }
define('e_ROUTE', $route); self::setRegistry('core/e107/route', $route);
return null; return null;
} }

View File

@@ -1337,7 +1337,7 @@ class e_theme
$request = [ $request = [
'url' => e_REQUEST_URL, 'url' => e_REQUEST_URL,
'script' => varset($_SERVER['SCRIPT_FILENAME'],null), 'script' => varset($_SERVER['SCRIPT_FILENAME'],null),
'route' => deftrue('e_ROUTE', null), 'route' => e107::route(),
]; ];
$deflayout = self::getThemeLayout($cusPagePref, $cusPageDef, $request); $deflayout = self::getThemeLayout($cusPagePref, $cusPageDef, $request);

View File

@@ -139,5 +139,5 @@ define("TPVLANHELP_03", "By default, the visibility filter will change the theme
define("TPVLANHELP_04", "End lines with a [b]![/b] to exactly match against the end of URL."); define("TPVLANHELP_04", "End lines with a [b]![/b] to exactly match against the end of URL.");
define("TPVLANHELP_05", "End lines with a [b]$[/b] to exactly match against the end of script path."); define("TPVLANHELP_05", "End lines with a [b]$[/b] to exactly match against the end of script path.");
define("TPVLANHELP_06", "Start lines with a [b]:[/b] to partially or fully match against the e_ROUTE constant."); define("TPVLANHELP_06", "Start lines with a [b]:[/b] to partially or fully match against e107::route()");
define("TPVLAN_97", "This theme requires a newer version of e107."); define("TPVLAN_97", "This theme requires a newer version of e107.");

View File

@@ -1343,11 +1343,12 @@ class news_front
header("HTTP/1.0 404 Not Found",true,404); header("HTTP/1.0 404 Not Found",true,404);
require_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_error.php"); require_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_error.php");
$text = e107::getMessage()->setTitle(LAN_ERROR_7, E_MESSAGE_INFO)->addInfo(LAN_NEWS_308)->render(); // Perhaps you're looking for one of the news items below? $text = "<div class='news-view-error'>".e107::getMessage()->setTitle(LAN_ERROR_7, E_MESSAGE_INFO)->addInfo(LAN_NEWS_308)->render(); // Perhaps you're looking for one of the news items below?
$text .= "</div>";
$this->action = 'all'; $this->action = 'all';
$text .= $this->renderListTemplate(); $text .= $this->renderListTemplate();
return $text; return $text;
} }

View File

@@ -88,9 +88,9 @@
$request->setLegacyQstring(); $request->setLegacyQstring();
$request->setLegacyPage(); $request->setLegacyPage();
if(!defined('e_ROUTE') && ($rq = $request->getRoute())) if(!e107::route() && ($rq = $request->getRoute()))
{ {
define('e_ROUTE', $rq); e107::route($rq);
unset($rq); unset($rq);
} }