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

When using Bootstrap 5 and no template is found, fallback to bootstrap 4 template if present in core folder.

This commit is contained in:
Cameron
2020-12-31 11:46:53 -08:00
parent 6e19d79a63
commit 8906cf1e26
4 changed files with 19 additions and 16 deletions

View File

@@ -2953,28 +2953,34 @@ class e107
$core_path_bs4 = e_CORE.'templates/bootstrap4/'.$id.'_template.php'; $core_path_bs4 = e_CORE.'templates/bootstrap4/'.$id.'_template.php';
$core_path_bs5 = e_CORE.'templates/bootstrap5/'.$id.'_template.php'; $core_path_bs5 = e_CORE.'templates/bootstrap5/'.$id.'_template.php';
$ret = $core_path;
if($override_path && is_readable($override_path)) // v2 override template. if($override_path && is_readable($override_path)) // v2 override template.
{ {
return $override_path; $ret = $override_path;
} }
elseif($legacy_override_path && is_readable($legacy_override_path)) //v1 override template. elseif($legacy_override_path && is_readable($legacy_override_path)) //v1 override template.
{ {
return $legacy_override_path; $ret = $legacy_override_path;
} }
elseif(THEME_LEGACY === true && is_readable($core_path_legacy)) //v1 core template. elseif(THEME_LEGACY === true && is_readable($core_path_legacy)) //v1 core template.
{ {
return $core_path_legacy; $ret = $core_path_legacy;
} }
elseif(defset('BOOTSTRAP') === 4 && is_readable($core_path_bs4)) elseif(defset('BOOTSTRAP') > 3)
{ {
return $core_path_bs4; if(is_readable($core_path_bs5))
{
$ret = $core_path_bs5;
} }
elseif(defset('BOOTSTRAP') === 5 && is_readable($core_path_bs5)) elseif(is_readable($core_path_bs4))
{ {
return $core_path_bs5; $ret = $core_path_bs4;
} }
return $core_path; }
return $ret;
} }
/** /**

View File

@@ -9,7 +9,7 @@ $SIGNIN_TEMPLATE = [];
$SIGNIN_WRAPPER['signin']['SIGNIN_SIGNUP_HREF'] = '<li class="nav-item"><a class="nav-link" href="{---}">{LAN=LAN_LOGINMENU_3}</a></li>'; $SIGNIN_WRAPPER['signin']['SIGNIN_SIGNUP_HREF'] = '<li class="nav-item"><a class="nav-link" href="{---}">{LAN=LAN_LOGINMENU_3}</a></li>';
$SIGNIN_TEMPLATE['signin'] = ' $SIGNIN_TEMPLATE['signin'] = '
<ul class="nav navbar-nav navbar-right nav-right"> <ul class="navbar-nav nav-right">
{SIGNIN_SIGNUP_HREF} {SIGNIN_SIGNUP_HREF}
<li class="divider-vertical"></li> <li class="divider-vertical"></li>
<li class="nav-item dropdown"> <li class="nav-item dropdown">
@@ -48,7 +48,7 @@ $SIGNIN_WRAPPER['signout']['SIGNIN_PM_NAV'] = '<li class="dropdown">{---}</li>';
$SIGNIN_TEMPLATE['signout'] = ' $SIGNIN_TEMPLATE['signout'] = '
<ul class="nav navbar-nav navbar-right"> <ul class="navbar-nav navbar-right">
{SIGNIN_PM_NAV} {SIGNIN_PM_NAV}
<li class="dropdown dropdown-avatar"><a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" data-toggle="dropdown">{USER_AVATAR: w=30&h=30&crop=1&shape=circle} {SIGNIN_USERNAME} <b class="caret"></b></a> <li class="dropdown dropdown-avatar"><a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" data-toggle="dropdown">{USER_AVATAR: w=30&h=30&crop=1&shape=circle} {SIGNIN_USERNAME} <b class="caret"></b></a>
<ul class="dropdown-menu "> <ul class="dropdown-menu ">

View File

@@ -346,9 +346,6 @@
$result = $this->dta->get_current_table('core'); $result = $this->dta->get_current_table('core');
$this->assertSame($result,$expected); $this->assertSame($result,$expected);
} }

View File

@@ -1049,7 +1049,7 @@ while(&#036;row = &#036;sql-&gt;fetch())
$result6 = preg_replace('/"([^"]*)thumb.php/','"thumb.php', $result6); $result6 = preg_replace('/"([^"]*)thumb.php/','"thumb.php', $result6);
// $result6 = str_replace($tempDir, '', $result6); // $result6 = str_replace($tempDir, '', $result6);
$expected = str_replace("\r", '', $expected);
$this->assertSame($expected,$result6); $this->assertSame($expected,$result6);
$this->tp->setConvertToWebP(false); $this->tp->setConvertToWebP(false);