Skip to content

Commit

Permalink
Merge pull request #197 from GregMage/xoops_page
Browse files Browse the repository at this point in the history
Add $xoops_page for theme
  • Loading branch information
geekwright committed Aug 17, 2016
2 parents c877681 + a203553 commit 03f901d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion htdocs/class/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,19 @@ public function xoInit($options = array())
$this->template = new XoopsTpl();
$this->template->currentTheme =& $this;
$this->template->assign_by_ref('xoTheme', $this);
$xoops_page = str_replace(XOOPS_ROOT_PATH . '/', '', $_SERVER['SCRIPT_FILENAME']);
if (strpos($xoops_page, 'modules') !== false){
$xoops_page = str_replace('modules/', '', $xoops_page);
}
$xoops_page = str_replace('.php', '', $xoops_page);
if (isset($GLOBALS['xoopsConfig']['startpage'])){
$xoops_startpage = $GLOBALS['xoopsConfig']['startpage'];
if ($xoops_startpage == '--') {
$xoops_startpage = 'system';
}
} else {
$xoops_startpage = 'system';
}
$this->template->assign(array(
'xoops_theme' => $GLOBALS['xoopsConfig']['theme_set'],
'xoops_imageurl' => XOOPS_THEME_URL . '/' . $GLOBALS['xoopsConfig']['theme_set'] . '/',
Expand All @@ -279,9 +292,10 @@ public function xoInit($options = array())
'xoops_sitename' => htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES),
'xoops_slogan' => htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES),
'xoops_dirname' => isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system',
'xoops_page' => $xoops_page,
'xoops_startpage' => $xoops_startpage,
'xoops_banner' => ($GLOBALS['xoopsConfig']['banners'] && $this->renderBanner) ? xoops_getbanner() : ' ',
'xoops_pagetitle' => isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('name') : htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES)));

if (isset($GLOBALS['xoopsUser']) && is_object($GLOBALS['xoopsUser'])) {
$this->template->assign(array(
'xoops_isuser' => true,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/themes/xbootstrap/theme.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<div class="container maincontainer">

<{if $xoops_dirname == "system"}>
<{if $xoops_page == "index"}>
<div class="aligncenter home-message row">
<div class="<{if $xoops_banner != ""}>col-md-6<{else}>col-md-12<{/if}>">
<h2><{$smarty.const.THEME_ABOUTUS}></h2>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/themes/xbootstrap/tpl/slider.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<{if $xoops_dirname == "system"}>
<{if $xoops_page == "index"}>
<div id="myCarousel" class="carousel slide slideshow" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
Expand Down

0 comments on commit 03f901d

Please sign in to comment.