
META-INF.resources.document_library.toolbar.jsp Maven / Gradle / Ivy
The newest version!
<%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ include file="/document_library/init.jsp" %>
<%
String mvcRenderCommandName = ParamUtil.getString(request, "mvcRenderCommandName");
String navigation = ParamUtil.getString(request, "navigation", "home");
long repositoryId = GetterUtil.getLong((String)request.getAttribute("view.jsp-repositoryId"));
long folderId = GetterUtil.getLong((String)request.getAttribute("view.jsp-folderId"));
long fileEntryTypeId = ParamUtil.getLong(request, "fileEntryTypeId", -1);
String searchContainerId = ParamUtil.getString(request, "searchContainerId");
boolean search = mvcRenderCommandName.equals("/document_library/search");
%>
<%
String label = null;
if (fileEntryTypeId != -1) {
String fileEntryTypeName = LanguageUtil.get(request, "basic-document");
if (fileEntryTypeId != DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT) {
DLFileEntryType fileEntryType = DLFileEntryTypeLocalServiceUtil.getFileEntryType(fileEntryTypeId);
fileEntryTypeName = fileEntryType.getName(locale);
}
label = LanguageUtil.get(request, "document-types") + StringPool.COLON + StringPool.SPACE + fileEntryTypeName;
}
%>
<%
Group scopeGroup = themeDisplay.getScopeGroup();
%>
<%
String taglibURL = "javascript:Liferay.fire('" + renderResponse.getNamespace() + "editEntry', {action: '" + Constants.CHECKIN + "'}); void(0);";
%>
<%
taglibURL = "javascript:Liferay.fire('" + renderResponse.getNamespace() + "editEntry', {action: '" + Constants.CHECKOUT + "'}); void(0);";
%>
<%
taglibURL = "javascript:Liferay.fire('" + renderResponse.getNamespace() + "editEntry', {action: '" + Constants.MOVE + "'}); void(0);";
%>
function deleteEntries() {
if (<%= DLTrashUtil.isTrashEnabled(scopeGroupId, repositoryId) %> || confirm('<%= UnicodeLanguageUtil.get(request, "are-you-sure-you-want-to-delete-the-selected-entries") %>')) {
Liferay.fire(
'<%= renderResponse.getNamespace() %>editEntry',
{
action: '<%= DLTrashUtil.isTrashEnabled(scopeGroupId, repositoryId) ? Constants.MOVE_TO_TRASH : Constants.DELETE %>'
}
);
}
}
AUI.$('# fileEntryTypes').on(
'click',
function(event) {
event.preventDefault();
var itemSelectorDialog = new A.LiferayItemSelectorDialog(
{
eventName: ' selectFileEntryType',
on: {
selectedItemChange: function(event) {
var selectedItem = event.newVal;
if (selectedItem) {
var uri = '<%= viewFileEntryTypeURL %>';
uri = Liferay.Util.addParams(' fileEntryTypeId=' + selectedItem, uri);
location.href = uri;
}
}
},
'strings.add': ' ',
title: ' ',
url: ' '
}
);
itemSelectorDialog.open();
}
);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy