Файл: EasyHost v2.0/system/htdocs/manager/files/wysiwyg/image.html
Строк: 313
<?php
<html>
<head>
<link rel="stylesheet" type="text/css" href="<{system.htdocs}>styles/<{system.color}>/default.css" />
<title>Insert Image</title>
<script language="JavaScript">
<!--
function attr( name, value )
{
if (!value || value == "") return "";
return ' ' + name + '="' + value + '"';
}
function insert()
{
var form = document.getElementById( 'form' );
var html = '<IMG border="0"' + attr( "alt", form.alt.value ) + attr( "src", form.url.value )
+ attr( "align", form.align.options[ form.align.selectedIndex ].value )
+ '/>';
insertHTML( html );
window.close();
}
function insert2()
{
var form = document.getElementById( 'uploadForm' );
var html = '<IMG border="0"' + attr( "alt", form.alt2.value ) + attr( "src", form.url2.value )
+ attr( "align", form.align2[ form.align2.selectedIndex ].value )
+ '/>';
insertHTML( html );
window.close();
}
function cancel()
{
window.close();
}
function tab(id)
{
if (id == 1)
{
document.getElementById('tab2').style.visibility = 'hidden';
document.getElementById('tab1').style.visibility = 'visible';
}
else
{
document.getElementById('tab1').style.visibility = 'hidden';
document.getElementById('tab2').style.visibility = 'visible';
}
return true;
}
function upload()
{
var uploadWindow = window.open('<{system.url('upload')}>','upload','toolbar=no,width=200,height=80,directories=no,status=no,scrollbars=no,menubar=no,location=no,resizable=no');
}
function insertHTML( html )
{
rte = window.opener.document.getElementById( 'page' ).contentWindow;
rte.focus();
if ( document.all )
{
var range = rte.document.selection.createRange();
range.pasteHTML( html );
}
else
{
rte.document.execCommand( 'insertHTML', false, html );
}
}
function getRange( sel )
{
if ( document.all )
{
return sel.createRange();
}
else
{
var rte = window.opener.document.getElementById( 'page' ).contentWindow;
if (typeof sel != "undefined")
{
try
{
return sel.getRangeAt(0);
}
catch(e)
{
return rte.document.createRange();
}
}
else
{
return rte.document.createRange();
}
}
}
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="<{system.color('left_bg')}>">
<form id="form">
<table botder="0" cellspacing="10" cellpadding="0" width="100%" id="tab1" style="position: absolute"><tr><td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="<{system.color('highlight_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topleft_left.gif" alt="["></td>
<td bgcolor="<{system.color('highlight_bg')}>">
<table border="0" cellspacing="0" cellpadding="0" height="24">
<tr>
<td height="1" bgcolor="<{system.color('border')}>"><img src="<{system.htdocs}>images/blank.gif" width="1" height="1" /></td>
</tr>
<tr>
<td height="23"><a href="#" onclick="tab(1)"><font color="#000000">Select an Image</font></a></td>
</tr>
</table>
</td>
<td bgcolor="<{system.color('highlight_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topmiddle_left.gif" alt="|"></td>
<td bgcolor="<{system.color('content_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topleft_left.gif" alt="["></td>
<td bgcolor="<{system.color('content_bg')}>">
<table border="0" cellspacing="0" cellpadding="0" height="24">
<tr>
<td height="1" bgcolor="<{system.color('border')}>"><img src="<{system.htdocs}>images/blank.gif" width="1" height="1" /></td>
</tr>
<tr>
<td height="23"><a href="#" onclick="tab(2)">Upload an Image</a></td>
</tr>
</table>
</td>
<td bgcolor="<{system.color('content_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topmiddle_left.gif" alt="|"></td>
<td><img src="<{system.htdocs}>styles/<{system.color}>/topright_left.gif" alt="]"></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td bgcolor="<{system.color('border')}>">
<table border="0" cellspacing="1" cellpadding="0" width="100%">
<tr>
<td bgcolor="<{system.color('content_bg')}>">
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="80">Local:</td>
<td>
<select name="image" onchange="document.getElementById('form').url.value = this.options[this.selectedIndex].value; document.images.preview.src = this.options[this.selectedIndex].value">
<option value="<{system.htdocs}>images/preview.gif"> - Select One - </option>
<%images%>
<option value="<{image.url}>"><{image.path}></option>
<%end%>
</select>
</td>
</tr>
<tr>
<td width="80">URL:</td>
<td><input type="text" name="url" size="45" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" align="center"><img src="<{system.htdocs}>images/preview.gif" id="preview" height="180"></td>
</tr>
<tr>
<td bgcolor="<{system.color('content_bg')}>">
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td><b>Attributes</b></td>
</tr>
</table>
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="80">Text:</td>
<td><input type="text" name="alt" size="45" /></td>
</tr>
<tr>
<td width="80">Align:</td>
<td>
<select name="align">
<option value=""> - Select One - </option>
<option value="left">Left</option>
<option value="absbottom">Abs Bottom</option>
<option value="absmiddle">Abs Middle</option>
<option value="baseline">Baseline</option>
<option value="bottom">Bottom</option>
<option value="middle">Middle</option>
<option value="right">Right</option>
<option value="texttop">Text Top</option>
<option value="top">Top</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="3" width="100%" bgcolor="<{system.color('highlight_bg')}>">
<tr>
<td class="buttons">
<input type="button" value="Insert" onclick="insert()" />
<input type="button" value="Cancel" onclick="cancel()" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>
</form>
<table botder="0" cellspacing="10" cellpadding="0" width="100%" id="tab2" style="position: absolute; visibility: hidden"><tr><td>
<form method="post" enctype="multipart/form-data" target="upload" id="uploadForm">
<input type="hidden" name="command" value="manager/files/wysiwyg/upload" />
<input type="hidden" name="url2" value="" />
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="<{system.color('content_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topleft_left.gif" alt="["></td>
<td bgcolor="<{system.color('content_bg')}>">
<table border="0" cellspacing="0" cellpadding="0" height="24">
<tr>
<td height="1" bgcolor="<{system.color('border')}>"><img src="<{system.htdocs}>images/blank.gif" width="1" height="1" /></td>
</tr>
<tr>
<td height="23"><a href="#" onclick="tab(1)">Select an Image</a></td>
</tr>
</table>
</td>
<td bgcolor="<{system.color('content_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topmiddle_left.gif" alt="|"></td>
<td bgcolor="<{system.color('highlight_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topleft_left.gif" alt="["></td>
<td bgcolor="<{system.color('highlight_bg')}>">
<table border="0" cellspacing="0" cellpadding="0" height="24">
<tr>
<td height="1" bgcolor="<{system.color('border')}>"><img src="<{system.htdocs}>images/blank.gif" width="1" height="1" /></td>
</tr>
<tr>
<td height="23"><a href="#" onclick="tab(2)"><font color="#000000">Upload an Image</font></a></td>
</tr>
</table>
</td>
<td bgcolor="<{system.color('highlight_bg')}>"><img src="<{system.htdocs}>styles/<{system.color}>/topmiddle_left.gif" alt="|"></td>
<td><img src="<{system.htdocs}>styles/<{system.color}>/topright_left.gif" alt="]"></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td bgcolor="<{system.color('border')}>">
<table border="0" cellspacing="1" cellpadding="0" width="100%">
<tr>
<td bgcolor="<{system.color('content_bg')}>">
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="80">Image:</td>
<td><input type="file" name="file" size="20" /> <input type="submit" value="Upload" onclick="upload()" /></td>
</tr>
<tr>
<td width="80">Directory:</td>
<td>
<select size="1" name="directory">
<%directories%>
<option value="<{directory.path}>"<%if:"{directory} == {login.directory}"%> selected="selected"<%end%>><{directory.path}></option>
<%end%>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" align="center"><img src="<{system.htdocs}>images/preview.gif" id="preview2" height="180"></td>
</tr>
<tr>
<td bgcolor="<{system.color('content_bg')}>">
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td><b>Attributes</b></td>
</tr>
</table>
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="80">Text:</td>
<td><input type="text" name="alt2" size="45" /></td>
</tr>
<tr>
<td width="80">Align:</td>
<td>
<select name="align2">
<option value=""> - Select One - </option>
<option value="left">Left</option>
<option value="absbottom">Abs Bottom</option>
<option value="absmiddle">Abs Middle</option>
<option value="baseline">Baseline</option>
<option value="bottom">Bottom</option>
<option value="middle">Middle</option>
<option value="right">Right</option>
<option value="texttop">Text Top</option>
<option value="top">Top</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="3" width="100%" bgcolor="<{system.color('highlight_bg')}>">
<tr>
<td<%if:"{system.env('HTTP_USER_AGENT')} !~ /mozilla/4/i || {system.env('HTTP_USER_AGENT')} =~ /compatible/i"%> class="buttons"<%end%>>
<input type="button" value="Insert" onclick="insert2()" />
<input type="button" value="Cancel" onclick="cancel()" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>
</body>
</html>
?>