1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 20:31:41 +02:00

Closes #4748 - Bootstrap5 Theme enhancements. Bootswatch 5.

This commit is contained in:
Cameron
2022-04-05 19:49:08 -07:00
parent 45372f285c
commit 6eff4cb5f7
15 changed files with 152 additions and 99 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -105,8 +105,18 @@ ul.social-buttons li a {
/* margin-top: 60px;*/
padding: 2rem 1rem;
/* margin-bottom: 2rem;*/
background-color: #e9ecef;
/* background-color: #e9ecef;*/
/* border-radius: .3rem;*/
}
#carousel-hero.carousel {
position: relative;
left: 0;
top: 70px;
width: 100%;
height: 100%;
overflow: hidden;
margin-bottom: 60px;
}
/* CUSTOM Responsive Styles */

View File

@@ -10,21 +10,16 @@ if(!defined('e107_INIT'))
class theme implements e_theme_render
{
public function init()
{
e107::lan('theme');
e107::meta('viewport', 'width=device-width, initial-scale=1.0'); // added to <head>
// e107::link('rel="preload" href="{THEME}fonts/myfont.woff2?v=2.2.0" as="font" type="font/woff2" crossorigin'); // added to <head>
//e107::meta('apple-mobile-web-app-capable','yes');
if($bootswatch = e107::pref('theme', 'bootswatch', false))
{
e107::css('url', 'https://bootswatch.com/4/' . $bootswatch . '/bootstrap.min.css');
e107::css('url', 'https://bootswatch.com/4/' . $bootswatch . '/bootstrap.min.css');
}
// e107::link('rel="preload" href="{THEME}fonts/myfont.woff2?v=2.2.0" as="font" type="font/woff2" crossorigin'); // added to <head>
// e107::meta('apple-mobile-web-app-capable','yes');
$login_iframe = e107::pref('theme', 'login_iframe', false);
@@ -36,13 +31,23 @@ if(!defined('e107_INIT'))
}
/**
* Override how THEME_STYLE is loaded. Duplicates will be automatically removed.
* @return void
*/
function css()
{
e107::css('theme', THEME_STYLE);
e107::css('theme', 'style.css'); // always load style.css last.
}
/**
* @param string $text
* @return string without p tags added always with bbcodes
* note: this solves W3C validation issue and CSS style problems
* use this carefully, mainly for custom menus, let decision on theme developers
*/
function remove_ptags($text = '') // FIXME this is a bug in e107 if this is required.
{
@@ -72,6 +77,9 @@ if(!defined('e107_INIT'))
$style = 'splash';
break;
case 'news_months_menu':
$style = 'listgroup';
break;
}
echo "\n<!-- tablestyle initial: style=" . $style . " mode=" . $mode . " UniqueId=" . varset($options['uniqueId']) . " -->\n\n";
@@ -131,7 +139,7 @@ if(!defined('e107_INIT'))
echo '<div class=" mb-4">';
if(!empty($caption))
{
echo '<h5 >' . $caption . '</h5>';
echo '<h5>' . $caption . '</h5>';
}
echo $text;
echo '</div>';

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<e107Theme name="Bootstrap 5" version="1.0" date="2021-03-22" compatibility="2.3.1">
<e107Theme name="Bootstrap 5" version="1.1" date="2022-04-05" compatibility="2.3.2">
<author name ="e107 Inc" email="e107inc@something.com" url="https://e107.org" />
<summary>Bootstrap 5 basic theme</summary>
<description>A starter template for bootstrap5 themes.</description>
@@ -10,12 +10,14 @@
<plugin name='rss_menu' url='core' />
<plugin name='social' url='core' />
<plugin name='tinymce4' url='core' />
<plugin name='gsitemap' url='core' />
</plugins>
<keywords>
<word>bootstrap</word>
<word>bootstrap5</word>
<word>clean</word>
<word>wireframe</word>
<word>bootswatch</word>
</keywords>
<libraries>
<library name="bootstrap" version="5" scope="front"/>
@@ -24,7 +26,12 @@
<library name="animate.css" scope="front" />
</libraries>
<stylesheets>
<css file="style.css" name="Default" />
<css file="style.css" name="Default" thumbnail='preview_frontend.png' scope='front' />
<css file="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/5.1.3/lux/bootstrap.min.css" name="Lux" thumbnail='images/lux.png' scope='front' exclude='bootstrap' />
<css file="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/5.1.3/sketchy/bootstrap.min.css" name="Sketchy" thumbnail='images/sketchy.png' scope='front' exclude='bootstrap' />
<css file="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/5.1.3/quartz/bootstrap.min.css" name="Quartz" thumbnail='images/quartz.png' scope='front' exclude='bootstrap' />
<css file="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/5.1.3/slate/bootstrap.min.css" name="Slate" thumbnail='images/slate.png' scope='front' exclude='bootstrap' />
<css file="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/5.1.3/superhero/bootstrap.min.css" name="Superhero" thumbnail='images/superhero.png' scope='front' exclude='bootstrap' />
</stylesheets>
<screenshots>
<image>preview_frontend.png</image>
@@ -47,7 +54,6 @@
</layouts>
<themePrefs>
<pref name='cardmenu_look'>1</pref>
<pref name='inlinecss'></pref>
<pref name='login_iframe'></pref>
</themePrefs>
</e107Theme>

View File

@@ -22,33 +22,36 @@ class theme_config implements e_theme_config
{
// v2.2.2
$bootswatch = array(
"cerulean"=> 'Cerulean',
"cosmo"=> 'Cosmo',
"cyborg"=> 'Cyborg',
"darkly"=> 'Darkly',
"flatly"=> 'Flatly',
"journal"=> 'Journal',
"litera"=> 'Litera',
"lumen"=> 'Lumen',
"lux"=> 'Lux',
"materia"=> 'Materia',
"minty"=> 'Minty',
"pulse"=> 'Pulse',
"sandstone"=> 'Sandstone',
"simplex"=> 'Simplex',
"sketchy"=> 'sketchy',
"slate"=> 'Slate',
"solar"=> 'Solar',
"spacelab"=> 'Spacelab',
"superhero"=> 'Superhero',
"united"=> 'United',
"yeti"=> 'Yeti',
"cerulean" => 'Cerulean',
"cosmo" => 'Cosmo',
"cyborg" => 'Cyborg',
"darkly" => 'Darkly',
"flatly" => 'Flatly',
"journal" => 'Journal',
"litera" => 'Litera',
"lumen" => 'Lumen',
"lux" => 'Lux',
"materia" => 'Materia',
"minty" => 'Minty',
'morph' => 'Morph',
"pulse" => 'Pulse',
'quartz' => 'Quartz',
"sandstone" => 'Sandstone',
"simplex" => 'Simplex',
"sketchy" => 'Sketchy',
"slate" => 'Slate',
"solar" => 'Solar',
"spacelab" => 'Spacelab',
"superhero" => 'Superhero',
"united" => 'United',
"yeti" => 'Yeti',
'zephyr' => 'Zephyr',
);
$previewLink = " <a class='btn btn-default btn-secondary e-modal' data-modal-caption=\"Use the 'Themes' menu to view the selection.\" href='http://bootswatch.com/default/'>".LAN_PREVIEW."</a>";
return array(
'bootswatch' => array('title'=>LAN_THEMEPREF_01, 'type'=>'dropdown', 'writeParms'=>array('optArray'=> $bootswatch, 'post'=>$previewLink, 'default'=>LAN_DEFAULT)),
//'bootswatch' => array('title'=>LAN_THEMEPREF_01, 'type'=>'dropdown', 'writeParms'=>array('optArray'=> $bootswatch, 'post'=>$previewLink, 'default'=>LAN_DEFAULT)),
'cardmenu_look' => array('title' => LAN_THEMEPREF_02, 'type'=>'boolean', 'writeParms'=>array(),'help'=>''),
'login_iframe' => array('title' => LAN_THEMEPREF_03, 'type'=>'boolean', 'writeParms'=>array(),'help'=>''),
);