Search in sources :

Example 1 with ModerationCommon

use of net.jforum.view.admin.common.ModerationCommon in project jforum2 by rafaelsteil.

the class CategoryAction method editSave.

//  Save information
public void editSave() {
    Category c = new Category(ForumRepository.getCategory(this.request.getIntParameter("categories_id")));
    c.setName(this.request.getParameter("category_name"));
    c.setModerated("1".equals(this.request.getParameter("moderate")));
    this.cm.update(c);
    ForumRepository.reloadCategory(c);
    new ModerationCommon().setForumsModerationStatus(c, c.isModerated());
    this.list();
}
Also used : Category(net.jforum.entities.Category) ModerationCommon(net.jforum.view.admin.common.ModerationCommon)

Example 2 with ModerationCommon

use of net.jforum.view.admin.common.ModerationCommon in project jforum2 by rafaelsteil.

the class ForumAction method editSave.

public void editSave() {
    ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO();
    Forum f = forumDao.selectById(this.request.getIntParameter("forum_id"));
    boolean moderated = f.isModerated();
    int categoryId = f.getCategoryId();
    f.setDescription(this.request.getParameter("description"));
    f.setIdCategories(this.request.getIntParameter("categories_id"));
    f.setName(this.request.getParameter("forum_name"));
    f.setModerated("1".equals(this.request.getParameter("moderate")));
    forumDao.update(f);
    if (moderated != f.isModerated()) {
        new ModerationCommon().setTopicModerationStatus(f.getId(), f.isModerated());
    }
    if (categoryId != f.getCategoryId()) {
        f.setIdCategories(categoryId);
        ForumRepository.removeForum(f);
        f.setIdCategories(this.request.getIntParameter("categories_id"));
        ForumRepository.addForum(f);
    } else {
        ForumRepository.reloadForum(f.getId());
    }
    //this.handleMailIntegration();
    this.list();
}
Also used : ForumDAO(net.jforum.dao.ForumDAO) ModerationCommon(net.jforum.view.admin.common.ModerationCommon) Forum(net.jforum.entities.Forum)

Aggregations

ModerationCommon (net.jforum.view.admin.common.ModerationCommon)2 ForumDAO (net.jforum.dao.ForumDAO)1 Category (net.jforum.entities.Category)1 Forum (net.jforum.entities.Forum)1