Hi all.
I had the same problem and I started from this topic to realize my solution, that really works very well!
This is what I've done with Liferay 6.1CE:
1) put in hook plugin the file "edit_article_content_xsd_el.jsp"
2) After this line
1<aui:button cssClass="journal-documentlibrary-button" data="<%= data %>" value="select" />
put:
1
2<liferay-portlet:renderURL var="documentLibraryUploadURL" portletName="20"
3 windowState="<%= LiferayWindowState.POP_UP.toString() %>"
4 portletMode="<%= PortletMode.VIEW.toString() %>">
5 <portlet:param name="struts_action" value="/document_library/view" />
6 <portlet:param name="groupId" value="<%= String.valueOf(dlScopeGroupId) %>" />
7</liferay-portlet:renderURL>
8
9<script type="text/javascript">
10 if(typeof <portlet:namespace />showUploadFilePopup != 'function') {
11 <portlet:namespace />showUploadFilePopup = function () {
12 AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
13 var dialog = new A.Dialog({
14 title: '<liferay-ui:message key="file-upload" />',
15 centered: true,
16 draggable: true,
17 height: 560,
18 width: 940
19 }).plug(A.Plugin.IO, {uri: '<%= documentLibraryUploadURL %>'}).render();
20 dialog.show();
21 });
22 };
23 };
24</script>
25
26<input type="button" value="<liferay-ui:message key="file-upload" />" onClick="<portlet:namespace />showUploadFilePopup();" />
3. Deploy the hook
4. Enjoy direct file upload!
Still to do:
return the value from the popup with the path of the uploaded file in order to fill the input of the web content form
Please sign in to flag this as inappropriate.