mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Fixes #465 - Bootstrap3 layout with sidebar panel added. Menu Preset added. Bootstrap3 styling tweaks to news menus.
This commit is contained in:
parent
b028fbb002
commit
b8724bc4bc
@ -581,8 +581,8 @@ echo "</head>\n";
|
||||
foreach($LAYOUT as $key=>$template)
|
||||
{
|
||||
list($hd,$ft) = explode("{---}",$template);
|
||||
$HEADER[$key] = $hd;
|
||||
$FOOTER[$key] = $ft;
|
||||
$HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd;
|
||||
$FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ;
|
||||
}
|
||||
unset($hd,$ft);
|
||||
}
|
||||
|
@ -177,8 +177,8 @@ class e_menuManager {
|
||||
foreach($LAYOUT as $key=>$template)
|
||||
{
|
||||
list($hd,$ft) = explode("{---}",$template);
|
||||
$HEADER[$key] = $hd;
|
||||
$FOOTER[$key] = $ft;
|
||||
$HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd;
|
||||
$FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ;
|
||||
}
|
||||
unset($hd,$ft);
|
||||
}
|
||||
@ -317,6 +317,7 @@ class e_menuManager {
|
||||
|
||||
if(!$menuAreas = $this->getMenuPreset())
|
||||
{
|
||||
e107::getMessage()->addDebug("No Menu Preset Found");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -668,40 +669,55 @@ class e_menuManager {
|
||||
|
||||
if(!isset($pref['sitetheme_layouts'][$layout]['menuPresets']))
|
||||
{
|
||||
e107::getMessage()->addDebug(print_a($pref['sitetheme_layouts'],true));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area'];
|
||||
|
||||
// print_a($temp);
|
||||
$multiple = isset($temp['menu'][1]);
|
||||
|
||||
foreach($temp as $key=>$val)
|
||||
{
|
||||
$iD = $val['@attributes']['id'];
|
||||
if(varset($val['menu'][1])) // More than one menu item under <area> in theme.xml.
|
||||
if($val['id'])
|
||||
{
|
||||
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;
|
||||
$menuArea[] = array(
|
||||
'menu_location' => $iD,
|
||||
'menu_order' => $k,
|
||||
'menu_name' => $v['@attributes']['name']."_menu",
|
||||
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
|
||||
);
|
||||
foreach($val as $k=>$v)
|
||||
{
|
||||
|
||||
// $uclass = (defined(trim($v['@attributes']['perm']))) ? constant(trim($v['@attributes']['userclass'])) : 0;
|
||||
$menuArea[] = array(
|
||||
'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 .= (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>
|
||||
|
||||
</tr>";
|
||||
|
@ -162,8 +162,8 @@ if(false === $cached)
|
||||
|
||||
if(deftrue('BOOTSTRAP')) // v2.x
|
||||
{
|
||||
$month_selector = '<div class="btn-group pull-right"><a class="btn btn-mini " href="#blogCalendar" data-slide="prev">‹</a>
|
||||
<a class="btn btn-mini" href="#blogCalendar" data-slide="next">›</a></div>';
|
||||
$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 btn-default btn-xs" href="#blogCalendar" data-slide="next">›</a></div>';
|
||||
|
||||
$caption = "<span class='inline-text'>".BLOGCAL_L1." ".$month_selector."</span>";
|
||||
|
||||
@ -180,7 +180,7 @@ if(false === $cached)
|
||||
|
||||
$menu .= "</div>";
|
||||
$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>";
|
||||
|
||||
|
@ -39,8 +39,8 @@ if(!$OTHERNEWS_STYLE)
|
||||
define("OTHERNEWS_COLS",false);
|
||||
$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>
|
||||
<a class="btn btn-mini" href="#otherNews" data-slide="next">›</a></div>';
|
||||
$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 btn-xs btn-default" href="#otherNews" data-slide="next">›</a></div>';
|
||||
|
||||
$caption = "<span class='inline-text'>".$template['caption']." ".$item_selector."</span>";
|
||||
|
||||
|
@ -64,7 +64,7 @@ $NEWS_MENU_TEMPLATE['other']['item'] = '<div class="item {ACTIVE}">
|
||||
{NEWSIMAGE}
|
||||
<h3>{NEWSTITLE}</h3>
|
||||
<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>';
|
||||
$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'>
|
||||
<span class='media-object pull-left'>{NEWSIMAGE}</span>
|
||||
<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>
|
||||
</li>\n";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Move down content because we have a fixed navbar that is 50px tall */
|
||||
body {
|
||||
padding-top: 50px;
|
||||
padding-top: 70px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ function tablestyle($caption, $text, $mode='')
|
||||
|
||||
if($style == 'col-md-4')
|
||||
{
|
||||
echo ' <div class="col-md-4">
|
||||
echo ' <div class="col-xs-12 col-md-4">
|
||||
<h2>'.$caption.'</h2>
|
||||
'.$text.'
|
||||
</div>';
|
||||
@ -58,66 +58,31 @@ function tablestyle($caption, $text, $mode='')
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($mode == 'loginbox') // Login Box Style.
|
||||
if($style == 'menu')
|
||||
{
|
||||
echo '<div class="well sidebar-nav">
|
||||
<ul class="nav nav-list"><li class="nav-header">'.$caption.'</li></ul>
|
||||
|
||||
'.$text.'
|
||||
|
||||
</div><!--/.well -->';
|
||||
return;
|
||||
}
|
||||
|
||||
if($mode == 'login_page')
|
||||
{
|
||||
$type = 'no_caption';
|
||||
}
|
||||
echo '<div class="panel panel-default">
|
||||
<div class="panel-heading">'.$caption.'</div>
|
||||
<div class="panel-body">
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>';
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
echo '<h2>'.$caption.'</h2>
|
||||
<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="container">
|
||||
<div class="navbar-header">
|
||||
@ -142,7 +107,8 @@ $commonHead = '
|
||||
|
||||
';
|
||||
|
||||
$commonFoot = ' <hr>
|
||||
// applied after every layout.
|
||||
$LAYOUT['_footer_'] = ' <hr>
|
||||
|
||||
<footer>
|
||||
{SITEDISCLAIMER}
|
||||
@ -151,13 +117,10 @@ $commonFoot = ' <hr>
|
||||
';
|
||||
|
||||
|
||||
|
||||
// $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'] =
|
||||
|
||||
$commonHead . '
|
||||
$LAYOUT['jumbotron_home'] = '
|
||||
|
||||
{SETSTYLE=default}
|
||||
<div class="container">
|
||||
@ -175,13 +138,11 @@ $LAYOUT['jumbotron_home'] =
|
||||
{CMENU=jumbotron-menu-3}
|
||||
</div>
|
||||
|
||||
'.$commonFoot;
|
||||
';
|
||||
|
||||
|
||||
|
||||
$LAYOUT['jumbotron_full'] =
|
||||
|
||||
$commonHead . '
|
||||
$LAYOUT['jumbotron_full'] = '
|
||||
|
||||
{SETSTYLE=default}
|
||||
<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>
|
||||
</layout>
|
||||
<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>
|
||||
</e107Theme>
|
Loading…
x
Reference in New Issue
Block a user