1 43 package net.jforum.view.admin.common; 44 45 import java.util.Iterator ; 46 47 import net.jforum.dao.DataAccessDriver; 48 import net.jforum.entities.Category; 49 import net.jforum.entities.Forum; 50 51 55 public class ModerationCommon 56 { 57 public void setForumsModerationStatus(Category c, boolean status) throws Exception 58 { 59 for (Iterator iter = c.getForums().iterator(); iter.hasNext(); ) { 60 Forum f = (Forum)iter.next(); 61 if (f.isModerated() != c.isModerated()) { 62 f.setModerated(c.isModerated()); 63 this.setTopicModerationStatus(f.getId(), c.isModerated()); 64 } 65 } 66 67 DataAccessDriver.getInstance().newForumDAO().setModerated(c.getId(), status); 68 } 69 70 public void setTopicModerationStatus(int forumId, boolean status) throws Exception 71 { 72 DataAccessDriver.getInstance().newTopicDAO().setModerationStatus(forumId, status); 73 } 74 } 75 | Popular Tags |