Location: PHPKode > projects > Netautor Professional > netautor/napro4/appl/na_professional/editor_applet.php
<?php
/* +----------------------------------------------------------------------+
   | Netautor Professional Application Server                             |
   +----------------------------------------------------------------------+
   | Copyright (C) 1998-2002 digiconcept GmbH. <www.digiconcept.net>      |
   +----------------------------------------------------------------------+
   | This file is subject to license, that is bundled with this package   |
   | in the file LICENSE.TXT, and is available at through the             |
   | world-wide-web at http://www.netautor.com/license/                   |
   |                                                                      |
   | If you did not receive a copy of the license and are unable to       |
   | obtain it through the world-wide-web, please send a note to          |
   | hide@address.com so we can mail you a copy.                      |
   +----------------------------------------------------------------------+
   | Authors: Stefan Rottensteiner <hide@address.com>    |
   |          Gregor Wollner                                              |
   |          Helli  Kleinhans     <hide@address.com>         |
   +----------------------------------------------------------------------+*/

  	if(empty($GLOBALS['DC_ENV'])) include_once '../../include/init.inc'; 

	// use java-plugin or applet-code
	$use_plugin	=	($USER->check_feature('use_plugin'));

$form= (empty($form)?0:"'$form'");
$element= (empty($element)?0:"'$element'");
if (empty($font_size)) $font_size=12;
if (empty($font_name)) $font_name='arial';

if (empty($applet_external))
{
	$callEmailURL 		= 'internal';
	$callEmailTarget 	= 'XEditorPreview';
	$callLinkURL 		= 'internal';
	$callLinkTarget 	= 'XEditorPreview';
	$callImageURL 		= 'internal';
	$callImageTarget 	= 'XEditorPreview';
}
else
{
	$callImageURL		= '../appl/na_professional/editor_magic.php3?call=applet_link.html';
	$callImageTarget 	= 'editor_magic';
	$callEmailURL		= '../appl/na_professional/editor_magic.php3?call=applet_link.html&protocol=mailto';
	$callEmailTarget 	= 'editor_magic';
	$callLinkURL		= '../appl/na_professional/editor_magic.php3?call=applet_link.html';
	$callLinkTarget 	= 'editor_magic';
}
?><html>
<head>
	<title>digiconcept/netautor/Editor - Applet</title>
	<meta http-equiv="pragma" 				content="no-cache">
	<meta http-equiv="cache-control"	 	content="no-cache">
	<meta http-equiv="Content-Style-Type" 	content="text/css">
	<meta name	="robots" 					content="noindex">		
</head>
<script language="JavaScript" type="text/javascript">    
	function customizeApplet()
    {
		if (window.parent.opener)
		{
		 UserText = window.parent.opener.document.forms[<?php echo($form);?>].elements[<?php echo($element);?>].value;
		}
		else
		{
		 UserText='';
		}

		UserText = (UserText && UserText.length > 0 ? UserText : " " );
		UserText = UserText.substring(0);

		if (document.applets['XEditor']) {
			document.applets['XEditor'].setText(UserText);
			return true;
		}
		if (document.all && document.all.XEditor ){
			document.all.XEditor.setText(UserText);
			return true;
		}		
		if (document.embeds && document.embeds['XEditor'] ){
			document.embeds['XEditor'].setText(UserText);
			return true;
		}		
		if (document && document.XEditor ){
			document.XEditor.setText(UserText);
			return true;
		}		
		
    };
	var textToSet	=	"";
	function retrySetText(){
	}

    function getIt()
    {
		var UserText = "";

		if (document.applets['XEditor']) {
			UserText = document.applets['XEditor'].getText();
		}
		else 
		if (document.all && document.all.XEditor ){
			UserText = document.all.XEditor.getText();		
		}
		else 
		if (document.embeds && document.embeds['XEditor'] ){
			UserText = document.embeds['XEditor'].getText();		
		}
		else
		if (document && document.XEditor ){
			UserText = document.XEditor.getText();
		}		
		if (!UserText || UserText.length ==0 ) UserText="";
		UserText = UserText.substring(0);
		window.parent.opener.document.forms[<?php echo($form);?>].elements[<?php echo($element);?>].value = ""+UserText;
        window.parent.close();
    };
</script>

<body bgcolor="#A0A0A0" onLoad="window.setTimeout('customizeApplet();',500);">
<form>
<div align="center">
<?php 
if ($use_plugin) 
{
?>
<OBJECT classid		="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    	WIDTH 		= "100%" 
		HEIGHT 		= "455"  
    	codebase	="http://java.sun.com/products/plugin/1.3.1/jinstall-131-win32.cab#Version=1,3,1,0" 
		name		="XEditor" 
		archive		="Xeditor.jar" 
		mayscript	="true" 
		scriptable	="true" 
		standby		="Please be patient while the PlugIn and the applet are loading .." >
	<PARAM NAME = "CODE" 			VALUE = "Xeditor.class" >
	<PARAM NAME = "CODEBASE" 		VALUE = "../../java/" >
    <PARAM NAME	="type"  			VALUE = "application/x-java-applet;jpi-version=1.3.1">
    <PARAM NAME ="scriptable" 		VALUE ="true">
	<PARAM NAME ="mayscript" 		VALUE ="true">

				<PARAM NAME="archive"           VALUE="Xeditor.jar">
				<PARAM NAME="text"              VALUE=" ">
				<PARAM NAME="fontsize"          VALUE="<?php echo($font_size);?>">
				<PARAM NAME="fontname"          VALUE="<?php echo($font_name);?>">
				
				<PARAM NAME="loadImageButton"   VALUE="0">
				<PARAM NAME="_callImageURL"      VALUE="<?php echo($callImageURL);?>">
				<PARAM NAME="_callImageTarget"   VALUE="<?php echo($callImageTarget);?>">
								
				<PARAM NAME="loadEMailButton"   VALUE="1">
				<PARAM NAME="_callEmailURL"      VALUE="<?php echo($callEmailURL);?>">
				<PARAM NAME="_callEMailTarget"   VALUE="<?php echo($callEmailTarget);?>">
				
				<PARAM NAME="loadLinkButton"    VALUE="1">
				<PARAM NAME="_callLinkURL"       VALUE="<?php echo($callLinkURL);?>">
				<PARAM NAME="_callLinkTarget"    VALUE="<?php echo($callLinkTarget);?>">
<COMMENT>
	<EMBED  type		="application/x-java-applet;jpi-version=1.3.1" 
            CODE 		="Xeditor.class"
			CODEBASE	="../../java/"
            WIDTH   	="100%"
            HEIGHT  	="455" 
	    	scriptable	="true" 
	    	pluginspage ="http://java.sun.com/products/plugin/index.html#download" 
			alt			="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."			

			NAME			="XEditor"			
			archive			="Xeditor.jar" 
			mayscript		="true" 
			text			=" " 
			fontsize		="<?php echo($font_size);?>"
			fontname 		="<?php echo($font_name);?>"
			loadImageButton	="0"
			_callImageURL	="<?php echo($callImageURL);?>"
			_callImageTarget ="<?php echo($callImageTarget);?>"

			loadEMailButton	="1" 
			_callEmailURL	="<?php echo($callEmailURL);?>"
			_callEMailTarget	="<?php echo($callEmailTarget);?>"
				
			loadLinkButton	="1"
			_callLinkURL		="<?php echo($callLinkURL);?>"
			_callLinkTarget	="<?php echo($callLinkTarget);?>"
		>
	        <NOEMBED>
	Your browser is completely ignoring the &lt;APPLET&gt; tag!
		</NOEMBED>
	</EMBED>
</COMMENT>
</OBJECT>
<?php 
}
else
{	// start of : dont use plugin
?>
			<applet code		="Xeditor.class" 
					codebase	="../../java/" 
					archive		="Xeditor.jar" 					
					name	="XEditor" 
					alt		="Cannot start XEditor"
					align	="top"
					width	="100%"
					height	="455"
					hspace	="2"
					vspace	="2"
					mayscript>
				<PARAM NAME="archive"           VALUE="Xeditor.jar">
				<PARAM NAME="text"              VALUE=" ">
				<PARAM NAME="fontsize"          VALUE="<?php echo($font_size);?>">
				<PARAM NAME="fontname"          VALUE="<?php echo($font_name);?>">
				
				<PARAM NAME="loadImageButton"   VALUE="0">
				<PARAM NAME="_callImageURL"      VALUE="<?php echo($callImageURL);?>">
				<PARAM NAME="_callImageTarget"   VALUE="<?php echo($callImageTarget);?>">
								
				<PARAM NAME="loadEMailButton"   VALUE="1">
				<PARAM NAME="_callEmailURL"      VALUE="<?php echo($callEmailURL);?>">
				<PARAM NAME="_callEMailTarget"   VALUE="<?php echo($callEmailTarget);?>">
				
				<PARAM NAME="loadLinkButton"    VALUE="1">
				<PARAM NAME="_callLinkURL"       VALUE="<?php echo($callLinkURL);?>">
				<PARAM NAME="_callLinkTarget"    VALUE="<?php echo($callLinkTarget);?>">
				<XPARAM NAME="fontlist"          VALUE="ZapfDings,Mathematica,Verdana" >				
				Please activate Java and JavaScript !!				
			</applet>
<?php
}	// end of : dont use plug-in
?>
</div>			
<table width='100%'>
	<tr>
		<td width="100%" align="center">
			<INPUT width='30%' TYPE="button" VALUE="&Uuml;bernehmen" onClick="getIt();">
		&nbsp;&nbsp;&nbsp;&nbsp;
			<INPUT TYPE="button" width='30%' VALUE="Abbruch"  onClick="window.parent.close();">
		</td>
	</tr>
</table>
</body>
</html>
Return current item: Netautor Professional