All pastes #799731 Raw Edit

Meins

public text v1 · immutable
#799731 ·published 2007-11-27 21:07 UTC
rendered paste body
<%
import dcWebmin.plugin.forum.*;

boolean row = false;

function void printSubcategory(ForumCategory subcategory) {
	include("forum_category.jxp");

	if (subcategory.hasChildren()) {
		for (ForumCategory subcat : subcategory.getChildren()) {
			if (ACCOUNT.hasRole(subcat.getNeededRoles())) {
				row = !row;
				printSubcategory(subcat);
			}
		}
	}
}
%>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="16" class="news_title"><table width="100%" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td><div align="center">Forum</div></td>
                <td width="100"><div align="center">Themen</div></td>
                <td width="100"><div align="center">Beitr&auml;ge</div></td>
                <td width="120"><div align="center">Letzter Beitrag </div></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><img src="/images/trans.gif" width="5" height="5" /></td>
          </tr>
          <tr>
            <td bgcolor="#e5a721"><img src="/images/trans.gif" width="1" height="1" /></td>
          </tr>
          <tr>
            <td><img src="/images/trans.gif" width="5" height="5" /></td>
          </tr>
          <tr>
            <td>
<%
for (ForumCategory category : FORUM_CATEGORIES) {
	if (category.getDeepth() == 0) {
		if (ACCOUNT.hasRole(category.getNeededRoles())) {
			include("forum_topcategory.jxp");
		
			if (category.hasChildren()) {
				row = false;
	
				for (ForumCategory subcat : category.getChildren()) {
					if (ACCOUNT.hasRole(subcat.getNeededRoles())) {
						row = !row;
						printSubcategory(subcat);
					}
				}
			}
		
			println("<br>");
		}
	}
}
%>
			</td>
          </tr>
        </table>