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

Remove BOOTSTRAP and FONTAWESOME constants from bootstrap/theme.php

This commit is contained in:
Cameron
2019-08-30 18:41:51 -07:00
parent 875192c9ba
commit f8733b7ea1
3 changed files with 123 additions and 116 deletions

View File

@@ -157,9 +157,12 @@ class e_theme
// If no scope set, we load library on both areas. // If no scope set, we load library on both areas.
if(empty($library['scope']) || $library['scope'] === 'all') if(empty($library['scope']) || $library['scope'] === 'all')
{ {
if($library['name'] === 'bootstrap' && varset($library['version']) == 4) // quick fix. if($library['name'] === 'bootstrap' && !empty($library['version']))
{
if(intval($library['version']) > 3) // quick fix.
{ {
$library['name'] .= (string) $library['version']; $library['name'] .= (string) $library['version'];
}
e107::getParser()->setBootstrap($library['version']); e107::getParser()->setBootstrap($library['version']);
@@ -168,9 +171,12 @@ class e_theme
define('BOOTSTRAP', (int) $library['version']); define('BOOTSTRAP', (int) $library['version']);
} }
} }
elseif($library['name'] === 'fontawesome' && !empty($library['version'])) // quick fix. elseif($library['name'] === 'fontawesome' && !empty($library['version']))
{
if(intval($library['version']) > 4) // quick fix.
{ {
$library['name'] .= (string) $library['version']; $library['name'] .= (string) $library['version'];
}
e107::getParser()->setFontAwesome($library['version']); e107::getParser()->setFontAwesome($library['version']);

View File

@@ -16,8 +16,7 @@ if(!defined('e107_INIT'))
exit; exit;
} }
define("BOOTSTRAP", 3);
define("FONTAWESOME", 4);
define('VIEWPORT', "width=device-width, initial-scale=1.0"); define('VIEWPORT', "width=device-width, initial-scale=1.0");
// CDN provider for Bootswatch. // CDN provider for Bootswatch.
@@ -57,6 +56,12 @@ define('COMMENTOFFSTRING', '');
define('PRE_EXTENDEDSTRING', '<br />'); define('PRE_EXTENDEDSTRING', '<br />');
class bootstrap3_theme class bootstrap3_theme
{ {
@@ -66,57 +71,56 @@ class bootstrap3_theme
* @param string $id : id of the current render * @param string $id : id of the current render
* @param array $info : current style and other menu data. * @param array $info : current style and other menu data.
*/ */
function tablestyle($caption, $text, $id='', $info=array()) function tablestyle($caption, $text, $id='', $info=array())
{ {
// global $style; // no longer needed.
$style = $info['setStyle'];
$style = $info['setStyle']; // global $style; // no longer needed.
echo "<!-- tablestyle: style=".$style." id=".$id." -->\n\n"; echo "<!-- tablestyle: style=".$style." id=".$id." -->\n\n";
$type = $style;
if(empty($caption))
{
$type = 'box';
}
if($style == 'navdoc' || $style == 'none')
{
echo $text;
return;
}
/* /*
if($id == 'wm') // Example - If rendered from 'welcome message' if($id == 'wm') // Example - If rendered from 'welcome message'
{ {
$style = '';
} }
if($id == 'featurebox') // Example - If rendered from 'featurebox' if($id == 'featurebox') // Example - If rendered from 'featurebox'
{ {
$style = '';
} }
*/ */
switch($style)
if($style == 'jumbotron')
{ {
case "navdoc":
case "none":
echo $text;
break;
case "jumbotron":
echo '<div class="jumbotron"> echo '<div class="jumbotron">
<div class="container">'; <div class="container">';
if(!empty($caption)) if(!empty($caption))
{ {
echo '<h1>'.$caption.'</h1>'; echo '<h1>'.$caption.'</h1>';
} }
echo ' echo '
'.$text.' '.$text.'
</div> </div>
</div>'; </div>';
return;
}
if($style == 'col-md-4' || $style == 'col-md-6' || $style == 'col-md-8') break;
{
case "col-md-4":
case "col-md-6":
case "col-md-8":
echo ' <div class="col-xs-12 '.$style.'">'; echo ' <div class="col-xs-12 '.$style.'">';
if(!empty($caption)) if(!empty($caption))
@@ -127,34 +131,34 @@ class bootstrap3_theme
echo ' echo '
'.$text.' '.$text.'
</div>'; </div>';
return;
} break;
case "menu":
if($style == 'menu')
{
echo '<div class="panel panel-default"> echo '<div class="panel panel-default">
<div class="panel-heading">'.$caption.'</div> <div class="panel-heading">'.$caption.'</div>
<div class="panel-body"> <div class="panel-body">
'.$text.' '.$text.'
</div> </div>
</div>'; </div>';
return;
} break;
case "portfolio":
if($style == 'portfolio')
{
echo ' echo '
<div class="col-lg-4 col-md-4 col-sm-6"> <div class="col-lg-4 col-md-4 col-sm-6">
'.$text.' '.$text.'
</div>'; </div>';
return;
} break;
// default. default:
if(!empty($caption)) if(!empty($caption))
{ {
@@ -162,12 +166,10 @@ class bootstrap3_theme
} }
echo $text; echo $text;
// code to be executed if n is different from all labels;
}
return null;
return;
} }
@@ -196,4 +198,3 @@ $NEWSCAT_ITEM = "\n\n\n\n<!-- News Category Item -->\n\n\n\n
</td></tr></table></div> </td></tr></table></div>
"; ";
?>

View File

@@ -19,8 +19,8 @@
<image>preview_frontend.png</image> <image>preview_frontend.png</image>
</screenshots> </screenshots>
<libraries> <libraries>
<library name="bootstrap" scope="all"/> <library name="bootstrap" version="3" scope="all"/>
<library name="fontawesome" scope="all"/> <library name="fontawesome" version="4" scope="all"/>
<library name="bootstrap.editable" scope="admin"/> <library name="bootstrap.editable" scope="admin"/>
</libraries> </libraries>
<stylesheets> <stylesheets>