264 lines
13 KiB
Text
264 lines
13 KiB
Text
<?_code
|
|
{
|
|
use strict;
|
|
use vars qw(%GET);
|
|
|
|
# $_[1] is a pre-request scratch area
|
|
# put variables here so that we can access them later
|
|
# outside of this _code block
|
|
my $head = \$_[1]->{'head'};
|
|
my $body = \$_[1]->{'body'};
|
|
my $u = LJ::User->remote;
|
|
return "<?needlogin?>" unless $u;
|
|
|
|
LJ::need_res("stc/display_none.css");
|
|
my $js = "";
|
|
if ($GET{upload_count} || LJ::did_post()) {
|
|
|
|
|
|
if (my $ct = $GET{upload_count}) {
|
|
$js .= "<script>\n";
|
|
for my $pn (1..$ct) {
|
|
my $swidth = int($GET{"sw_$pn"});
|
|
my $sheight = int($GET{"sh_$pn"});
|
|
my $esurl = LJ::ejs($GET{"su_$pn"});
|
|
my $eppurl = LJ::ejs($GET{"pp_$pn"});
|
|
$js .= "window.onload = function () { window.setTimeout(\"InObFCK.onUpload('$esurl','$eppurl',$swidth,$sheight);\",500) }\n";
|
|
}
|
|
$js .= "</script>\n";
|
|
}
|
|
}
|
|
|
|
my $step = 1;
|
|
my $fbenabled = LJ::get_cap($u, 'fb_account') && LJ::get_cap($u, 'fb_can_upload');
|
|
my $ret = '';
|
|
|
|
$$head .= qq{
|
|
<style>
|
|
.insobjOuter { }
|
|
.insobjTitle { vertical-align: top; }
|
|
.insobjNav { text-align: right; vertical-align: middle; padding-top: 6px;}
|
|
.insobjContent { padding-bottom: 15px; }
|
|
table { margin: 0px}
|
|
div.insobjOuter p.wintitle { font: 12pt; font-weight: bold; }
|
|
.insobjOuter div.ex { font: 8pt sans-serif; color: #888; font-style: italic;}
|
|
.img_error { color: red; font-weight: bold; text-align: center; }
|
|
</style>
|
|
<script>
|
|
var fileaction = '$LJ::FB_SITEROOT/interface/webupload';
|
|
var fbroot = '$LJ::SITEROOT/__using/$LJ::FB_DOMAIN';
|
|
</script>
|
|
<script src="$LJ::SITEROOT/stc/fck/editor/dialog/common/fck_dialog_common.js" type="text/javascript"></script>
|
|
<script src="$LJ::SITEROOT/stc/fck/editor/dialog/fck_image/fck_image.js" type="text/javascript"></script>
|
|
$js
|
|
<link href="$LJ::SITEROOT/stc/fck/editor/dialog/common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
|
|
};
|
|
|
|
#taken from the original fck_image.html
|
|
# get the link to the alt text faq
|
|
my $faq;
|
|
unless ( $faq = LJ::Hooks::run_hook( 'faqlink', 'alttext', $ML{'/imgupload.bml.insertimage.alt.faqlink'} ) ) {
|
|
$faq = $ML{'/imgupload.bml.insertimage.alt.faqlink'};
|
|
}
|
|
$ret .= qq{
|
|
<div id="divInfo">
|
|
<table cellspacing="1" cellpadding="1" border="0" width="99%" height="99%">
|
|
<tr>
|
|
<td>
|
|
<table cellspacing="0" cellpadding="0" width="99%" border="0">
|
|
<tr>
|
|
<td width="100%"><span fckLang="DlgImgURL">URL</span></td>
|
|
<td id="tdBrowse" style="DISPLAY: none" nowrap rowspan="2"> <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer"></td></tr>
|
|
<tr>
|
|
<td valign="top"><input id="txtUrl" style="WIDTH: 99%" type="text" onblur="UpdatePreview();"></td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr>
|
|
|
|
<td><span fckLang="DlgImgAlt">Short Description</span><br />
|
|
<input id="txtAlt" style="WIDTH: 9%" type="text"><br />
|
|
$ML{'/imgupload.bml.insertimage.alt.body'} $faq.<br />
|
|
</td></tr>
|
|
<tr height="100%">
|
|
<td valign="top">
|
|
<table cellspacing="0" cellpadding="0" width="99%" border="0" height="99%">
|
|
<tr>
|
|
<td valign="top">
|
|
<br />
|
|
<table cellspacing="0" cellpadding="0" border="0">
|
|
<tr>
|
|
<td nowrap><span fckLang="DlgImgWidth">Width</span> </td>
|
|
<td>
|
|
<input type="text" size="3" id="txtWidth" onkeyup="OnSizeChanged('Width',this.value);"></td>
|
|
<td nowrap rowspan="2"> <div id="btnLockSizes" class="BtnLocked" onmouseover="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';"
|
|
onmouseout="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );" title="Lock Sizes" onclick="SwitchLock(this);"></div>
|
|
<div id="btnResetSize" class="BtnReset" onmouseover="this.className='BtnReset BtnOver';" onmouseout="this.className='BtnReset';" title="Reset Size" onclick="ResetSizes();"></div>
|
|
</td></tr>
|
|
<tr>
|
|
<td nowrap><span fckLang="DlgImgHeight">Height</span> </td>
|
|
<td><input type="text" size="3" id="txtHeight" onkeyup="OnSizeChanged('Height',this.value);"></td></tr>
|
|
</table>
|
|
<br />
|
|
<table cellspacing="0" cellpadding="0" border="0">
|
|
<tr>
|
|
<td nowrap><span fckLang="DlgImgBorder">Border</span> </td>
|
|
<td><input type="text" size="2" value="" id="txtBorder" onkeyup="UpdatePreview();"></td></tr>
|
|
<tr>
|
|
<td nowrap><span fckLang="DlgImgHSpace">HSpace</span> </td>
|
|
<td><input type="text" size="2" id="txtHSpace" onkeyup="UpdatePreview();"></td></tr>
|
|
<tr>
|
|
<td nowrap><span fckLang="DlgImgVSpace">VSpace</span> </td>
|
|
<td><input type="text" size="2" id="txtVSpace" onkeyup="UpdatePreview();"></td></tr>
|
|
<tr>
|
|
<td nowrap><span fckLang="DlgImgAlign">Align</span> </td>
|
|
<td>
|
|
<select id="cmbAlign" onchange="UpdatePreview();">
|
|
<option value="" selected></option>
|
|
<option fckLang="DlgImgAlignLeft" value="left">Left</option>
|
|
<option fckLang="DlgImgAlignAbsBottom" value="absBottom">Abs Bottom</option>
|
|
<option fckLang="DlgImgAlignAbsMiddle" value="absMiddle">Abs Middle</option>
|
|
<option fckLang="DlgImgAlignBaseline" value="baseline">Baseline</option>
|
|
<option fckLang="DlgImgAlignBottom" value="bottom">Bottom</option>
|
|
<option fckLang="DlgImgAlignMiddle" value="middle">Middle</option>
|
|
<option fckLang="DlgImgAlignRight" value="right">Right</option>
|
|
<option fckLang="DlgImgAlignTextTop" value="textTop">Text Top</option>
|
|
<option fckLang="DlgImgAlignTop" value="top">Top</option>
|
|
</select></td></tr>
|
|
</table></td>
|
|
<td> </td>
|
|
<td width="100%" valign="top">
|
|
<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed">
|
|
<tr>
|
|
<td><span fckLang="DlgImgPreview">Preview</span></td></tr>
|
|
<tr>
|
|
<td valign="top">
|
|
<iframe class="ImagePreviewArea" src="$LJ::SITEROOT/stc/fck/editor/dialog/fck_image/fck_image_preview.html" frameborder="no" marginheight="0" marginwidth="0"></iframe>
|
|
</td></tr>
|
|
</table></td></tr>
|
|
</table></td></tr>
|
|
</table>
|
|
</div>
|
|
<div id="divUpload" style="DISPLAY: none">
|
|
};
|
|
|
|
# taken from imgupload.bml with customization for rte
|
|
$ret .= "<div class='insobjOuter' id='insobjOuter'>";
|
|
$ret .= "<form style='display:inline' id='insobjform' enctype='multipart/form-data' action='imguploadrte.bml' method='post' onsubmit='return InObFCK.onSubmit()' >";
|
|
|
|
$ret .= "<table width='99%' height='99%' border='0' cellpadding='0' cellspacing='0'><tr height='20' class='insObjTitle' id='insObjTitle'><td align='left' colspan='2'><p class='wintitle' id='wintitle'>Insert Image</p></td></tr>";
|
|
|
|
# content
|
|
$ret .= "<tr><td colspan='2'><div class='insobjContent' id='img_iframe_holder' style='display: none; margin: 0px 0px 0px 0px;'></div><div id='img_fromwhere' class='insobjContent'>";
|
|
|
|
$ret .= "<table cellspacing='8' valign='top'>";
|
|
|
|
$ret .= "<tr><td id='img_error' class='img_error' colspan='2'></td></tr>";
|
|
|
|
# from file
|
|
$ret .= "<tr valign='top' colspan='2'><td>";
|
|
$ret .= LJ::html_check({
|
|
'type'=> 'radio',
|
|
'name'=> 'method',
|
|
'id'=> 'fromfile',
|
|
'value' => 'file',
|
|
'disabled' => $fbenabled ? 0 : 1,
|
|
});
|
|
$ret .= " <label for='fromfile'>Image from file</label>:</td></tr><tr><td colspan='2'>";
|
|
$ret .= LJ::html_hidden('redir_to_auth_base', '2', 'sec1', '255');
|
|
|
|
my $disabled = $fbenabled ? '' : "disabled='1'";
|
|
|
|
$ret .= "<div id='filediv'><input type='file' name='file1' id='fromfileentry' size='50' $disabled /></div>";
|
|
|
|
my $msg = LJ::Hooks::run_hook('update_insobj_fb', $fbenabled) || "Upload a file from your computer";
|
|
$ret .= "<div class='ex'>$msg</div>";
|
|
$ret .= "</td></tr>";
|
|
|
|
$ret .= "</table>";
|
|
|
|
$ret .= "<br /><font size='1' color='gray'><i>$ML{'.size'}</i></font></div></td></tr><tr height='20' class='insobjNav' id='insobjNav'><td align='left'><div style='margin-left: 10px'>";
|
|
$ret .= "<input type='button' name='btn:prev' id='btnPrev' style='display:none' value='<-- Back' />";
|
|
$ret .= "</div></td>";
|
|
$ret .= "<td align='right'><div style='margin-right: 10px'>";
|
|
$ret .= LJ::html_submit('btn:next', 'Insert', { 'id' => 'btnNext' });
|
|
$ret .= "</div></td></tr></table>";
|
|
$ret .= "</form></div><script>InObFCK.setupIframeHandlers();</script>";
|
|
|
|
# taken from orig fck_image.html
|
|
$ret .= qq{
|
|
</div>
|
|
<div id="divLink" style="DISPLAY: none">
|
|
<table cellspacing="1" cellpadding="1" border="0" width="100%">
|
|
<tr>
|
|
<td>
|
|
<span fckLang="DlgLnkURL">URL</span><br />
|
|
<input id="txtLnkUrl" style="WIDTH: 100%" type="text" onblur="UpdatePreview();" />
|
|
</div>
|
|
<div id="divLnkBrowseServer" align="right">
|
|
<input type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" onclick="LnkBrowseServer();" />
|
|
</div>
|
|
</td></tr>
|
|
</table>
|
|
</div>
|
|
<div id="divAdvanced" style="DISPLAY: none">
|
|
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
|
|
<tr>
|
|
<td valign="top" width="50%">
|
|
<span fckLang="DlgGenId">Id</span><br />
|
|
<input id="txtAttId" style="WIDTH: 100%" type="text">
|
|
</td>
|
|
<td width="1"> </td>
|
|
<td valign="top">
|
|
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
|
|
<tr>
|
|
<td width="60%">
|
|
<span fckLang="DlgGenLangDir">Language Direction</span><br />
|
|
<select id="cmbAttLangDir" style="WIDTH: 100%">
|
|
<option value="" fckLang="DlgGenNotSet" selected><not set></option>
|
|
<option value="ltr" fckLang="DlgGenLangDirLtr">Left to Right (LTR)</option>
|
|
<option value="rtl" fckLang="DlgGenLangDirRtl">Right to Left (RTL)</option>
|
|
</select>
|
|
</td>
|
|
<td width="1%"> </td>
|
|
<td nowrap>
|
|
<span fckLang="DlgGenLangCode">Language Code</span><br />
|
|
<input id="txtAttLangCode" style="WIDTH: 100%" type="text">
|
|
</td></tr>
|
|
</table></td></tr>
|
|
<tr>
|
|
<td colspan="3"> </td></tr>
|
|
<tr>
|
|
<td colspan="3">
|
|
<span fckLang="DlgGenLongDescr">Long Description URL</span><br />
|
|
<input id="txtLongDesc" style="WIDTH: 100%" type="text">
|
|
</td></tr>
|
|
<tr>
|
|
<td colspan="3"> </td></tr>
|
|
<tr>
|
|
<td valign="top">
|
|
<span fckLang="DlgGenClass">Stylesheet Classes</span><br />
|
|
<input id="txtAttClasses" style="WIDTH: 100%" type="text">
|
|
</td>
|
|
<td></td>
|
|
<td valign="top"> <span fckLang="DlgGenTitle">Advisory Title</span><br />
|
|
<input id="txtAttTitle" style="WIDTH: 100%" type="text">
|
|
</td></tr>
|
|
</table>
|
|
<span fckLang="DlgGenStyle">Style</span><br />
|
|
<input id="txtAttStyle" style="WIDTH: 100%" type="text">
|
|
</div>
|
|
};
|
|
|
|
$$body = $ret;
|
|
$$head .= LJ::res_includes();
|
|
return;
|
|
}
|
|
_code?>
|
|
<html>
|
|
<head>
|
|
<?_code return $_[1]->{'head'}; _code?>
|
|
</head>
|
|
<body>
|
|
<?_code return $_[1]->{'body'}; _code?>
|
|
</body>
|
|
</html>
|