📄 forums.jsp
字号:
if (category.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN)) { if (category.isAuthorized(Permissions.SYSTEM_ADMIN)) { isMultipleCatAdmin = true; } else { List cats = categoriesWithPermission(forumFactory, Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN); for (int i = 0; i < cats.size(); i++) { ForumCategory c = (ForumCategory) cats.get(i); if (c.getID() == category.getID()) { continue; } Iterator subCats = category.getRecursiveCategories(); boolean found = false; while (subCats.hasNext()) { ForumCategory subCat = (ForumCategory) subCats.next(); if (subCat.getID() == c.getID()) { found = true; break; } } // if the category is not a subcategory then it must be another category if (!found) { isMultipleCatAdmin = true; } } } } while (forums.hasNext()) { hadForums = true; forumIndex ++; Forum forum = (Forum)forums.next(); boolean hasForumEditPerms = forum.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN | ForumPermissions.FORUM_ADMIN | ForumPermissions.MODERATOR); boolean hasForumAdminPerms = forum.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN | ForumPermissions.FORUM_ADMIN); boolean hasCatAdminPerms = forum.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN); %> <tr bgcolor="#ffffff"> <td> <% if (hasForumAdminPerms) { %> <font size="-1" face="arial"> <a href="editForum.jsp?forum=<%= forum.getID() %>" ><b><%= forum.getName() %></b></a> </font> <% } else { %> <font size="-1" face="arial"><b><%= forum.getName() %></b></font> <% } %> <% if (forum.getDescription() != null) { %> <font size="-2" face="arial"> <br><%= forum.getDescription() %> </font> <% } %> </td> <td align="center"> <table cellpadding="0" cellspacing="0" border="0"> <tr><td> <% if (forumIndex > 0 && hasCatAdminPerms) { %> <a href="forums.jsp?forum=<%= forum.getID() %>&cat=<%= category.getID() %>&fIndex=<%= forumIndex %>&up=true" ><img src="images/arrow_up.gif" width="13" height="9" border="0" vspace="2" hspace="2"></a> <% } else { %> <img src="images/blank.gif" width="13" height="9" border="0" vspace="2" hspace="2"> <% } %> </td> <td> <% if (forums.hasNext() && hasCatAdminPerms) { %> <a href="forums.jsp?forum=<%= forum.getID() %>&cat=<%= category.getID() %>&fIndex=<%= forumIndex %>&down=true" ><img src="images/arrow_down.gif" width="13" height="9" border="0" vspace="2" hspace="2"></a> <% } else { %> <img src="images/blank.gif" width="13" height="9" border="0" vspace="2" hspace="2"> <% } %> </td></tr> </table> </td> <td align="center"> <font size="-1" face="arial"> <% if (hasForumEditPerms) { %> <a href="forumContent.jsp?forum=<%= forum.getID() %>" ><%= forum.getThreadCount() %></a> <% } else { %> <%= forum.getThreadCount() %> <% } %> </font> </td> <td align="center"> <font size="-1" face="arial"> <%= forum.getMessageCount() %> </font> </td> <td align="center"> <% if (hasForumAdminPerms) { %> <a href="editForum.jsp?forum=<%= forum.getID() %>" title="Click to edit all forum properties" ><img src="images/button_edit.gif" width="17" height="17" border="0"></a> <% } else { %> <% } %> </td> <td align="center"> <% if (hasCatAdminPerms) { %> <a href="removeForum.jsp?forum=<%= forum.getID() %>" title="Click to delete this forum" ><img src="images/button_delete.gif" width="17" height="17" border="0"></a> <% } else { %> <% } %> </td> <td align="center"> <% if (hasCatAdminPerms && isMultipleCatAdmin) { %> <font size="-1" face="arial"> <input type="checkbox" name="forum" value="<%= forum.getID() %>"> </font> <% } else { %> <% } %> </td> </tr> <% } // end while forums.hasNext() %> <% if (hadForums) { %> <tr bgcolor="#ffffff"> <td colspan="6" bgcolor="#eeeeee"> <% if (category.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN)) { %> <input type="submit" value="Create New Forum" class="but" name="newforum"> <% } else { %> <% } %> </td> <td align="center"> <% if (category.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN) && isMultipleCatAdmin) { %> <font size="-1" face="arial"> <input type="submit" value="Move.." class="but" name="moveForum"> </font> <% } else { %> <% } %> </td> </tr> <% } %> </table> </td></tr> </table> </td> </tr> <tr> <td colspan="2"> <table cellpadding="8" cellspacing="0" border="0"> <tr><td> <font face="arial"> <br> <b>Sub-Categories</b> </font> </td></tr> </table> </td> </tr> <tr> <td width="1%"> <img src="images/blank.gif" width="20" height="1" border="0"> </td> <td width="99%"> <table bgcolor="#bbbbbb" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr><td> <table bgcolor="#bbbbbb" cellpadding="3" cellspacing="1" border="0" width="100%"> <tr bgcolor="#dddddd"> <td> <font size="-2" face="verdana" width="94%"> <b>NAME / DESCRIPTION</b> </font> </td> <td align="center" width="1%" nowrap> <font size="-2" face="verdana"> <b>ORDER</b> </font> </td> <td align="center" width="1%" nowrap> <font size="-2" face="verdana"> <b>FORUMS</b> </font> </td> <td align="center" width="1%" nowrap> <font size="-2" face="verdana"> <b>CATEGORIES</b> </font> </td> <td align="center" width="1%" nowrap> <font size="-2" face="verdana"> <b>EDIT</b> </font> </td> <td align="center" width="1%" nowrap> <font size="-2" face="verdana"> <b>DELETE</b> </font> </td> <td align="center" width="1%" nowrap> <font size="-2" face="verdana"> <b>MOVE</b> </font> </td> </tr> <% // Loop throught all the sub categories. Indicate if there are none: if (!categories.hasNext()) { %> <tr bgcolor="#ffffff"> <td colspan="7" align="center"> <br> <% if (category.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN)) { %> <input type="submit" value="Create New Sub-Category" class="but" name="newcat"> <% } %> <br><br> </td> </tr> <% } // Print out all subcategories: boolean hadSubCats = false; int catIndex = -1; while (categories.hasNext()) { catIndex ++; hadSubCats = true; ForumCategory subCat = (ForumCategory)categories.next(); boolean hasCatAdminPerms = subCat.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN); boolean hasParentCatAdminPerms = category.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN); %> <tr bgcolor="#ffffff"> <td> <font size="-1" face="arial"> <a href="forums.jsp?cat=<%= subCat.getID() %>" ><b><%= subCat.getName() %></b></a> </font> <% if (subCat.getDescription() != null) { %> <font size="-2" face="arial"> <br><%= subCat.getDescription() %> </font> <% } %> </td> <td align="center"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td> <% if (catIndex > 0 && hasParentCatAdminPerms) { %> <a href="forums.jsp?subcat=<%= subCat.getID() %>&cat=<%= category.getID() %>&cIndex=<%= catIndex %>&up=true" ><img src="images/arrow_up.gif" width="13" height="9" border="0" vspace="2" hspace="2"></a> <% } else { %> <img src="images/blank.gif" width="13" height="9" border="0" vspace="2" hspace="2"> <% } %> </td> <td> <% if (categories.hasNext() && hasParentCatAdminPerms) { %> <a href="forums.jsp?subcat=<%= subCat.getID() %>&cat=<%= category.getID() %>&cIndex=<%= catIndex %>&down=true" ><img src="images/arrow_down.gif" width="13" height="9" border="0" vspace="2" hspace="2"></a> <% } else { %> <img src="images/blank.gif" width="13" height="9" border="0" vspace="2" hspace="2"> <% } %> </td> </tr> </table> </td> <td align="center"> <font size="-1" face="arial"> <%= subCat.getForumCount() %> </font> </td> <td align="center"> <font size="-1" face="arial"> <%= subCat.getCategoryCount() %> </font> </td> <td align="center"> <% if (hasCatAdminPerms) { %> <a href="editCat.jsp?cat=<%= subCat.getID() %>" title="Click to edit all category properties" ><img src="images/button_edit.gif" width="17" height="17" border="0"></a> <% } else { %> <% } %> </td> <td align="center"> <% if (hasParentCatAdminPerms) { %> <a href="deleteCategory.jsp?cat=<%= subCat.getID() %>" title="Click to delete this category" ><img src="images/button_delete.gif" width="17" height="17" border="0"></a> <% } else { %> <% } %> </td> <td align="center"> <% if (isMultipleCatAdmin) { %> <font size="-1" face="arial"> <input type="submit" value="Move" class="but" name="moveCat" onclick="this.form.srcCat.value='<%= subCat.getID() %>';"> <% } else { %> <% } %> </font> </td> </tr> <% } // end while categories.next() %> <% if (hadSubCats) { %> <tr bgcolor="#ffffff"> <td colspan="7" bgcolor="#eeeeee"> <% if (category.isAuthorized(Permissions.SYSTEM_ADMIN | ForumPermissions.FORUM_CATEGORY_ADMIN)) { %> <input type="submit" value="Create New Sub-Category" class="but" name="newcat"> <% } else { %> <% } %> </td> </tr> <% } %> </table> </td></tr> </table> </td> </tr> </form> </table> <br> </td></tr></table></td></tr></table><%@ include file="footer.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -