Файл: EasyHost v2.0/system/htdocs/manager/files/file/default.html
Строк: 805
<?php
<%if:"{system.cookie('designMode')} eq 'true' && {file.type} eq 'html' && {login.user.config('disable_wysiwyg')} != 1"%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<{system.htdocs}>styles/<{system.service.config('color')}>/default.css" />
<style type="text/css">
<!--
.icon
{
cursor: hand;
}
body, img, .icon, td, tr, table, form, div, *
{
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
}
.document
{
border: solid 1px #666666;
width: 100%;
height: 100%;
}
//-->
</style>
<script type="text/javascript" language="javascript">
<!--
window.onload = init;
var initcolor = null;
buttons = new Array('bold','italic','underline','justifyleft','justifycenter','justifyright','justifyfull','insertorderedlist','insertunorderedlist');
function init()
{
document.body.ondrag = function () { return false; };
document.body.onselectstart = function () { return false; };
document.getElementById('page').unselectable = 'off';
document.getElementById('form').input.unselectable = 'off';
document.getElementById('page').contentWindow.document.designMode = 'on';
if ( document.all )
{
document.getElementById('page').contentWindow.document.execCommand('LiveResize',true,true);
document.getElementById('page').contentWindow.document.execCommand('2D-Position',true,true);
document.getElementById('page').contentWindow.document.execCommand('MultipleSelection',true,true);
}
}
function changestyle( element )
{
document.getElementById('page').contentWindow.document.execCommand(element.id,false,element.options[element.selectedIndex].value);
}
function insert( name, width, height )
{
html = window.open("<{system.url('/manager/files/wysiwyg')}>/" + name,null,"width="+width+", height="+height+", toolbar=0, location=0, directories=0, resizable=0, status=0, menubar=0, scrollbars=0");
}
function inserthref()
{
html = window.open("<{system.url('/manager/files/wysiwyg/href')}>",null,"width=400, height=385, toolbar=0, location=0, directories=0, resizable=0, status=0, menubar=0, scrollbars=0");
}
function exec( event )
{
if ( window.event ) event = window.event;
var srcElement = event.srcElement ? event.srcElement : event.target;
if (srcElement && srcElement.nodeName == "IMG" && srcElement.id)
document.getElementById('page').contentWindow.document.execCommand(srcElement.id,false,false);
}
function reset()
{
for (i = 0;i < buttons.length;i++)
{
if (document.getElementById('page').contentWindow.document.queryCommandValue(buttons[i]))
document.images[buttons[i]].className = 'icon_select';
else
document.images[buttons[i]].className = 'icon_select';
}
}
function preview()
{
var preview = window.open("#","preview","toolbar=no,width=600,height=400,directories=no,status=no,scrollbars=yes,menubar=no,location=no,resizable=yes");
if (document.getElementById('mode_easy').style.display != 'none')
preview.document.write(getOuterHTML());
else
preview.document.write(document.getElementById('form').input.value);
}
function getOuterHTML()
{
var element = document.getElementById('page').contentWindow.document.documentElement;
if ( element.outerHTML )
return element.outerHTML;
else
return (new XMLSerializer()).serializeToString(element);
}
function save()
{
if (document.getElementById('mode_easy').style.visibility == 'hidden')
mode();
document.getElementById('form').input.value = getOuterHTML();
document.getElementById('form').submit();
}
function mode()
{
if (document.getElementById('mode_easy').style.visibility != 'hidden')
{
var doc = document.getElementById('page').contentWindow.document;
if ( document.all )
document.getElementById('form').input.value = doc.documentElement.outerHTML;
else
document.getElementById('form').input.value = doc.body.innerHTML;
document.getElementById('page').contentWindow.document.designMode = 'off';
document.getElementById('mode_easy').style.visibility = 'hidden';
document.getElementById('mode_text').style.visibility = 'visible';
}
else
{
document.getElementById('mode_text').style.visibility = 'hidden';
document.getElementById('mode_easy').style.visibility = 'visible';
var doc = document.getElementById('page').contentWindow.document;
if ( document.all )
{
page.document.location.href = 'about:blank';
page.document.write(document.all.input.value);
}
else
{
doc.body.innerHTML = document.getElementById( 'form' ).input.value;
}
doc.designMode = 'on';
}
}
function toolbar(name)
{
if (document.getElementById("toolbar_" + name).style.display == 'none')
{
document.getElementById("toolbar_" + name + '_hidden').style.display = 'none';
document.getElementById("toolbar_" + name).style.display = 'block';
}
else
{
document.getElementById("toolbar_" + name).style.display = 'none';
document.getElementById("toolbar_" + name + '_hidden').style.display = 'block';
}
}
<%if:"{system.env('HTTP_USER_AGENT')} =~ /MSIE [6-9]/i"%>
function color(type)
{
if (initcolor == null)
{
var color = dlghelper.ChooseColorDlg();
}
else
{
var color = dlghelper.ChooseColorDlg(initcolor);
}
if (color)
{
color = color.toString(16);
if (color.length < 6)
{
var temp = "000000".substring(0,6-color.length);
color = temp.concat(color);
}
}
else
{
var color = "000000000000";
}
document.getElementById('page').contentWindow.document.execCommand(type,false,color);
initcolor = color;
}
<%end%>
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" rightmargin="0" bottomargin="0" bgcolor="<{system.color('body_bg')}>" scroll="no" onload="init()" style="overflow: hidden;">
<form method="post" id="form">
<input type="hidden" name="file" value="<{file.name}>" />
<input type="hidden" name="command" value="manager/files/file" />
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" onmousedown="exec(event);" id="mode_easy" style="visibility: visible; position: absolute; ">
<tr>
<td bgcolor="<{system.color('border')}>">
<table border="0" cellspacing="1" cellpadding="0" width="100%" height="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="25" bgcolor="<{system.color('link')}>" background="<{system.htdocs}>styles/<{system.color}>/titlebg.gif">
<tr>
<td><font color="#ffffff"><b> Edit <{file.name}></b></font></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="5" width="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td>
<img src="<{system.htdocs}>images/wysiwyg/cut.gif" alt="Cut" id="cut" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/copy.gif" alt="Copy" id="copy" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/paste.gif" alt="Paste" id="paste" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/undo.gif" alt="Undo" id="undo" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/redo.gif" alt="Redo" id="redo" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/table.gif" alt="Insert table" onclick="insert('table',400,425)" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/image.gif" alt="Insert image" onclick="insert('image',400,460)" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/link.gif" alt="Insert link" onclick="inserthref()" class="icon" /> <!-- id="createlink" -->
<img src="<{system.htdocs}>images/wysiwyg/marquee.gif" alt="Insert marquee" id="insertmarquee" class="icon" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="5" width="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td>
<img src="<{system.htdocs}>images/wysiwyg/bold.gif" alt="Bold" id="bold" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/italic.gif" alt="Italic" id="italic" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/underline.gif" alt="Underline" id="underline" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/left.gif" alt="Left" id="justifyleft" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/center.gif" alt="Center" id="justifycenter" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/right.gif" alt="Right" id="justifyright" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/justify.gif" alt="Justify" id="justifyfull" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/size_increase.gif" alt="Increase font size" onclick="var doc = document.getElementById('page').contentWindow.document; if ( doc.all ) doc.execCommand('fontsize',false,doc.queryCommandValue('fontsize') + 1); else doc.execCommand('increasefontsize',false,false)" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/size_decrease.gif" alt="Decrease font size" onclick="var doc = document.getElementById('page').contentWindow.document; if ( doc.all ) doc.execCommand('fontsize',false,doc.queryCommandValue('fontsize') - 1); else doc.execCommand('decreasefontsize',false,false)" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/numbering.gif" alt="Numbering" id="insertorderedlist" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/bullets.gif" alt="Bullets" id="insertunorderedlist" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/outdent.gif" alt="Outdent" id="outdent" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/indent.gif" alt="Indent" id="indent" class="icon" />
<%if:"{system.env('HTTP_USER_AGENT')} =~ /MSIE [6-9]/i"%>
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/highlight.gif" alt="Highlight" onclick="color('backcolor')" class="icon" />
<img src="<{system.htdocs}>images/wysiwyg/color.gif" alt="Color" onclick="color('forecolor')" class="icon" />
<%end%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="5" width="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Style</td>
<td> </td>
<td>
<select id="formatblock" onchange="changestyle(this)">
<option value="Normal"> - Default - </option>
<option value="<h1>">Address</option>
<option value="<li>">Bulleted List</option>
<option value="Definition">Definition</option>
<option value="Definition Term">Definition Term</option>
<option value="Directory List">Directory List</option>
<option value="<pre>">Formatted</option>
<option value="<h1>">Heading 1</option>
<option value="<h2>">Heading 2</option>
<option value="<h3>">Heading 3</option>
<option value="<h4>">Heading 4</option>
<option value="<h5>">Heading 5</option>
<option value="<h6>">Heading 6</option>
<option value="<p>">Paragraph</option>
</select>
</td>
<td> </td>
<td>Font</td>
<td> </td>
<td>
<select id="fontname" onchange="changestyle(this)">
<option value=""> - Default - </option>
<option value="Arial">Arial</option>
<option value="Courier New">Courier New</option>
<option value="Georgia">Georgia</option>
<option value="Tahoma">Tahoma</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Verdana">Verdana</option>
</select>
</td>
<td> </td>
<td>Size</td>
<td> </td>
<td>
<select id="FontSize" onchange="changestyle(this)">
<option value="3"> - Default - </option>
<option value="1">1 ( 8pt)</option>
<option value="2">2 (10pt)</option>
<option value="3">3 (12pt)</option>
<option value="4">4 (14pt)</option>
<option value="5">5 (18pt)</option>
<option value="6">6 (24pt)</option>
<option value="7">7 (36pt)</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="100%">
<table border="0" cellspacing="0" cellpadding="10" width="100%" height="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td height="100%"><iframe src="<{system.url('display')}>&file=<{file.name}>" id="page" width="100%" height="100%" style="border: solid 1px #666666; background: white" frameborder="0"></iframe></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="Save Changes" onclick="save()" />
<input type="button" value="Preview" onclick="preview()" />
<input type="button" value="Cancel" onclick="history.back(-1)" />
<input type="button" value="Text Mode" onclick="mode()" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="mode_text" style="visibility: hidden; position: absolute; moz-user-select: none">
<tr>
<td bgcolor="<{system.color('border')}>">
<table border="0" cellspacing="1" cellpadding="0" width="100%" height="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="25" bgcolor="<{system.color('link')}>" background="<{system.htdocs}>styles/<{system.color}>/titlebg.gif">
<tr>
<td><font color="#ffffff"><b> Edit <{file.name}></b></font></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="5" width="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td nowrap="nowrap">
<img src="<{system.htdocs}>images/wysiwyg/cut.gif" alt="Cut" id="cut" class="icon" onclick="document.execCommand(this.id,true)" />
<img src="<{system.htdocs}>images/wysiwyg/copy.gif" alt="Copy" id="copy" class="icon" onclick="document.execCommand(this.id,true)" />
<img src="<{system.htdocs}>images/wysiwyg/paste.gif" alt="Paste" id="paste" class="icon" onclick="document.execCommand(this.id,true)" />
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/undo.gif" alt="Undo" id="undo" class="icon" onclick="document.execCommand(this.id,true)" />
<img src="<{system.htdocs}>images/wysiwyg/redo.gif" alt="Redo" id="redo" class="icon" onclick="document.execCommand(this.id,true)" />
</td>
<td align="right">
<input name="wrap" value="1" type="checkbox" onclick="if (this.checked) document.getElementById('form').input.wrap = 'hard'; else getElementById('form').input.wrap = 'off';" <%if:"{login.user.config('wrap')} == 1"%>checked="checked" <%end%>/> Word wrap
<input type="checkbox" name="disable_wysiwyg" value="1" onclick="document.getElementById('form').submit()" /> Disable WYSIWYG
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="100%">
<table border="0" cellspacing="0" cellpadding="10" width="100%" height="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td height="100%"><textarea name="input" wrap="<%if:"{login.user.config('wrap')} == 1"%>hard<%else%>off<%end%>" cols="10" rows="10" style="width: 100%; height: 100%"></textarea></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="Save Changes" onclick="save()" />
<input type="button" value="Preview" onclick="preview()" />
<input type="button" value="Cancel" onclick="history.back(-1)" />
<input type="button" value="HTML Mode" onclick="mode()" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%if:"{system.env('HTTP_USER_AGENT')} =~ /MSIE [6-9]/i"%>
<object id="dlghelper" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object>
<%end%>
</body>
</html>
<%else%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<{system.htdocs}>styles/<{system.service.config('color')}>/default.css" />
<style type="text/css">
<!--
.icon
{
cursor: hand;
-moz-user-select: none;
}
//-->
</style>
<script type="text/javascript" language="javascript">
<!--
function preview()
{
var preview = window.open("#","preview","toolbar=no,width=600,height=400,directories=no,status=no,scrollbars=yes,menubar=no,location=no,resizable=yes");
preview.document.write(document.form.input.value);
if (preview.opener == null)
{
edit.opener = self;
}
}
//-->
</script>
</head>
<body marginwidth="10" marginheight="10" topmargin="10" leftmargin="10" rightmargin="10" bottomargin="10" bgcolor="<{system.color('body_bg')}>" scroll="no">
<form method="post" id="form">
<input type="hidden" name="file" value="<{file.name}>" />
<input type="hidden" name="command" value="manager/files/file" />
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td height="100%" bgcolor="<{system.color('border')}>" valign="top">
<table border="0" cellspacing="1" cellpadding="0" width="100%" height="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="25" bgcolor="<{system.color('link')}>" background="<{system.htdocs}>styles/<{system.color}>/titlebg.gif">
<tr>
<td><font color="#ffffff"><b> Edit <{file.name}></b></font></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="5" width="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td nowrap="nowrap">
<img src="<{system.htdocs}>images/wysiwyg/cut.gif" alt="Cut" id="cut" class="icon" onmousedown="document.execCommand(this.id,false,false)" />
<img src="<{system.htdocs}>images/wysiwyg/copy.gif" alt="Copy" id="copy" class="icon" onmousedown="document.execCommand(this.id,false,false)" />
<img src="<{system.htdocs}>images/wysiwyg/paste.gif" alt="Paste" id="paste" class="icon" onmousedown="document.execCommand(this.id,false,false)" />
<img src="<{system.htdocs}>images/wysiwyg/spacer.gif" alt="|" />
<img src="<{system.htdocs}>images/wysiwyg/undo.gif" alt="Undo" id="undo" class="icon" onmousedown="document.execCommand(this.id,false,false)" />
<img src="<{system.htdocs}>images/wysiwyg/redo.gif" alt="Redo" id="redo" class="icon" onmousedown="document.execCommand(this.id,false,false)" />
</td>
<td align="right">
<input type="checkbox" name="wrap" value="1" onclick="if (this.checked) document.form.input.wrap = 'hard'; else document.form.input.wrap = 'off';" <%if:"{login.user.config('wrap')} == 1"%>checked="checked" <%end%>/>Word wrap
<input type="checkbox" name="disable_wysiwyg" value="1"<%if:"{login.user.config('disable_wysiwyg')} == 1"%> checked="checked"<%end%> onclick="document.getElementById('form').submit()"/> Disable WYSIWYG
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="100%">
<table border="0" cellspacing="0" cellpadding="10" width="100%" height="100%" bgcolor="<{system.color('content_bg')}>">
<tr>
<td height="100%"><textarea name="input" wrap="<%if:"{login.user.config('wrap')} == 1"%>hard<%else%>off<%end%>" cols="60" rows="20" style="width: 100%; height: 100%" tabindex="-1"><%display_init%></textarea></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="submit" value="Save Changes" />
<input type="button" value="Preview" onclick="preview()" />
<input type="button" value="Cancel" onclick="history.back(-1)" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%end%>
?>