This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
/
manifest.xml
130 lines (126 loc) · 7.55 KB
/
manifest.xml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0" encoding="UTF-8"?>
<ajxp_plugin enabled="false" label="CONF_MESSAGE[Power FS]" description="CONF_MESSAGE[This set of extensions assume that you have an administration access to your server: ability to tweak the webserver and the php configuration, ability to access the command line, etc.]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
<class_definition classname="PowerFSController" filename="plugins/action.powerfs/class.PowerFSController.php"/>
<client_settings>
<resources>
<i18n namespace="powerfs" path="plugins/action.powerfs/i18n"/>
</resources>
</client_settings>
<server_settings>
<global_param name="ZIP_PATH" type="string" label="Zip path"
description="Path of the zip utilitary on the command line" default="zip"/>
</server_settings>
<registry_contributions>
<actions>
<!-- Override access.fs compression -->
<action name="compress">
<processing>
<serverCallback methodName="switchAction"/>
</processing>
</action>
<action name="precompress">
<rightsContext noUser="true" userLogged="only" read="true" write="false" adminOnly=""></rightsContext>
<processing>
<serverCallback methodName="switchAction"/>
</processing>
</action>
<action name="postcompress_download">
<rightsContext noUser="true" userLogged="only" read="true" write="false" adminOnly=""></rightsContext>
<processing>
<serverCallback methodName="switchAction"/>
</processing>
</action>
<action name="monitor_compression">
<processing>
<serverCallback methodName="switchAction"/>
</processing>
</action>
<!-- Override download client callback -->
<action name="download">
<processing>
<clientCallback prepareModal="true"><![CDATA[
var userSelection = ajaxplorer.getUserSelection();
if((userSelection.isUnique() && !userSelection.hasDir()) || (zipEnabled && multipleFilesDownloadEnabled))
{
if(gaTrackEvent){
fileNames = userSelection.getFileNames();
for(var i=0; i<fileNames.length;i++){
gaTrackEvent("Data", "Download", fileNames[i]);
}
}
var agent = navigator.userAgent;
if(agent && (agent.indexOf('iPhone')!=-1||agent.indexOf('iPod')!=-1||agent.indexOf('iPad')!=-1||agent.indexOf('iOs')!=-1)){
var downloadUrl = ajxpServerAccessPath+'&get_action=download';
downloadUrl = userSelection.updateFormOrUrl(null,downloadUrl);
document.location.href=downloadUrl;
}else{
if( !userSelection.isUnique() || userSelection.hasDir() ){
zipName = getBaseName(userSelection.getContextNode().getPath());
if(zipName == "") zipName = "Archive";
var index=1;
var buff = zipName;
while(userSelection.fileNameExists(zipName + ".zip")){
zipName = buff + "-" + index; index ++ ;
}
var conn = new Connexion();
conn.addParameter("get_action", "precompress");
conn.addParameter("archive_name", zipName+".zip");
conn.addParameter("on_end", "postcompress_download");
var selected = userSelection.getFileNames();
var dir = userSelection.getContextNode().getPath();
for(var i=0;i<selected.length;i++){
conn.addParameter("file_"+i, selected[i]);
dir = getRepName(selected[i]);
}
conn.addParameter("dir", dir);
conn.onComplete = function(transport){
this.parseXmlMessage(transport.responseXML);
}.bind(ajaxplorer.actionBar) ;
conn.sendAsync();
}else{
var regex = new RegExp('.*?[&\\?]' + 'minisite_session' + '=(.*?)&.*');
val = window.ajxpServerAccessPath.replace(regex, "$1");
var minisite_session = ( val == window.ajxpServerAccessPath ? false : val );
$('download_form').action = window.ajxpServerAccessPath;
$('download_form').secure_token.value = Connexion.SECURE_TOKEN;
$('download_form').select("input").each(function(input){
if(input.name!='get_action' && input.name!='secure_token') input.remove();
if(input.name=='get_action') input.value = 'download';
});
if(minisite_session){
$('download_form').insert(new Element('input', {type:'hidden', name:'minisite_session', value:minisite_session}));
}
userSelection.updateFormOrUrl($('download_form'));
$('download_form').submit();
}
}
}
else
{
var loadFunc = function(oForm){
var dObject = oForm.getElementsBySelector('div[id="multiple_download_container"]')[0];
var downloader = new MultiDownloader(dObject, ajxpServerAccessPath+'&action=download&file=');
downloader.triggerEnd = function(){hideLightBox()};
fileNames = userSelection.getFileNames();
for(var i=0; i<fileNames.length;i++)
{
downloader.addListRow(fileNames[i]);
}
};
var closeFunc = function(){
hideLightBox();
return false;
};
modal.showDialogForm('Download Multiple', 'multi_download_form', loadFunc, closeFunc, null, true);
}
]]>
</clientCallback>
</processing>
</action>
</actions>
</registry_contributions>
<dependencies>
<activePlugin pluginName="access.fs"/>
</dependencies>
</ajxp_plugin>