<%
/**
 * Copyright (c) 2000-2011 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.
 */
%>

<liferay-ui:search-container-column-text
	buffer="buffer"
	name="name"
>

	<%
	String localizedName = LanguageUtil.get(pageContext, name);

	if (name.equals(localizedName)) {
		localizedName = TextFormatter.format(name, TextFormatter.J);
	}

	buffer.append("<a href=\"");
	buffer.append(rowURL.toString());
	buffer.append("\">");
	buffer.append("<strong>");
	buffer.append(HtmlUtil.escape(localizedName));
	buffer.append("</strong>");
	buffer.append("</a>");

	buffer.append("<br /><span class=\"key\">");
	buffer.append(LanguageUtil.get(pageContext, "key"));
	buffer.append("</span>: ");

	buffer.append("<a href=\"");
	buffer.append(rowURL.toString());
	buffer.append("\">");
	buffer.append(HtmlUtil.escape(name));
	buffer.append("</a>");

	if (Validator.isNotNull(expandoColumn.getDefaultData())) {
		buffer.append("<br /><span class=\"default-value\">");
		buffer.append(LanguageUtil.get(pageContext, "default-value"));
		buffer.append("</span>: ");

		if (type == ExpandoColumnConstants.STRING_ARRAY) {
			ExpandoValue expandoValue = new ExpandoValueImpl();

			expandoValue.setColumnId(expandoColumn.getColumnId());
			expandoValue.setData(expandoColumn.getDefaultData());

			for (String stringValue : expandoValue.getStringArray()) {
				buffer.append("<br />");
				buffer.append(stringValue);
			}
		}
		else {
			buffer.append(HtmlUtil.escape(expandoColumn.getDefaultData()));
		}
	}
	%>

</liferay-ui:search-container-column-text>

<liferay-ui:search-container-column-text
	href="<%= rowURL %>"
	name="type"
	value="<%= LanguageUtil.get(pageContext, ExpandoColumnConstants.getTypeLabel(type)) %>"
/>

<liferay-ui:search-container-column-text
	href="<%= rowURL %>"
	buffer="buffer"
	name="hidden"
>

	<%
	boolean hidden = GetterUtil.getBoolean(typeSettings.getProperty(ExpandoColumnConstants.PROPERTY_HIDDEN));

	buffer.append(LanguageUtil.get(pageContext, String.valueOf(hidden)));
	%>

</liferay-ui:search-container-column-text>

<liferay-ui:search-container-column-text
	buffer="buffer"
	href="<%= rowURL %>"
	name="searchable"
>

	<%
	boolean searchable = GetterUtil.getBoolean(typeSettings.getProperty(ExpandoBridgeIndexer.INDEXABLE));

	buffer.append(LanguageUtil.get(pageContext, String.valueOf(searchable)));
	%>

</liferay-ui:search-container-column-text>

<liferay-ui:search-container-column-jsp
	align="right"
	path="/html/portlet/expando/expando_action.jsp"
/>