Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $xoops_page for theme #197

Merged
merged 3 commits into from
Aug 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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