This is a very raw idea, but it might be worth developing better.
One of the
major problems of frames is that they rarely
degrade gracefully (i.e., things break if not accessed from the frameset), mostly due to the fact that they rely on html documents that are meaningless (or flawed) out of the frameset context. However, PHP allows all of the frames' sources to be actually pieces of the same document.
Using conditionals and some frameset variable available to PHP*, one can build a page that renders as a menu bar when called from the left frame and as contents when called from the right frame, and yet renders the whole thing when not in a frameset. It's also a good idea to add the corresponding frame targets to link tags when under a frameset
.
Since XOOPS has two design layers well separated from contents, things get much easier
A complete** framing solution in XOOPS would only require a new template (that has no difference from default when not framed) and a wrapper frameset page (that has to set variables/constants that Smarty can understand*). Optionally, a new theme (that has no difference from default or other normal themes when not framed) can be used.
Example of a wrapper menu/contents "frames.php" page:
<?php
include "mainfile.php";
echo '<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "newbbborkscode.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<head>';
//headerstuff, perhaps Smarty parsed?
echo "</head>
<frameset cols='20%, 80%' frameborder='no' border='0' framespacing='0'>
<frame src='$XOOPS_URL/index.php?XXX_arbitrary_menu_token_XXX' id='menu' scrolling='yes' noresize='noresize' />
<frame src='$XOOPS_URL/index.php?YYY_arbitrary_content_token_YYY' id='content' scrolling='yes' noresize='noresize' />
</frameset>
<noframes><body>
<a href='$XOOPS_URL' target='_top'>Follow this link, oh frameless creature</a>
</body></noframes>
</html>"
?>
Example of a template conditional (system_block_mainmenu.html):
<{if $smarty.server.HTTP_REFERER == "$XOOPS_URL/frames.php" || $smarty.server.HTTP_REFERER == "$XOOPS_URL/index.php?XXX_arbitrary_menu_token_XXX"}>
<{if $smarty.server.PHP_SELF == "$XOOPS_URL/index.php"}>
<table cellspacing="0">
<tr>
<td id="mainmenu">
<a class="menuTop" href="<{$xoops_url}>/" target="content"><{$block.lang_home}></a>
<!-- start module menu loop -->
<{foreach item=module from=$block.modules}>
<a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/" target="content"><{$module.name}></a>
<{foreach item=sublink from=$module.sublinks}>
<a class="menuSub" href="<{$sublink.url}>" target="content"><{$sublink.name}></a>
<{/foreach}>
<{/foreach}>
<!-- end module menu loop -->
</td>
</tr>
</table>
<{/if}>
<{else}>
<table cellspacing="0">
<tr>
<td id="mainmenu">
<a class="menuTop" href="<{$xoops_url}>/" ><{$block.lang_home}></a>
<!-- start module menu loop -->
<{foreach item=module from=$block.modules}>
<a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/" ><{$module.name}></a>
<{foreach item=sublink from=$module.sublinks}>
<a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
<{/foreach}>
<{/foreach}>
<!-- end module menu loop -->
</td>
</tr>
</table>
<{/if}>
However, one might prefer to leave some of the hiding game to themes, like in...
Example of a theme condidional:
<table cellspacing="0">
<tr>
<{if $smarty.server.HTTP_REFERER == "$XOOPS_URL/frames.php" ||
$smarty.server.HTTP_REFERER == "$XOOPS_URL/index.php?XXX_arbitrary_menu_token_XXX"}>
<{if $smarty.server.PHP_SELF == "$DOCUMENT_ROOT/index.php"}>
<td id="leftcolumn">
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{include file="default/theme_blockleft.html"}>
<{/foreach}>
<!-- End left blocks loop -->
</td>
<{/if}>
<{else}>
<td id="leftcolumn">
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{include file="default/theme_blockleft.html"}>
<{/foreach}>
<!-- End left blocks loop -->
</td>
<{/if}>
And that's it. Login stuff should have the menu frame as target, I guess. You can create anything from this two-frames to a "header, menu, leftblocks, centerblocks, contents, rightblocks, adspace, shoutbox, footer" setup using this basic idea. Perhaps someone can find a way to get each block as a frame
*There are many ways to set values that Smarty can understand from the wrapper. Check these links for
PHP $Server variables,
PHP Constants and
the {$smarty} reserved variable**I can't figure out a nice way to make submenus available. Thus this is a very limited "complete" solution