Rank: Advanced Member
Groups: Member
Joined: 2/5/2008(UTC) Posts: 30
|
Code: // Carico lo script dell'uploader in lingua in base all'utente loggato
$uploaderJsFileName = getLanguageByUser(UPLOADER_LANGUAGE, $option);
?>
<script type="text/javascript" src="components/com_epoca/lib/js/mootree/mootree_packed.js"></script>
<?php if (EPOCA_USE_EXTERNAL_YOOEFFECTS == 0) { ?>
<script type="text/javascript" src="components/com_epoca/lib/js/slimbox/slimbox.js"></script>
<?php } ?>
<script type="text/javascript" src="components/com_epoca/lib/imageUploader/iuembed.js"></script>
<?php if ($uploaderJsFileName <> '') { ?>
<script type="text/javascript" src="<?= $uploaderJsFileName ?>"></script>
<?php } ?>
<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("objImageUploader", 706, 500);
iu.showNonemptyResponse = "off";
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "components/com_epoca/lib/imageUploader/ImageUploader6.cab";
iu.activeXControlVersion = "6,0,11,0";
//iu.activeXControlVersion = "6,1,4,0";
//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletJarFileName = "ImageUploader6.jar";
iu.javaAppletCodeBase = "components/com_epoca/lib/imageUploader/";
iu.javaAppletCached = false;
iu.javaAppletVersion = "6.0.11.0";
//iu.javaAppletVersion = "6.1.4.0";
//Configure License Keys (ActiveX Key;Java Key)
iu.addParam("LicenseKey", "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx;xxxxx-xxxxx-xxxxx-xxxxx-xxxxx");
// Se si vuole utilizzare l'applet Java anche su Internet Explorer
//iu.activeXControlEnabled = false;
<?php if ($uploaderJsFileName <> '') { ?>
// Caricamento del file delle lingue
language_resources.addParams(iu);
<?php } ?>
// Configurazione del componente
iu.addParam("PaneLayout", "ThreePanes");
// Per nascondere il TreePane se provengo da Epoca Software
// <?php if ($order->type == TIPO_ORDINE_EPOCA_SOFTWARE) { ?>
// iu.addParam("TreePaneWidth", "-1");
// <?php } else { ?>
// iu.addParam("TreePaneWidth", "150");
// <?php } ?>
iu.addParam("TreePaneWidth", "150");
iu.addParam("FolderPaneHeight", "300");
iu.addParam("TreePaneBorderStyle", "FixedSingle");
iu.addParam("FolderPaneBorderStyle", "FixedSingle");
iu.addParam("UploadPaneBorderStyle", "FixedSingle");
iu.addParam("BackgroundColor", "#D4D4D4");
iu.addParam("UploadPaneBackgroundColor", "#F0FFFF");
iu.addParam("FolderView", "Thumbnails");
iu.addParam("UploadView", "AdvancedDetails");
iu.addParam("FilesPerOnePackageCount", "1");
iu.addParam("SilentMode", "false");
iu.addParam("MaxConnectionCount", "3");
iu.addParam("AutoRecoverMaxTriesCount", "6");
iu.addParam("AutoRecoverTimeOut", "10000");
iu.addParam("AllowLargePreview", "true");
iu.addParam("LargePreviewWidth", "640");
iu.addParam("LargePreviewHeight", "480");
iu.addParam("AllowRotate", "false");
iu.addParam("AllowMultipleRotate", "false");
iu.addParam("AllowFolderUpload", "false");
iu.addParam("IncludeSubfolders", "true");
iu.addParam("ShowDescriptions", "false");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("ShowSubfolders", "true");
iu.addParam("FileMask", "<?= $fileFilter ?>");
iu.addParam("ButtonSendText", "");
iu.addParam("ButtonAddFoldersText", "");
<?php if ($thumb == 1) { ?>
//Thumb
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "<?= EPOCA_THUMB_MAXSIZE ?>");
iu.addParam("UploadThumbnail1Height", "<?= EPOCA_THUMB_MAXSIZE ?>");
iu.addParam("UploadThumbnail1JpegQuality", "60");
<?php } ?>
//Configure URL files are uploaded to.
iu.addParam("Action", "components/com_epoca/upload.php");
function ImageUploader_BeforeUpload() {
getImageUploader("objImageUploader").AddField('UD', '<?= $filePath ?>');
}
function ImageUploader_AfterUpload(html) {
getXmlData();
}
function ImageUploader_FullPageLoad() {
alert("DEBUG: Event Run");
getImageUploader("objImageUploader").GoToFolder('<?= $localpath ?>\\');
}
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
iu.addEventListener("AfterUpload", "ImageUploader_AfterUpload");
<?php if ($localpath <> '') { ?>
alert("DEBUG: Event Listener");
iu.addEventListener("FullPageLoad", "ImageUploader_FullPageLoad");
<?php } ?>
//]]>
</script>
Dear Tami, here's the js part of my code that prepares the IU object to be rendered. I leaved the 2 DEBUG alerts, so you can understand what happens during my test. I see the "Event Listener" debug alert, so it's clear that the listener is correctly added to the object, but I DON'T SEE the "Event Run" debug alert... so I think that the event is not called. I report this problem on IE with IU 6.1.4.0, with IU 6.0.11.0 all is working perfectly. Let me know if you discover something or if you need more code snippets. Kindly regards, Ivan Edited by user Tuesday, October 6, 2009 5:12:03 PM(UTC)
| Reason: Not specified
|