|
887 | 887 | </serverCallback>
|
888 | 888 | </processing>
|
889 | 889 | </action>
|
890 |
| - <action name="prepare_chunk_dl"> |
891 |
| - <rightsContext noUser="true" userLogged="only" read="true" write="false" adminOnly="false"/> |
892 |
| - <processing> |
893 |
| - <serverCallback methodName="switchAction" developerComment="Use the filesize of the file to generate an list of pieces to be downloaded using {download_chunk} action. Will generate a unique file_id to be used later."> |
894 |
| - <input_param description="Selected node" name="node" type="path" mandatory="true"/> |
895 |
| - <input_param description="Number of pieces to create for the file" name="chunk_count" type="integer"/> |
896 |
| - <output type="application/json"/> |
897 |
| - </serverCallback> |
898 |
| - </processing> |
899 |
| - </action> |
900 |
| - <action name="download_chunk"> |
901 |
| - <gui text="397" title="398" src="download_manager.png" iconClass="icon-cloud-download" hasAccessKey="false"> |
902 |
| - <context selection="true" dir="" recycle="false" |
903 |
| - actionBar="true" contextMenu="false" infoPanel="true" actionBarGroup="change"> |
904 |
| - </context> |
905 |
| - <selectionContext dir="false" file="true" recycle="false" unique="true"/> |
906 |
| - </gui> |
907 |
| - <rightsContext noUser="true" userLogged="only" read="true" write="false" adminOnly=""/> |
908 |
| - <processing> |
909 |
| - <clientCallback prepareModal="true"><![CDATA[ |
910 |
| - var userSelection = ajaxplorer.getUserSelection(); |
911 |
| -
|
912 |
| - var loadFunc = function(oForm){ |
913 |
| - var dObject = oForm.down('div[id="multiple_download_container"]'); |
914 |
| - var legendDiv = oForm.down('div.dialogLegend'); |
915 |
| - legendDiv.next("br").remove(); |
916 |
| - legendDiv.update(MessageHash[399]+'<br>'+MessageHash[401]+'<a href="'+MessageHash[402]+'" target="_blank">'+MessageHash[402]+'</a>'); |
917 |
| - dObject.insert({before:'\ |
918 |
| - <div class="dialogButtons" id="chunk_dl_form" style="height:36px;"> \ |
919 |
| - <span style="display:inline-block;float:left;margin-top: 11px;margin-left: 4px;margin-right: 4px;">'+MessageHash[400]+'</span> <input type="text" style="float:left;margin-top:5px; text-align:right; width:30px;height:24px;" name="chunk_count" id="chunk_count" value="4"> \ |
920 |
| - <input type="image" style="float:left;" id="dl_form_submit" src="AJXP_THEME_FOLDER/images/actions/22/dialog_ok_apply.png" height="22" width="22" title="OK" class="dialogButton dialogFocus">\ |
921 |
| - </div> \ |
922 |
| - '}); |
923 |
| - $("dl_form_submit").observe("click", function(e){ |
924 |
| - Event.stop(e); |
925 |
| - var conn = new Connexion(); |
926 |
| - conn.addParameter("get_action", "prepare_chunk_dl"); |
927 |
| - conn.addParameter("chunk_count", $("chunk_count").value ); |
928 |
| - conn.addParameter("file", userSelection.getUniqueNode().getPath()); |
929 |
| - var downloader = new MultiDownloader(dObject, ''); |
930 |
| - conn.onComplete = function(transp){ |
931 |
| - var chunkData = transp.responseJSON; |
932 |
| - downloader.setDownloadUrl(ajxpServerAccessPath+'&action=download_chunk&file_id='+chunkData.file_id); |
933 |
| - downloader.triggerEnd = function(){hideLightBox();}; |
934 |
| - for(var i=0; i<chunkData.chunk_count;i++){ |
935 |
| - downloader.addListRow("&chunk_index=" + i, chunkData.localname + " (part " + (i + 1) + ")"); |
936 |
| - } |
937 |
| - downloader.removeOnLoad(); |
938 |
| - }; |
939 |
| - downloader.setOnLoad(); |
940 |
| - conn.sendAsync(); |
941 |
| - }); |
942 |
| - }; |
943 |
| - var closeFunc = function(){ |
944 |
| - hideLightBox(); |
945 |
| - return false; |
946 |
| - }; |
947 |
| - modal.showDialogForm('Download Multiple', 'multi_download_form', loadFunc, closeFunc, null, true); |
948 |
| -
|
949 |
| - ]]></clientCallback> |
950 |
| - <clientForm id="multi_download_form"><![CDATA[ |
951 |
| - <div id="multi_download_form" title="AJXP_MESSAGE[118]" box_width="345"> |
952 |
| - <div class="dialogLegend">AJXP_MESSAGE[119]</div><br/> |
953 |
| - <div id="multiple_download_container"></div> |
954 |
| - <form style="display:inline;" action="index.php" method="GET" id="download_form" target="download_iframe"> |
955 |
| - <input type="hidden" name="get_action" value="download"> |
956 |
| - <input type="hidden" name="secure_token" value=""> |
957 |
| - </form> |
958 |
| - <iframe id="download_iframe" name="download_iframe" style="display:none"></iframe> |
959 |
| - </div>]]> |
960 |
| - </clientForm> |
961 |
| - <serverCallback methodName="switchAction" developerComment="Chunk file into pieces before downloading the pieces. Can be handy for problematic and limited servers."> |
962 |
| - <input_param description="Unique key generated during the {prepare_chunk_dl} action." name="file_id" type="string"/> |
963 |
| - <input_param description="Position of the file to download" name="chunk_index" type="integer"/> |
964 |
| - </serverCallback> |
965 |
| - </processing> |
966 |
| - </action> |
967 | 890 | <action name="purge">
|
968 | 891 | <processing>
|
969 | 892 | <serverCallback methodName="switchAction" developerComment="If the workspace has a PURGE configured parameter, finds the expired files and delete them. Can be typically called from command line."></serverCallback>
|
|
0 commit comments