mirror of
https://github.com/e107inc/e107.git
synced 2025-08-18 04:12:00 +02:00
Fixes #465 - Bootstrap3 layout with sidebar panel added. Menu Preset added. Bootstrap3 styling tweaks to news menus.
This commit is contained in:
@@ -581,8 +581,8 @@ echo "</head>\n";
|
|||||||
foreach($LAYOUT as $key=>$template)
|
foreach($LAYOUT as $key=>$template)
|
||||||
{
|
{
|
||||||
list($hd,$ft) = explode("{---}",$template);
|
list($hd,$ft) = explode("{---}",$template);
|
||||||
$HEADER[$key] = $hd;
|
$HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd;
|
||||||
$FOOTER[$key] = $ft;
|
$FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ;
|
||||||
}
|
}
|
||||||
unset($hd,$ft);
|
unset($hd,$ft);
|
||||||
}
|
}
|
||||||
|
@@ -177,8 +177,8 @@ class e_menuManager {
|
|||||||
foreach($LAYOUT as $key=>$template)
|
foreach($LAYOUT as $key=>$template)
|
||||||
{
|
{
|
||||||
list($hd,$ft) = explode("{---}",$template);
|
list($hd,$ft) = explode("{---}",$template);
|
||||||
$HEADER[$key] = $hd;
|
$HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd;
|
||||||
$FOOTER[$key] = $ft;
|
$FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ;
|
||||||
}
|
}
|
||||||
unset($hd,$ft);
|
unset($hd,$ft);
|
||||||
}
|
}
|
||||||
@@ -317,6 +317,7 @@ class e_menuManager {
|
|||||||
|
|
||||||
if(!$menuAreas = $this->getMenuPreset())
|
if(!$menuAreas = $this->getMenuPreset())
|
||||||
{
|
{
|
||||||
|
e107::getMessage()->addDebug("No Menu Preset Found");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -668,40 +669,55 @@ class e_menuManager {
|
|||||||
|
|
||||||
if(!isset($pref['sitetheme_layouts'][$layout]['menuPresets']))
|
if(!isset($pref['sitetheme_layouts'][$layout]['menuPresets']))
|
||||||
{
|
{
|
||||||
|
e107::getMessage()->addDebug(print_a($pref['sitetheme_layouts'],true));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area'];
|
$temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area'];
|
||||||
|
|
||||||
|
// print_a($temp);
|
||||||
|
$multiple = isset($temp['menu'][1]);
|
||||||
|
|
||||||
foreach($temp as $key=>$val)
|
foreach($temp as $key=>$val)
|
||||||
{
|
{
|
||||||
$iD = $val['@attributes']['id'];
|
if($val['id'])
|
||||||
if(varset($val['menu'][1])) // More than one menu item under <area> in theme.xml.
|
|
||||||
{
|
{
|
||||||
foreach($val['menu'] as $k=>$v)
|
$iD = $val['id'];
|
||||||
|
}
|
||||||
|
// $iD = $val['id'];
|
||||||
|
|
||||||
|
if($key == 'menu')
|
||||||
|
{
|
||||||
|
if($multiple) // More than one menu item under <area> in theme.xml.
|
||||||
{
|
{
|
||||||
// $uclass = (defined(trim($v['@attributes']['perm']))) ? constant(trim($v['@attributes']['userclass'])) : 0;
|
foreach($val as $k=>$v)
|
||||||
$menuArea[] = array(
|
{
|
||||||
'menu_location' => $iD,
|
|
||||||
'menu_order' => $k,
|
// $uclass = (defined(trim($v['@attributes']['perm']))) ? constant(trim($v['@attributes']['userclass'])) : 0;
|
||||||
'menu_name' => $v['@attributes']['name']."_menu",
|
$menuArea[] = array(
|
||||||
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
|
'menu_location' => $iD,
|
||||||
);
|
'menu_order' => $k,
|
||||||
|
'menu_name' => $v['@attributes']['name']."_menu",
|
||||||
|
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Only one menu item under <area> in theme.xml.
|
||||||
|
{
|
||||||
|
// $uclass = (defined(trim($val['menu']['@attributes']['userclass']))) ? constant(trim($val['menu']['@attributes']['userclass'])) : 0;
|
||||||
|
$menuArea[] = array(
|
||||||
|
'menu_location' => $iD,
|
||||||
|
'menu_order' => 0,
|
||||||
|
'menu_name' => $val['menu']['@attributes']['name']."_menu",
|
||||||
|
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Only one menu item under <area> in theme.xml.
|
|
||||||
{
|
|
||||||
// $uclass = (defined(trim($val['menu']['@attributes']['userclass']))) ? constant(trim($val['menu']['@attributes']['userclass'])) : 0;
|
|
||||||
$menuArea[] = array(
|
|
||||||
'menu_location' => $iD,
|
|
||||||
'menu_order' => 0,
|
|
||||||
'menu_name' => $val['menu']['@attributes']['name']."_menu",
|
|
||||||
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print_a($menuArea);
|
||||||
|
|
||||||
return $menuArea;
|
return $menuArea;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1263,7 +1263,13 @@ class themeHandler
|
|||||||
|
|
||||||
$itext .= "<td>";
|
$itext .= "<td>";
|
||||||
|
|
||||||
$itext .= (varset($val['menuPresets'])) ? $this->frm->admin_button("setMenuPreset[".$key."]", "Use Preset") : "";
|
if(varset($val['menuPresets']))
|
||||||
|
{
|
||||||
|
$itext .= $this->frm->admin_button("setMenuPreset[".$key."]", "Use Preset");
|
||||||
|
// $itext .= print_a($val['menuPresets'],true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$itext .= "</td>
|
$itext .= "</td>
|
||||||
|
|
||||||
</tr>";
|
</tr>";
|
||||||
|
@@ -162,8 +162,8 @@ if(false === $cached)
|
|||||||
|
|
||||||
if(deftrue('BOOTSTRAP')) // v2.x
|
if(deftrue('BOOTSTRAP')) // v2.x
|
||||||
{
|
{
|
||||||
$month_selector = '<div class="btn-group pull-right"><a class="btn btn-mini " href="#blogCalendar" data-slide="prev">‹</a>
|
$month_selector = '<div class="btn-group pull-right"><a class="btn btn-mini btn-default btn-xs " href="#blogCalendar" data-slide="prev">‹</a>
|
||||||
<a class="btn btn-mini" href="#blogCalendar" data-slide="next">›</a></div>';
|
<a class="btn btn-mini btn-default btn-xs" href="#blogCalendar" data-slide="next">›</a></div>';
|
||||||
|
|
||||||
$caption = "<span class='inline-text'>".BLOGCAL_L1." ".$month_selector."</span>";
|
$caption = "<span class='inline-text'>".BLOGCAL_L1." ".$month_selector."</span>";
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ if(false === $cached)
|
|||||||
|
|
||||||
$menu .= "</div>";
|
$menu .= "</div>";
|
||||||
$menu .= "<div class='blogcalendar-archive-link' >
|
$menu .= "<div class='blogcalendar-archive-link' >
|
||||||
<a class='blogcalendar-archive-link btn btn-small' href='$prefix/archive.php'>".BLOGCAL_L2."</a>
|
<a class='blogcalendar-archive-link btn btn-small btn-s btn-default' href='$prefix/archive.php'>".BLOGCAL_L2."</a>
|
||||||
</div>
|
</div>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
|
@@ -39,8 +39,8 @@ if(!$OTHERNEWS_STYLE)
|
|||||||
define("OTHERNEWS_COLS",false);
|
define("OTHERNEWS_COLS",false);
|
||||||
$template = e107::getTemplate('news', 'news_menu', 'other');
|
$template = e107::getTemplate('news', 'news_menu', 'other');
|
||||||
|
|
||||||
$item_selector = '<div class="btn-group pull-right"><a class="btn btn-mini " href="#otherNews" data-slide="prev">‹</a>
|
$item_selector = '<div class="btn-group pull-right"><a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="prev">‹</a>
|
||||||
<a class="btn btn-mini" href="#otherNews" data-slide="next">›</a></div>';
|
<a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="next">›</a></div>';
|
||||||
|
|
||||||
$caption = "<span class='inline-text'>".$template['caption']." ".$item_selector."</span>";
|
$caption = "<span class='inline-text'>".$template['caption']." ".$item_selector."</span>";
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ $NEWS_MENU_TEMPLATE['other']['item'] = '<div class="item {ACTIVE}">
|
|||||||
{NEWSIMAGE}
|
{NEWSIMAGE}
|
||||||
<h3>{NEWSTITLE}</h3>
|
<h3>{NEWSTITLE}</h3>
|
||||||
<p>{NEWSSUMMARY}</p>
|
<p>{NEWSSUMMARY}</p>
|
||||||
<p class="text-right"><a class="btn" href="{NEWSURL}">'.LAN_READ_MORE.' »</a></p>
|
<p class="text-right"><a class="btn btn-default" href="{NEWSURL}">'.LAN_READ_MORE.' »</a></p>
|
||||||
</div>';
|
</div>';
|
||||||
$NEWS_MENU_TEMPLATE['other']['end'] = "</div></div>";
|
$NEWS_MENU_TEMPLATE['other']['end'] = "</div></div>";
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ $NEWS_MENU_TEMPLATE['other2']['start'] = "<ul class='media-list unstyled othern
|
|||||||
$NEWS_MENU_TEMPLATE['other2']['item'] = "<li class='media'>
|
$NEWS_MENU_TEMPLATE['other2']['item'] = "<li class='media'>
|
||||||
<span class='media-object pull-left'>{NEWSIMAGE}</span>
|
<span class='media-object pull-left'>{NEWSIMAGE}</span>
|
||||||
<div class='media-body'><h4>{NEWSTITLELINK}</h4>
|
<div class='media-body'><h4>{NEWSTITLELINK}</h4>
|
||||||
<p class='text-right'><a class='btn' href='{NEWSURL}'>".LAN_READ_MORE." »</a></p>
|
<p class='text-right'><a class='btn btn-default' href='{NEWSURL}'>".LAN_READ_MORE." »</a></p>
|
||||||
</div>
|
</div>
|
||||||
</li>\n";
|
</li>\n";
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* Move down content because we have a fixed navbar that is 50px tall */
|
/* Move down content because we have a fixed navbar that is 50px tall */
|
||||||
body {
|
body {
|
||||||
padding-top: 50px;
|
padding-top: 70px;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ function tablestyle($caption, $text, $mode='')
|
|||||||
|
|
||||||
if($style == 'col-md-4')
|
if($style == 'col-md-4')
|
||||||
{
|
{
|
||||||
echo ' <div class="col-md-4">
|
echo ' <div class="col-xs-12 col-md-4">
|
||||||
<h2>'.$caption.'</h2>
|
<h2>'.$caption.'</h2>
|
||||||
'.$text.'
|
'.$text.'
|
||||||
</div>';
|
</div>';
|
||||||
@@ -58,66 +58,31 @@ function tablestyle($caption, $text, $mode='')
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($style == 'menu')
|
||||||
if($mode == 'loginbox') // Login Box Style.
|
|
||||||
{
|
{
|
||||||
echo '<div class="well sidebar-nav">
|
echo '<div class="panel panel-default">
|
||||||
<ul class="nav nav-list"><li class="nav-header">'.$caption.'</li></ul>
|
<div class="panel-heading">'.$caption.'</div>
|
||||||
|
<div class="panel-body">
|
||||||
'.$text.'
|
'.$text.'
|
||||||
|
</div>
|
||||||
</div><!--/.well -->';
|
</div>';
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
}
|
||||||
if($mode == 'login_page')
|
|
||||||
{
|
echo '<h2>'.$caption.'</h2>
|
||||||
$type = 'no_caption';
|
<p>
|
||||||
}
|
'.$text.'
|
||||||
|
</p>';
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
switch($type)
|
|
||||||
{
|
|
||||||
// Default Menu/Side-Panel Style
|
|
||||||
case 'menu' :
|
|
||||||
echo '<div class="well sidebar-nav">
|
|
||||||
<ul class="nav nav-list"><li class="nav-header">'.$caption.'</li></ul>
|
|
||||||
|
|
||||||
'.$text.'
|
|
||||||
|
|
||||||
</div><!--/.well -->';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'span4' :
|
|
||||||
echo $text;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'box':
|
|
||||||
echo '
|
|
||||||
<div class="block">
|
|
||||||
<div class="block-text">
|
|
||||||
'.$text.'
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'no_caption':
|
|
||||||
echo $text;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default: // Main Content Style.
|
|
||||||
echo '
|
|
||||||
<h2>'.$caption.'</h2>
|
|
||||||
<p>
|
|
||||||
'.$text.'
|
|
||||||
</p>
|
|
||||||
|
|
||||||
';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$commonHead = '
|
// applied before every layout.
|
||||||
|
$LAYOUT['_header_'] = '
|
||||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
@@ -142,7 +107,8 @@ $commonHead = '
|
|||||||
|
|
||||||
';
|
';
|
||||||
|
|
||||||
$commonFoot = ' <hr>
|
// applied after every layout.
|
||||||
|
$LAYOUT['_footer_'] = ' <hr>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
{SITEDISCLAIMER}
|
{SITEDISCLAIMER}
|
||||||
@@ -151,13 +117,10 @@ $commonFoot = ' <hr>
|
|||||||
';
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// $LAYOUT is a combined $HEADER and $FOOTER, automatically split at the point of "{---}"
|
// $LAYOUT is a combined $HEADER and $FOOTER, automatically split at the point of "{---}"
|
||||||
|
|
||||||
//TODO make $LAYOUT['_header_'] && $LAYOUT['_footer_']; and auto attach to main layout.
|
$LAYOUT['jumbotron_home'] = '
|
||||||
|
|
||||||
$LAYOUT['jumbotron_home'] =
|
|
||||||
|
|
||||||
$commonHead . '
|
|
||||||
|
|
||||||
{SETSTYLE=default}
|
{SETSTYLE=default}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@@ -175,13 +138,11 @@ $LAYOUT['jumbotron_home'] =
|
|||||||
{CMENU=jumbotron-menu-3}
|
{CMENU=jumbotron-menu-3}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
'.$commonFoot;
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$LAYOUT['jumbotron_full'] =
|
$LAYOUT['jumbotron_full'] = '
|
||||||
|
|
||||||
$commonHead . '
|
|
||||||
|
|
||||||
{SETSTYLE=default}
|
{SETSTYLE=default}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@@ -194,22 +155,38 @@ $LAYOUT['jumbotron_full'] =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
'.$commonFoot;
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$LAYOUT['jumbotron_sidebar_right'] = '
|
||||||
|
|
||||||
|
{SETSTYLE=default}
|
||||||
|
<div class="container">
|
||||||
|
{ALERTS}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-md-8">
|
||||||
|
|
||||||
|
{---}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="sidebar" class="col-xs-12 col-md-4">
|
||||||
|
{SETSTYLE=menu}
|
||||||
|
{MENU=1}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* XXX EVERYTHING BELOW THIS POINT IS UNUSED FOR NOW */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,5 +19,16 @@
|
|||||||
<custompages>FRONTPAGE</custompages>
|
<custompages>FRONTPAGE</custompages>
|
||||||
</layout>
|
</layout>
|
||||||
<layout name='jumbotron_full' title='Jumbotron (full-width)' default='true' />
|
<layout name='jumbotron_full' title='Jumbotron (full-width)' default='true' />
|
||||||
|
<layout name='jumbotron_sidebar_right' title='Jumbotron (sidebar-right)' >
|
||||||
|
<custompages>/news</custompages>
|
||||||
|
<menuPresets>
|
||||||
|
<area id='1'>
|
||||||
|
<menu name='other_news' />
|
||||||
|
<menu name='other_news2' />
|
||||||
|
<menu name='news_categories' />
|
||||||
|
<menu name='blogcalendar' />
|
||||||
|
</area>
|
||||||
|
</menuPresets>
|
||||||
|
</layout>
|
||||||
</layouts>
|
</layouts>
|
||||||
</e107Theme>
|
</e107Theme>
|
Reference in New Issue
Block a user