%
/**
* Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
%>
" />
<%
List headerNames = new ArrayList();
headerNames.add("theme");
headerNames.add("active");
headerNames.add("roles");
SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, SearchContainer.DEFAULT_DELTA, portletURL, headerNames, null);
List themes = ThemeLocalServiceUtil.getThemes(company.getCompanyId());
int total = themes.size();
searchContainer.setTotal(total);
List results = ListUtil.subList(themes, searchContainer.getStart(), searchContainer.getEnd());
searchContainer.setResults(results);
List resultRows = searchContainer.getResultRows();
for (int i = 0; i < results.size(); i++) {
Theme theme2 = (Theme)results.get(i);
PluginPackage pluginPackage = theme2.getPluginPackage();
PluginSetting pluginSetting = PluginSettingLocalServiceUtil.getPluginSetting(company.getCompanyId(), theme2.getThemeId(), Plugin.TYPE_THEME);
ResultRow row = new ResultRow(theme2, theme2.getThemeId(), i);
PortletURL rowURL = renderResponse.createRenderURL();
rowURL.setWindowState(WindowState.MAXIMIZED);
rowURL.setParameter("struts_action", "/enterprise_admin/edit_plugin");
rowURL.setParameter("redirect", currentURL);
if (pluginPackage != null) {
rowURL.setParameter("moduleId", pluginPackage.getModuleId());
}
rowURL.setParameter("pluginId", theme2.getThemeId());
rowURL.setParameter("pluginType", Plugin.TYPE_THEME);
// Name and thumbnail
StringBuilder sb = new StringBuilder();
if (showEditPluginHREF) {
sb.append("");
}
sb.append("");
sb.append(theme2.getName());
sb.append("");
if (showEditPluginHREF) {
sb.append("");
}
sb.append(" ");
sb.append(LanguageUtil.get(pageContext, "package"));
sb.append(": ");
if (pluginPackage == null) {
sb.append(LanguageUtil.get(pageContext, "unknown"));
}
else {
sb.append(pluginPackage.getName());
if (pluginPackage.getContext() != null) {
sb.append(" (");
sb.append(pluginPackage.getContext());
sb.append(")");
}
}
List colorSchemes = theme2.getColorSchemes();
if (colorSchemes.size() > 0) {
sb.append(" ");
sb.append(LanguageUtil.get(pageContext, "color-schemes"));
sb.append(": ");
for (int j = 0; j < colorSchemes.size(); j++) {
ColorScheme colorScheme2 = (ColorScheme)colorSchemes.get(j);
sb.append(colorScheme2.getName());
if ((j + 1) < colorSchemes.size()) {
sb.append(", ");
}
}
}
row.addText(sb.toString());
// Active
row.addText(LanguageUtil.get(pageContext, (pluginSetting.isActive() ? "yes" : "no")));
// Roles
row.addText(StringUtil.merge(pluginSetting.getRolesArray(), ", "));
// Add result row
resultRows.add(row);
}
%>