<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

/*
	tGuiXP_MainFrameSet
	tGuiXP_FrameTop
	tGuiXP_FrameMain
	tGuiXP_FrameHelp
 */
 
// in index.php
class tGuiXP_MainFrameSet {
	var $l_product_name = "Confixx Professional";	// todo: locale

	var $head_icon_id  = ""; 
	var $head_text = ""; 
	var $content_url   = "";
	var $menu_url = "";

	function tGuiXP_MainFrameSet($default_node = NULL) {
		
		if ($default_node === NULL) {
			// properties of default content
			$this->head_icon_id  = "overview"; 
			$this->head_text = ltext("m_overview"); 
			$this->content_url   = "allgemein_start.php";
		} else {
			$this->head_icon_id  = $default_node->getName(); 
			$this->head_text = $default_node->getText(); 
			$this->content_url   = $default_node->getContentUrl();
		}
		
		$this->menu_url = 'ver_xp30_frame_left_nav_tree.php';
	}
		
	function set_menu_url($url)
	{
		$this->menu_url = $url;	
	}
	
	function draw() {
		global $confixx_skin_dir;
		global $lang_html_charset;

		$frame_main_args = "?content_url=$this->content_url";
		$frame_top_args  = "?head_id=$this->head_icon_id&&head_text=$this->head_text";
		
// ********************************************* html ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title><?=$this->l_product_name?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$lang_html_charset?>" />
<script language="javascript">
<!--

function setScrollInIE () {
	var navL = self.leftFrame.document.getElementById ('navArea');
	self.leftFrame.document.body.scroll = (navL.clientHeight > self.leftFrame.document.documentElement.clientHeight || navL.clientWidth > self.leftFrame.document.documentElement.clientWidth) ? 'yes' : 'no';
}
ieAddScroll = '';
ieAddResize = '';
isIEdoctype = navigator.appName == 'Microsoft Internet Explorer' && document.documentElement && navigator.userAgent.indexOf ('Opera') == -1;
if (isIEdoctype) {
	ieAddScroll = ' scrolling="no"';
	ieAddResize = ' onresize="setScrollInIE();"';
}
//-->
</script>
</head>
<script language="javascript">
<!--
document.write('<frameset cols="200,*" border="0" frameborder="0" framespacing="0"><frame src="<?=$this->menu_url?>" name="leftFrame" frameborder="0" border="0" noresize="noresize"'+ieAddScroll+ieAddResize+' /><frameset rows="53,*" border="0" frameborder="0" framespacing="0" noresize="noresize"><frame src="ver_xp30_frame_top.php<?=$frame_top_args?>" name="topFrame" frameborder="0" border="0" scrolling="no" /><frame src="ver_xp30_frame_main.php<?=$frame_main_args?>" name="contentFrame" frameborder="0" border="0" scrolling="no" onresize="self.contentFrame.setFramesSizes();"/></frameset></frameset>');
//-->
</script>
<noframes>
<body>
</body>
</noframes>

</html>
<? // **************************************** end of html
	}
}

// in  ver_xp30_frame_top.php
class tGuiXP_FrameTop {
	var $id = 'menu_head_overview';
	var $text = "Header";
	
	function tGuiXP_FrameTop($id, $text) {
		$this->id = "menu_head_$id";
		$this->text = $text;
	}
	
	function draw() {
		global $confixx_skin_dir;
		global $lang_html_charset;
		
// *********************************** html ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=<?=$lang_html_charset?>"/>
	<link rel="stylesheet" type="text/css" href="<?=$confixx_skin_dir?>css/general.css"/>
	<link rel="stylesheet" type="text/css" href="<?=$confixx_skin_dir?>css/header.css"/>
	<link rel="stylesheet" type="text/css" href="<?=$confixx_skin_dir?>css/images.css"/>
</head>
<body>

	<div id="headerArea">
		<table id="headerLayout" border="0" cellpadding="0" cellspacing="0" width="100%" summary="Header Layout">
			<tr>
				<td class="icon"><div id="<?=$this->id?>"><img src="<?=$confixx_skin_dir?>images/1x1.gif" width="32" height="32" border="0" alt=""></div></td>
				<td id="title" width="100%"><?=$this->text?></td>
			</tr>
		</table>
	</div>

</body>
</html>	
<? // ******************************** end of html
	}
}

// in ver_xp30_frame_main.php
class tGuiXP_FrameMain {

	var $content_url   = "";
	var $help_head_key = "";
	var $help_text_key = "";
	
	function tGuiXP_FrameMain($content_url, $help_head_key, $help_text_key) {
		$this->content_url = $content_url;
		$this->help_head_key = $help_head_key;
		$this->help_text_key = $help_text_key;	
	}
	
	function draw() {
		global $confixx_jscript_dir;
		global $confixx_skin_dir;
		global $lang_html_charset;
		
		$frame_help_args = "?help_head_key=$this->help_head_key&help_text_key=$this->help_text_key";
// *************************************** html ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=<?=$lang_html_charset?>"/>
	<link rel="stylesheet" type="text/css" href="<?=$confixx_skin_dir?>css/general.css"/>
</head>
<script language="javascript">
<!--
var helpHeight = 20;
var iframeHeight = 0;
var mainFrameHeight = 0;
var mainFrameWidth = 0;
var x,y;
if (self.innerHeight) {// all except Explorer
	x = self.innerWidth;
	y = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
	x = document.body.clientWidth;
	y = document.body.clientHeight;
}
iframeHeight = y;
mainFrameHeight = y - helpHeight;
mainFrameWidth = x;


//-->
</script>
<script language="javascript" type="text/javascript" src="<?=$confixx_jscript_dir?>ver_xp30_iframessizes.js"></script>
<body onresize="setFramesSizes();" onLoad="setFramesSizes();">

<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
	<td width="100%" id="mainFrameTD"><script language="javascript">
	<!--
document.write ('<iframe width="'+mainFrameWidth+'" height="'+mainFrameHeight+'" name="mainFrame" id="mainFrame" frameborder="0" src="<?=$this->content_url?>" ></iframe>');
	//-->
	</script></td>
	</tr>
	<tr>
		<td><script language="javascript">
	<!--
document.write ('<iframe width="'+mainFrameWidth+'" height="'+helpHeight+'" name="helpFrame" id="helpFrame" frameborder="0" src="ver_xp30_frame_help.php<?=$frame_help_args?>"'+parent.ieAddScroll+'></iframe>');
	//-->
	</script></td>
</tr>
</table>
<script language="javascript">
<!--
//-->
</script>
   </body>
</html>
<? // ************************************ end of html
	}
}

// in ver_xp30_frame_help.php
class tGuiXP_FrameHelp {
	var $l_help_header  = "help";				
	var $l_help_header2 = "Sample help header.";	// todo: locale
	var $l_help_text    = "Sample help text.";	// todo: locale
		
	var $l_hide_help   = "hide help";
	var $l_show_help   = "show help";
	
	
	function tGuiXP_FrameHelp($header, $text)  {
		$this->l_help_header = ltext('help_frame__header');				
		$this->l_hide_help   = ltext('help_frame__hide');
		$this->l_show_help   = ltext('help_frame__show');
		
		$this->l_help_text = $text;
		$this->l_help_header2 = $header;
	}
	
	function draw() {
		global $confixx_jscript_dir;
		global $confixx_skin_dir;
		global $lang_html_charset;

// *************************************** html ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$lang_html_charset?>"/>
<link rel="stylesheet" type="text/css" href="<?=$confixx_skin_dir?>css/general.css"/>
<link rel="stylesheet" type="text/css" href="<?=$confixx_skin_dir?>css/help.css"/>

</head>
<script language="javascript">
<!--

//-->
</script>
<body>
<div id="helpArea">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr id="helpHeader" valign="middle">
	<td><img src="<?=$confixx_skin_dir?>images/help.gif" width="16" height="16" border="0" alt="<?=$this->l_help_header?>" align="middle"></td>
	<td id="helpTitle" width="100%"><?=$this->l_help_header?></td>
<td id="helpControls">
<div id="helpHandleShow" style="display:block;"><a href="#" onClick="return parent.setHelpHeight(true);"><?=$this->l_show_help?></a>&nbsp;<a href="#" onClick="return parent.setHelpHeight(true);"><img src="<?=$confixx_skin_dir?>images/show_help.gif" width="11" height="10" border="0" alt="<?=$this->l_show_help?>" align="middle"></a></div>
<div id="helpHandleHide" style="display:none;"><a href="#" onClick="return parent.setHelpHeight(false);"><?=$this->l_hide_help?></a>&nbsp;<a href="#" onClick="return parent.setHelpHeight(false);"><img src="<?=$confixx_skin_dir?>images/hide_help.gif" width="11" height="10" border="0" alt="<?=$this->l_hide_help?>" align="middle"></a></div>
</td></tr>
<tr>
	<td colspan="3"><table border="0" cellspacing="0" cellpadding="0" style="display: none;" id="helpContent" width="100%"><tr><td>


<?=$this->l_help_text?>	
	
	</td></tr></table></td>
</tr>
</table>
<div></div>
<script language="javascript">
<!--
	// fix for the case of recalling help content in opened state
	var helpContent = document.getElementById ('helpContent');
	if (parent.isHelpOpened) {
		parent.setHelpHeight(true);
	}
//-->
</script>
</div>
</body>
</html>
<? // ************************************ end of html
	}
}

?>
