- Xtemplate improvements from Ax: "i find it annoying to have two empty blocks
(a blue - message - and a grey - footer - one) if my site doesn't have neither of them set."4.3.x
parent
89005902e4
commit
1ed2329261
|
@ -108,7 +108,7 @@ img {
|
||||||
}
|
}
|
||||||
#footer {
|
#footer {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
padding: 1em 1em 1em 1em;
|
padding: 1em;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
#forum td {
|
#forum td {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
// $Id$
|
||||||
|
|
||||||
function xtemplate_settings() {
|
function xtemplate_settings() {
|
||||||
$output = form_select("Sidebar placement", "xtemplate_sidebar", variable_get("xtemplate_sidebar", "right"), array("none" => t("No sidebars"), "left" => t("Sidebar on the left"), "right" => t("Sidebar on the right"), "both" => t("Sidebar on the left and the right")));
|
$output = form_select("Sidebar placement", "xtemplate_sidebar", variable_get("xtemplate_sidebar", "right"), array("none" => t("No sidebars"), "left" => t("Sidebar on the left"), "right" => t("Sidebar on the right"), "both" => t("Sidebar on the left and the right")));
|
||||||
|
@ -89,8 +90,9 @@ class Theme_xtemplate extends BaseTheme {
|
||||||
$this->template->parse("header.search_box");
|
$this->template->parse("header.search_box");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["q"] == variable_get("site_frontpage", "node")) {
|
// only parse the message block if we are on the frontpage ...
|
||||||
$this->template->assign("header_message", variable_get("xtemplate_message", l("edit message", "admin/system/themes/xtemplate")));
|
if ($_GET["q"] == variable_get("site_frontpage", "node") && ($message = variable_get("xtemplate_message", "edit message"))) {
|
||||||
|
$this->template->assign("header_message", $message);
|
||||||
$this->template->parse("header.message");
|
$this->template->parse("header.message");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +114,6 @@ class Theme_xtemplate extends BaseTheme {
|
||||||
|
|
||||||
$this->template->parse("header");
|
$this->template->parse("header");
|
||||||
print $this->template->text("header");
|
print $this->template->text("header");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function block($title, $content, $region = "main") {
|
function block($title, $content, $region = "main") {
|
||||||
|
@ -155,12 +155,15 @@ class Theme_xtemplate extends BaseTheme {
|
||||||
|
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
$this->template->assign( array(
|
// only parse the footer block if site_footer is set
|
||||||
"footer_message" => variable_get("site_footer", ""),
|
if ($footer_message = variable_get("site_footer", FALSE)) {
|
||||||
"footer" => theme_footer()
|
$this->template->assign("footer_message", $footer_message);
|
||||||
));
|
$this->template->parse("footer.message");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->template->assign("footer", theme_footer());
|
||||||
$this->template->parse("footer");
|
$this->template->parse("footer");
|
||||||
|
|
||||||
print $this->template->text("footer");
|
print $this->template->text("footer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,9 +98,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<!-- BEGIN: message -->
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
{footer_message}
|
{footer_message}
|
||||||
</div>
|
</div>
|
||||||
|
<!-- END: message -->
|
||||||
{footer}
|
{footer}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue