<?xml version="1.0" encoding="UTF-8"?>
<uploader id="uploader.html" order="0" text="51" title="162" className="MultiUploader" label="CONF_MESSAGE[HTML Uploader]" description="CONF_MESSAGE[Auto-switching HTML5 or IFrame uploader.]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
	<class_definition filename="plugins/uploader.html/SimpleUpload.php" classname="Pydio\Uploader\Processor\SimpleUpload"/>
    <server_settings>
        <global_param expose="true" name="DEFAULT_EXISTING" group="CONF_MESSAGE[Default Behaviour]" type="select" choices="overwrite|CONF_MESSAGE[Always Override],rename|CONF_MESSAGE[Auto Rename File],alert|CONF_MESSAGE[Prompt user]" label="CONF_MESSAGE[Existing Files]" description="CONF_MESSAGE[Inform the user or not if the file already exists (default behaviour, the user will be able to change this preference)]" mandatory="false" default="rename"/>
        <global_param expose="true" name="DEFAULT_AUTO_START" group="CONF_MESSAGE[Default Behaviour]" type="boolean" label="CONF_MESSAGE[Auto Start]" description="CONF_MESSAGE[Default value for automatically starting upload or not]" mandatory="false" default="true"/>
        <global_param expose="true" name="DEFAULT_AUTO_CLOSE" group="CONF_MESSAGE[Default Behaviour]" type="boolean" label="CONF_MESSAGE[Auto Close]" description="CONF_MESSAGE[Default value for automatically closing the dialog after upload or not]" mandatory="false" default="true"/>
    </server_settings>
    <client_settings>
        <resources>
            <js file="plugins/uploader.html/class.MultiUploader.js" className="MultiUploader"/>
            <js file="plugins/uploader.html/js/build/UploaderView.js" className="UploaderView" depends="React,PydioForm,UploaderModel"/>
            <js file="plugins/uploader.html/js/build/UploaderModel.js" className="UploaderModel" depends="React,PydioTasks"/>
            <js file="plugins/uploader.html/js/build/UploaderGlobalListener.js" className="UploaderGlobalListener" depends="React,PydioTasks,UploaderModel"/>
            <i18n path="plugins/uploader.html/i18n" namespace="html_uploader"/>
        </resources>
    </client_settings>
	<registry_contributions>
		<actions>
			<action name="upload">
				<pre_processing>
					<serverCallback methodName="preProcess"/>
				</pre_processing>
				<post_processing>
					<serverCallback methodName="postProcess" capture="true"/>
				</post_processing>
			</action>
			<action name="get_drop_bg" skipSecureToken="true">
				<processing>
					<serverCallback methodName="getDropBg"/>
				</processing>
			</action>
			<action name="upload_chunks_unify">
				<processing>
					<serverCallback methodName="unifyChunks"/>
				</processing>
			</action>
		</actions>
	</registry_contributions>
    <dependencies>
        <!-- Stream Wrapper Access, and dependancy to uploader.flex forces the order -->
        <activePlugin pluginName="access.AJXP_STREAM_PROVIDER|access.ajxp_home"/>
        <pluginClass pluginName="uploader.flex"/>
        <pluginClass pluginName="gui.ajax"/>
    </dependencies>
	<processing>
        <clientForm module="UploaderView.DropUploader"/>
		<extensionOnInit><![CDATA[
            var pydioUserWriteable = pydio && pydio.user && pydio.user.write;
            var dragSupported = 'draggable' in document.createElement('span');
            var fileUploadSupported = typeof File != "undefined" && typeof (new XMLHttpRequest()).upload != "undefined" && (window.FileReader || window.FormData);
            if(fileUploadSupported && dragSupported && pydioUserWriteable){
                try{
                    ResourcesManager.loadClassesAndApply(["UploaderGlobalListener","UploaderModel"], function(){
                        UploaderGlobalListener.initUploaderExtension();
                    });
                }catch(e){}
            }
		]]></extensionOnInit>
	</processing>
</uploader>

