<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/html/taglib/ui/social_bookmarks/init.jsp" %>

<c:if test="<%= typesArray.length > 0 %>">

	<%
	String randomNamespace = PortalUtil.generateRandomKey(request, "taglib_ui_social_bookmarks_page") + StringPool.UNDERLINE;
	%>

	<div class="taglib-social-bookmarks" id="<%= randomNamespace %>socialBookmarks">
		<c:choose>
			<c:when test='<%= displayStyle.equals("menu") %>'>
				<liferay-ui:icon-menu direction="right" icon="share-alt" markupView="lexicon" message="share" showWhenSingleIcon="<%= true %>">

					<%
					for (int i = 0; i < typesArray.length; i++) {
					%>

						<liferay-ui:social-bookmark contentId="<%= contentId %>" displayStyle="<%= displayStyle %>" target="<%= target %>" title="<%= title %>" type="<%= typesArray[i] %>" url="<%= url %>" />

					<%
					}
					%>

				</liferay-ui:icon-menu>

				<aui:script use="liferay-social-bookmarks">
					new Liferay.SocialBookmarks(
						{
							contentBox: '#<%= randomNamespace %>socialBookmarks'
						}
					);
				</aui:script>
			</c:when>
			<c:otherwise>
				<ul class="list-unstyled <%= displayStyle %>">

					<%
					for (int i = 0; i < typesArray.length; i++) {
						String styleClass = "taglib-social-bookmark-" + typesArray[i];
					%>

						<li class="taglib-social-bookmark <%= styleClass %>">
							<liferay-ui:social-bookmark contentId="<%= contentId %>" displayStyle="<%= displayStyle %>" target="<%= target %>" title="<%= title %>" type="<%= typesArray[i] %>" url="<%= url %>" />
						</li>

					<%
					}
					%>

				</ul>
			</c:otherwise>
		</c:choose>
	</div>
</c:if>