<?xml version="1.0" encoding="UTF-8"?>
<uploader id="uploader.flex" text="51" order="1" title="162" label="CONF_MESSAGE[Flash uploader]" description="CONF_MESSAGE[Legacy flash uploader, used when the browser does not support HTML5. If you want to force the usage of this uploader, deactivate the uploader.html, and remove the activeCondition tag from the uploader.flex manifest file.]"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
	<class_definition filename="plugins/uploader.flex/FlexUpload.php" classname="Pydio\Uploader\Processor\FlexUpload"/>
    <client_settings>
        <resources>
            <i18n namespace="flex_uploader" path="plugins/uploader.flex/i18n" />
        </resources>
    </client_settings>
	<server_settings>
		<global_param name="HTTPS_POLICY_FILE" group="CONF_MESSAGE[Miscalleneous]" type="string" label="CONF_MESSAGE[HTTPS Policy]" description="CONF_MESSAGE[An Https Policy file maybe used to solve Flash upload problems when in Https. Use path relative to the web root.]" mandatory="false" default="true"/>
	</server_settings>
	<registry_contributions>
		<actions>
            <action name="flex_tpl">
                <processing>
                    <serverCallback methodName="getTemplate"/>
                </processing>
            </action>
			<action name="upload">
				<pre_processing>
					<serverCallback methodName="preProcess"/>
				</pre_processing>
				<post_processing>
					<serverCallback methodName="postProcess" capture="true"/>
				</post_processing>
			</action>
		</actions>
	</registry_contributions>
	<dependencies>
		<!-- Stream Wrapper Access -->
		<activePlugin pluginName="access.AJXP_STREAM_PROVIDER|access.ajxp_home"/>
	</dependencies>
	<processing>
		<clientForm id="flash_upload_form"><![CDATA[
			<!-- FLEX UPLOAD FORM -->
			<div id="flash_upload_form" box_width="470">
			<div id="flashscreen">
			<iframe id="flashframe" frameborder="0" src=""></iframe>
			</div>
			</div>
		]]></clientForm>
		<dialogOnOpen><![CDATA[
        var src = window.ajxpServerAccessPath + '&get_action=flex_tpl&encode=false';
        modal.getForm().down('#flashframe').src = src;
		]]></dialogOnOpen>
		<activeCondition><![CDATA[
            var otherUploadersCount = XMLUtils.XPathSelectNodes(ajaxplorer.getXmlRegistry(), 'plugins/uploader[@id!="uploader.flex"]').length;
            if(otherUploadersCount == 0) return true;
			var xhrUpload = (typeof File != "undefined" && typeof (new XMLHttpRequest()).upload != "undefined"  && 'draggable' in new Element('span') && (window.FileReader || window.FormData) );
			return (getFlashVersion() >= 8 && (document.location.href.substring(0,5)!='https' || Prototype.Browser.IE) && ! xhrUpload );
		]]></activeCondition>
	</processing>
</uploader>
