-
Notifications
You must be signed in to change notification settings - Fork 25
/
RCCWP_SWFUpload.php
executable file
·50 lines (45 loc) · 2.13 KB
/
RCCWP_SWFUpload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
class RCCWP_SWFUpload
{
public static function Body($inputName, $fileType, $isCanvas = 0, $urlInputSize = false) {
global $mf_domain;
include_once('RCCWP_Options.php');
$idField = RCCWP_WritePostPage::changeNameInput($inputName);
if (!$urlInputSize) $urlInputSize = 20;
if ($isCanvas==0) {
$iframeInputSize = $urlInputSize;
$iframeWidth = 380;
$iframeHeight = 40;
$inputSizeParam = '';
}else{
$isCanvas = 1;
$iframeWidth = 150;
$iframeHeight = 60;
$iframeInputSize = 3;
$inputSizeParam = "&inputSize=$iframeInputSize";
}
$iframePath = MF_URI."RCCWP_upload.php?input_name=".urlencode($inputName)."&type=$fileType&imageThumbID=img_thumb_$idField&canvas=$isCanvas".$inputSizeParam ;
?>
<?php if (RCCWP_Options::Get('use-standard-uploader')) : ?>
<div id='upload_iframe_<?php echo $idField;?>' class="iframeload { iframe: { id: 'upload_internal_iframe_<?php echo $idField ?>', src: '<?php echo $iframePath;?>', height: <?php echo $iframeHeight ?>, width: <?php echo $iframeWidth ?> } }">
</div>
<?php else: ?>
<div id='upload_ajax_<?php echo $idField;?>' class="ajaxupload { lang: { upload_error: '<?php echo __("Upload Failed", $mf_domain) ?>', upload_success: '<?php echo __("Successful Upload", $mf_domain) ?>', upload: '<?php echo __("Choose File...", $mf_domain) ?>', replace: '<?php echo __("Replace File...", $mf_domain) ?>', drop: '<?php echo __("drop file here to upload", $mf_domain)?>' }}">
</div>
<?php endif; ?>
<table border="0">
<tr >
<td style="border-bottom-width: 0px; padding: 0"><label for="upload_url"><?php _e('Or URL', $mf_domain); ?>:</label></td>
<td style="border-bottom-width: 0px; padding-left: 4px;">
<input id="upload_url_<?php echo $idField; ?>"
name="upload_url_<?php echo $inputName ?>"
type="text"
size="<?php echo $urlInputSize ?>"
class="mf-upload-url" />
<input type="button" onclick="uploadurl('<?php echo $idField ?>','<?php echo $fileType ?>','<?php echo wp_create_nonce("nonce_url_file") ?>')" value="Upload" class="button" style="width:70px"/>
</td>
</tr>
</table>
<?php
}
}