<?php
/* -----------------------------------------------------------------------------------------
    $Id: xtc_wysiwyg.inc.php,v 1.1.1.1 2008/10/27 07:55:42 cvs Exp $   
   
    XT-Commerce - community made shopping
    http://www.xt-commerce.com/
    
    H.H.G. group
    Hasan H. Gürsoy
	 
    Copyright (c) 2005 XT-Commerce & H.H.G. group
		   
    Released under the GNU General Public License 
---------------------------------------------------------------------------------------*/

function xtc_wysiwyg($type, $lang, $langID = '') {
global $_SESSION;
$js_src = DIR_WS_MODULES .'FCKeditor/fckeditor.js';
$path = DIR_WS_MODULES .'FCKeditor/';
$filemanager = '../filemanager/browser/mcpuk/browser.html?Connector=connectors/php/connector.php&ServerPath='. DIR_WS_CATALOG;
$file_path = '&Type=media';
$image_path = '&Type=images';

	switch($type) {
                // WYSIWYG editor mailmaster reply
                case 'mailbody':
						
			//<script type="text/javascript" src="../../fckeditor.js"></script>
			$val ='<script type="text/javascript" src="'.$js_src.'"></script>
                        	   <script type="text/javascript">
                        	   		window.onload = function()
                        	   			{
                        	   				var oFCKeditor = new FCKeditor( \'mailbody\', \'850\', \'500\' ) ;
                        	   				oFCKeditor.BasePath = "'.$path.'" ;
								oFCKeditor.ToolbarSet = \'YESMinimal\' ;
                        	   				oFCKeditor.Config["LinkBrowserURL"] = "'.$filemanager.$file_path.'" ;
                        	   				oFCKeditor.Config["ImageBrowserURL"] = "'.$filemanager.$image_path.'" ;
                        	   				oFCKeditor.Config["AutoDetectLanguage"] = false ;
                        	   				oFCKeditor.Config["customers_id"] = '.$_SESSION['customer_id'].' ;
								oFCKeditor.Config["SkinPath"] = \'skins/office2003/\' ;
                        	   				oFCKeditor.Config["DefaultLanguage"] = "'.$lang.'" ;
                        	   				oFCKeditor.ReplaceTextarea() ;
                        	   			}
                        	   	</script>';
                        break;
                // others
                default:
                        $val ='<script type="text/javascript" src="'.$js_src.'"></script>
                        	   <script type="text/javascript">
                        	   		window.onload = function()
                        	   			{
                        	   				var oFCKeditor = new FCKeditor( \''.$type.'\', \'700\', \'400\' ) ;
                        	   				oFCKeditor.BasePath = "'.$path.'" ;
								oFCKeditor.ToolbarSet = \'YESFull\' ;
                        	   				oFCKeditor.Config["LinkBrowserURL"] = "'.$filemanager.$file_path.'" ;
                        	   				oFCKeditor.Config["ImageBrowserURL"] = "'.$filemanager.$image_path.'" ;
                        	   				oFCKeditor.Config["AutoDetectLanguage"] = false ;
								oFCKeditor.Config["SkinPath"] = \'skins/office2003/\' ;
                        	   				oFCKeditor.Config["customers_id"] = '.$_SESSION['customer_id'].' ;
                        	   				oFCKeditor.Config["DefaultLanguage"] = "'.$lang.'" ;
                        	   				oFCKeditor.ReplaceTextarea() ;
                        	   			}
                        	   	</script>';
                        break;
    }
    
   	return $val;

}
?>
