Projet

Général

Profil

ftpActions.xml

Gérald Schwartzmann, 09/01/2012 14:22

Télécharger (6,22 ko)

 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<driver name="ftp">
3
        <actions>
4
                <action name="move" dragndropDefault="true">
5
                        <gui text="70" title="160" src="editpaste.png" accessKey="move_access_key" hasAccessKey="true">
6
                                <context selection="true" dir="" recycle="hidden"
7
                                        actionBar="true" contextMenu="true" infoPanel="false"
8
                                        actionBarGroup="change" inZip="false">
9
                                </context>
10
                                <selectionContext dir="true" file="true" recycle="false" unique="false" image="false" mp3="false" editable="false"></selectionContext></gui>
11
                        <rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
12
                        <processing>
13
                                <clientCallback prepareModal="true"><![CDATA[
14
                                        var onLoad = function(oForm){
15
                                                var getAction = oForm.getElementsBySelector('input[name="get_action"]')[0];
16
                                                getAction.value = 'move';
17
                                                var container = oForm.getElementsBySelector(".treeCopyContainer")[0];
18
                                                var eDestLabel = oForm.getElementsBySelector('input[name="dest"]')[0];
19
                                                var eDestNodeHidden = oForm.getElementsBySelector('input[name="dest_node"]')[0];
20
                                                if(!this.treeCopy){
21
                                                        this.treeCopy = new WebFXLoadTree('/', 
22
                                                                                                                                ajxpServerAccessPath+'?skipZip=true&get_action=ls', 
23
                                                                                                                                "javascript:ajaxplorer.foldersTree.clickNode(CURRENT_ID)", 
24
                                                                                                                                'explorer');
25
                                                }
26
                                                else{
27
                                                        window.setTimeout('ajaxplorer.actionBar.treeCopy.reload()', 100);
28
                                                }                                
29
                                                this.treeCopyActive = true;
30
                                                this.treeCopyActionDest = $A([eDestLabel]);
31
                                                this.treeCopyActionDestNode = $A([eDestNodeHidden]);
32
                                                container.innerHTML = this.treeCopy.toString();
33
                                                $(this.treeCopy.id).observe("click", function(e){
34
                                                        ajaxplorer.foldersTree.clickNode(this.treeCopy.id);
35
                                                        Event.stop(e);
36
                                                }.bind(this));
37
                                                $('external_repository').hide();
38
                                                this.treeCopy.focus();
39
                                        }.bind(ajaxplorer.actionBar);
40
                                        var onCancel = function(){                                
41
                                                ajaxplorer.cancelCopyOrMove();
42
                                        };
43
                                        var onSubmit = function(){
44
                                                var oForm = modal.getForm();
45
                                                var eDestLabel = oForm.getElementsBySelector('input[name="dest"]')[0];
46
                                                if(eDestLabel.value == ajaxplorer.filesList.getCurrentRep())
47
                                                {
48
                                                        alert(MessageHash[183]);
49
                                                        return false;
50
                                                }
51
                                                ajaxplorer.filesList.getUserSelection().updateFormOrUrl(oForm);                                
52
                                                this.treeCopyActive = false;
53
                                                this.submitForm(oForm);
54
                                                hideLightBox(true);
55
                                                return false;
56
                                        }.bind(ajaxplorer.actionBar);
57
                                        modal.showDialogForm('Move/Copy', 'copymove_form', onLoad, onSubmit, onCancel);                                        
58
                                        ]]></clientCallback>
59
                                <serverCallback methodName="switchAction"></serverCallback>
60
                                </processing>
61
                </action>
62
                <action name="next_to_remote">
63
                        <processing>
64
                                <serverCallback methodName="uploadActions"></serverCallback>
65
                        </processing>
66
                </action>
67
                <action name="trigger_remote_copy">
68
                        <processing>
69
                                <serverCallback methodName="uploadActions"></serverCallback>
70
                        </processing>
71
                </action>
72
                <action name="upload">
73
                        <gui text="27" title="27" src="yast_backup.png" accessKey="upload_access_key" hasAccessKey="true">
74
                                <context selection="false" dir="true" recycle="hidden"
75
                                        actionBar="true" contextMenu="true" infoPanel="false"
76
                                        actionBarGroup="put">
77
                                </context></gui>
78
                        <rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
79
                        <processing>
80
                                <clientCallback prepareModal="true"><![CDATA[
81
                                if(ajaxplorer.actionBar.getFlashVersion() >= 8 && document.location.href.substring(0,5)!='https')
82
                                {
83
                                        modal.setCloseAction(function(){
84
                                                $('closeFlashUploadBox').disabled=false;
85
                                                var bgManager = ajaxplorer.actionBar.bgManager;
86
                                                bgManager.queueAction("trigger_remote_copy", new Hash(), "Copying files to server");
87
                                                bgManager.next();
88
                                        });
89
                                        modal.showDialogForm('Upload',
90
                                                                                'flash_upload_form',
91
                                                                                null,
92
                                                                                function(){
93
                                                                                        hideLightBox();
94
                                                                                        return false;
95
                                                                                },
96
                                                                                null,
97
                                                                                true, true);
98
                                }
99
                                else
100
                                {
101
                                        $('hidden_frames').innerHTML = '<iframe name="hidden_iframe" id="hidden_iframe"></iframe>';
102
                                        var onLoadFunction = function(oForm){
103
                                                this.multi_selector = new MultiSelector(oForm, oForm.getElementsBySelector('div.uploadFilesList')[0], '6' );
104
                                                this.multi_selector.addElement(oForm.getElementsBySelector('.dialogFocus')[0]);
105
                                                var rep = document.createElement('input');
106
                                                rep.setAttribute('type', 'hidden');
107
                                                rep.setAttribute('name', 'dir');
108
                                                rep.setAttribute('value', ajaxplorer.getFilesList().getCurrentRep());
109
                                                oForm.appendChild(rep);
110
                                        }.bind(ajaxplorer.actionBar);
111

    
112
                                        modal.setCloseAction(function(){
113
                                                ajaxplorer.filesList.reload();
114
                                                var bgManager = ajaxplorer.actionBar.bgManager;
115
                                                bgManager.queueAction("trigger_remote_copy", new Hash(), "Copying files to server");
116
                                                bgManager.next();
117
                                        });
118
                                        modal.showDialogForm('Upload', 'originalUploadForm', onLoadFunction, function(){ajaxplorer.actionBar.multi_selector.submitMainForm();return false;});
119
                                }
120
                                        ]]></clientCallback>
121
                                <clientForm id="flash_upload_form"><![CDATA[
122
                                        <!-- UPLOAD FORM -->
123
                                        <form action="AJXP_SERVER_ACCESS" target="hidden_iframe" enctype="multipart/form-data" method="POST" id="originalUploadForm" style="text-align:left; display:none;" box_width="470">
124
                                        <legend>AJXP_MESSAGE[25]<b class="replace_rep"></b></legend>
125
                                        <br><br>AJXP_MESSAGE[171]<br>
126
                                        <input type="file" name="userfile_1" class="dialogFocus" size="30">
127
                                        <input type="hidden" name="get_action" value="upload">
128

    
129
                                        <br><br>AJXP_MESSAGE[172]
130
                                        <div id="upload_files_list" class="uploadFilesList"></div>
131
                                        </form>
132

    
133
                                        <!-- MOOTOOLS UPLOAD FORM -->
134
                                        <div id="flash_upload_form" box_width="445">
135
                                        <div id="flashscreen">
136
                                        <iframe id="flashframe" frameborder="0" src="AJXP_SERVER_ACCESS?get_action=get_template&template_name=flash_tpl.html&encode=false"></iframe>
137
                                        </div>
138
                                        <div class="dialogButtons"><input type="button" class="dialogButton" onclick="hideLightBox(true);" value="AJXP_MESSAGE[86]" id="closeFlashUploadBox"></div>
139
                                        </div>
140
                                        <script language="javascript">$('originalUploadForm').hide();</script>
141
                                ]]></clientForm>
142
                                <serverCallback methodName="uploadActions"></serverCallback>
143
                                </processing>
144
                </action>
145
        </actions>
146
</driver>
147