2010-11-13 12:12:56 +00:00
|
|
|
{if $smarty.const.THIS_PAGE == 'upload' && $step =="2"}
|
|
|
|
|
|
|
|
<script src="{$js}/swfupload/swfupload.js" type="text/javascript"></script>
|
|
|
|
<script src="{$js}/swfupload/plugins/all_in_one.js" type="text/javascript"></script>
|
|
|
|
<script type="text/javascript">
|
2010-12-14 14:39:16 +00:00
|
|
|
{assign var="get_api_server" value=$multi_server->get_server_api()}
|
2010-11-13 12:12:56 +00:00
|
|
|
|
2010-12-14 14:39:16 +00:00
|
|
|
{if $get_api_server}
|
|
|
|
var result_page = '{$get_api_server.server_api_path}/actions/file_results.php';
|
|
|
|
var download_page = '{$get_api_server.server_api_path}/actions/file_downloader.php';
|
|
|
|
{/if}
|
2010-11-13 12:12:56 +00:00
|
|
|
|
|
|
|
var swfu;
|
|
|
|
var file_name = '{$file_name}';
|
|
|
|
{literal}
|
|
|
|
|
|
|
|
window.onload = function() {
|
|
|
|
var settings = {
|
|
|
|
{/literal}
|
|
|
|
|
2010-12-14 14:39:16 +00:00
|
|
|
|
|
|
|
{if $get_api_server}
|
|
|
|
flash_url : "{$get_api_server.server_api_path}/js/swfupload/swfupload.swf",
|
|
|
|
upload_url: "{$get_api_server.server_api_path}/actions/file_uploader.php",
|
|
|
|
{else}
|
|
|
|
flash_url : "{$js}/swfupload/swfupload.swf",
|
|
|
|
upload_url: "{$baseurl}/actions/file_uploader.php",
|
|
|
|
{/if}
|
2010-11-13 12:12:56 +00:00
|
|
|
|
|
|
|
button_image_url: "{$imageurl}/cb_button.png",
|
|
|
|
post_params:
|
|
|
|
{literal}
|
|
|
|
{
|
|
|
|
{/literal}
|
|
|
|
"file_name" : file_name
|
|
|
|
{literal}
|
|
|
|
}
|
|
|
|
{/literal},
|
|
|
|
|
|
|
|
|
|
|
|
file_size_limit : "{$Cbucket->configs.max_upload_size} MB",
|
|
|
|
file_types : "{$Cbucket->list_extensions()}",
|
|
|
|
file_types_description : "Video Files",
|
|
|
|
file_upload_limit : 1,
|
|
|
|
file_queue_limit : 0,
|
|
|
|
|
|
|
|
{literal}
|
|
|
|
custom_settings : {
|
|
|
|
progressTarget : "fsUploadProgress",
|
|
|
|
cancelButtonId : "btnCancel"
|
|
|
|
},
|
|
|
|
debug: false,
|
|
|
|
|
|
|
|
// Button settings
|
|
|
|
|
|
|
|
button_placeholder_id: "spanButtonPlaceHolder",
|
|
|
|
button_width: 77,
|
|
|
|
button_height: 22,
|
|
|
|
button_text_style: ".cb_button_font { font-weight:bold; font-family:Arial, Helvetica, sans-serif;font-size:12;color:#333}",
|
|
|
|
button_text_left_padding: 18,
|
|
|
|
button_text_top_padding: 2,
|
|
|
|
|
|
|
|
button_text: '<span class="cb_button_font">Upload</span>',
|
|
|
|
|
|
|
|
// The event handler functions are defined in handlers.js
|
|
|
|
file_queued_handler : fileQueued,
|
|
|
|
file_queue_error_handler : fileQueueError,
|
|
|
|
file_dialog_complete_handler : fileDialogComplete,
|
|
|
|
upload_start_handler : uploadStart,
|
|
|
|
upload_progress_handler : uploadProgress,
|
|
|
|
upload_error_handler : uploadError,
|
|
|
|
upload_success_handler : uploadSuccess,
|
|
|
|
upload_complete_handler : uploadComplete,
|
|
|
|
queue_complete_handler : queueComplete // Queue plugin event
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
swfu = new SWFUpload(settings);
|
|
|
|
|
|
|
|
load_quicklist_box();
|
|
|
|
ini_cookies();
|
|
|
|
};
|
|
|
|
{/literal}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{else}
|
|
|
|
<script type="text/javascript">
|
|
|
|
{literal}
|
|
|
|
window.onload = function() {
|
|
|
|
load_quicklist_box();
|
|
|
|
ini_cookies();
|
|
|
|
}
|
|
|
|
{/literal}
|
|
|
|
</script>
|
|
|
|
{/if}
|
|
|
|
|
2010-12-14 14:39:16 +00:00
|
|
|
|
|
|
|
<link href="{$js}/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
|
|
|
|
<script type="text/javascript" src="{$js}/uploadify/swfobject.js"></script>
|
|
|
|
<script type="text/javascript" src="{$js}/uploadify/jquery.uploadify.v2.1.4.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var jsURL = '{$js}';
|
|
|
|
var file_name = '{$file_name}';
|
|
|
|
{literal}
|
|
|
|
$(document).ready(function()
|
|
|
|
{
|
|
|
|
$('#file_uploads').uploadify({
|
|
|
|
'uploader' : jsURL+'/uploadify/uploadify.swf',
|
|
|
|
'script' : baseurl+'/actions/file_uploader.php',
|
|
|
|
'cancelImg' : jsURL+'/uploadify/cancel.png',
|
|
|
|
'auto' : true,
|
|
|
|
'removeCompleted' : false,
|
|
|
|
'displayData' : 'both',
|
|
|
|
'scriptData' : {"file_name" : file_name},
|
|
|
|
'onOpen' : function(event,ID,fileObj) {
|
|
|
|
$.ajax({
|
|
|
|
url: baseurl+'/actions/file_uploader.php',
|
|
|
|
type: "POST",
|
|
|
|
data:({"getForm":"get_form","title":fileObj.name}),
|
|
|
|
dataType: "text",
|
|
|
|
success: function(data)
|
|
|
|
{
|
|
|
|
$('#file_uploads'+ID).append(data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
'onComplete' : function(event, ID, fileObj, response, data)
|
|
|
|
{
|
|
|
|
if(response=='success')
|
|
|
|
{
|
|
|
|
$.ajax({
|
|
|
|
url: baseurl+'/actions/file_uploader.php',
|
|
|
|
type: "POST",
|
|
|
|
data:({"insertVideo":"yes","title":fileObj.name,"file_name":file_name}),
|
|
|
|
dataType: "text",
|
|
|
|
success: function(data)
|
|
|
|
{
|
|
|
|
alert(data)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}else
|
|
|
|
{
|
|
|
|
alert(response);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
{/literal}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2010-12-14 13:53:51 +00:00
|
|
|
{if $smarty.const.THIS_PAGE == 'photo_upload'}
|
|
|
|
<script src="{$js}/swfupload/swfupload.js" type="text/javascript"></script>
|
|
|
|
<script src="{$js}/swfupload/plugins/all_in_one.js" type="text/javascript"></script>
|
|
|
|
|
2010-11-13 12:12:56 +00:00
|
|
|
<script type="text/javascript">
|
2010-12-14 13:53:51 +00:00
|
|
|
var swfu;
|
|
|
|
window.onload = function ()
|
|
|
|
{ldelim}
|
|
|
|
var settings =
|
|
|
|
{ldelim}
|
|
|
|
flash_url : "{$js}/swfupload/swfupload.swf",
|
|
|
|
file_post_name: 'photoUpload',
|
|
|
|
upload_url: "{$baseurl}/actions/photo_uploader.php",
|
|
|
|
button_image_url: "{$imageurl}/cb_button.png",
|
|
|
|
file_size_limit : "{$Cbucket->configs.max_photo_size} MB",
|
|
|
|
file_types : "{$cbphoto->extensions()}",
|
|
|
|
file_types_description : "Image Files",
|
|
|
|
file_upload_limit : {$max_upload},
|
|
|
|
post_params :
|
|
|
|
{ldelim}
|
|
|
|
{if $smarty.get.collection}
|
|
|
|
{if $cbphoto->is_addable($smarty.get.collection)}
|
|
|
|
collection : {$smarty.get.collection},
|
|
|
|
{/if}
|
|
|
|
{/if}
|
|
|
|
userid : {$userquery->userid}
|
|
|
|
{rdelim},
|
|
|
|
file_queue_limit : 0,
|
|
|
|
custom_settings : {ldelim}
|
|
|
|
progressTarget : "fsUploadProgress",
|
|
|
|
cancelButtonId : "btnCancel"
|
|
|
|
{rdelim},
|
|
|
|
debug: false,
|
|
|
|
|
|
|
|
// Button settings
|
|
|
|
|
|
|
|
button_placeholder_id: "spanButtonPlaceHolder",
|
|
|
|
button_width: 77,
|
|
|
|
button_height: 22,
|
|
|
|
button_text_left_padding: 18,
|
|
|
|
button_text_top_padding: 2,
|
|
|
|
|
|
|
|
button_text: '<span class="cb_button_font">Upload</span>',
|
|
|
|
|
|
|
|
// The event handler functions are defined in handlers.js
|
|
|
|
file_queued_handler : fileQueued,
|
|
|
|
file_queue_error_handler : fileQueueError,
|
|
|
|
file_dialog_complete_handler : fileDialogComplete,
|
|
|
|
upload_start_handler : uploadStart,
|
|
|
|
upload_progress_handler : uploadProgress,
|
|
|
|
upload_error_handler : uploadError,
|
|
|
|
upload_success_handler : PictureUploadSuccess,
|
|
|
|
upload_complete_handler : uploadComplete,
|
|
|
|
queue_complete_handler : queueComplete // Queue plugin event
|
|
|
|
|
|
|
|
{rdelim}
|
|
|
|
swfu = new SWFUpload(settings);
|
|
|
|
{rdelim}
|
2010-11-13 12:12:56 +00:00
|
|
|
</script>
|
2010-12-14 13:53:51 +00:00
|
|
|
{/if}
|