1
I'm trying to find a way to hide and show a left column (mainly for the forums). There is some javascript for this but it only lasts for the current screen.
I'd like to make that a toggle that lasts between screens. Ideally it would only last while in the current module and then toggle.
If I manually set xoops_lblocks I can hide and show:
$this->assign("xoops_lblocks", FALSE) ;
Perhaps there is a simple way to do this?
FYI, I am using a very simple language module that toggles xoops_langcode, perhaps I can add something in there?
Here is the code I've pulled from a theme with block hiding.
Javascript in theme.html:
<script type="text/javascript">
<!--
var getById = (typeof document.getElementById != "undefined");
function toggleDisplay(obj,display1,display2)
{
if(!getById) return;
obj = getRef(obj);
// If it's set to "none", changes to "block"
if(obj.style.display == display2)
obj.style.display = display1;
else
// If it's set to "block", it stays in "block"
obj.style.display = display2;
repaintFix();
}
function getRef(obj)
{
if(getById)
return(typeof obj == "string") ? document.getElementById(obj) : obj;
}
function repaintFix(obj)
{
if("undefined" == typeof document.body || "undefined" == typeof document.body.style) return;
if(obj == null)
obj == document.body;
else
obj = getRef(obj);
document.body.style.visibility = "hidden";
document.body.style.visibility = "visible";
}
//-->
</script>
HTML code in theme.html to toggle show/hide:
<span style="float: left; width: 23px;"><img name="toggle" src="<{$xoops_imageurl}>images/toggle1.gif" width="23" height="23" border="0" alt="Hide/show left column" class="pointer" onclick="toggleDisplay('leftcolumn','block','none')"></span>