<?php
/**	*************************************************************************************************************
*	install.php                                                                                                  
*	-------------------------------------------------------------------------------------------------------------
*	@author     Mario Gleichmann                                                                                 
*	@package    Joomla                                                                                           
*	@version    1.1.1                                                                                            
*	@copyright  Copyright (C) 2009 Mario Gleichmann. All rights reserved.                                        
*	@mail       mgleich@orcas-internet.de                                                                        
*	@license    GNU/GPL, see LICENSE.php                                                                         
*	                                                                                                             
*	Joomla! is free software. This version may have been modified pursuant to the GNU General Public License, and
*	as distributed it includes or is derivative of works licensed under the GNU General Public License or other  
*	free or open source software licenses. See COPYRIGHT.php for copyright notices and details.                  
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-de" lang="de-de" dir="ltr" >
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
	<title>Install of Olark Chat Module for Joomla 1.5</title>
</head>
<body>
<?php
$tFiles=array();
$tFiles[]="mgnote.php";
$tFiles[]="mgtext.php";
$tFiles[]="mgspacer.php";

define(DS, "/");

$sSourcePath = '..'.DS.'..'.DS.'modules'.DS.'mod_olark_chat';
$sTargetPath = '..'.DS.'..'.DS.'libraries'.DS.'joomla'.DS.'html'.DS.'parameter'.DS.'element';

foreach($tFiles as $sFile)
{
	if(file_exists($sTargetPath.DS.$sFile))
	{
		$sDateExt="";
		$sDate=date("YmdHis");
		while(file_exists($sTargetPath.DS.$sFile.".".$sDate.$sDateExt))
		{
			if($sDateExt == "")
				$sDateExt="0";
			$sDateExt++;
		}
		echo "Backup existing file '".$sTargetPath.DS.$sFile."' to '".$sTargetPath.DS.$sFile.".".$sDate.$sDateExt."'<br />\n";
		rename($sTargetPath.DS.$sFile, $sTargetPath.DS.$sFile.".".$sDate.$sDateExt);
	}
	echo "Install '".$sSourcePath.DS.$sFile."' to '".$sTargetPath.DS.$sFile."'.<br />\n";
	copy($sSourcePath.DS.$sFile, $sTargetPath.DS.$sFile);
}
?>
<br />
Goto module administration <a href="../../administrator/index.php?option=com_modules">here</a>.
</body>
</html>