Search in sources :

Example 1 with TreeGroup

use of net.jforum.util.TreeGroup in project jforum2 by rafaelsteil.

the class ForumAction method insert.

// One more, one more
public void insert() {
    CategoryDAO cm = DataAccessDriver.getInstance().newCategoryDAO();
    this.context.put("groups", new TreeGroup().getNodes());
    this.context.put("selectedList", new ArrayList());
    this.setTemplateName(TemplateKeys.FORUM_ADMIN_INSERT);
    this.context.put("categories", cm.selectAll());
    this.context.put("action", "insertSave");
}
Also used : CategoryDAO(net.jforum.dao.CategoryDAO) TreeGroup(net.jforum.util.TreeGroup) ArrayList(java.util.ArrayList)

Example 2 with TreeGroup

use of net.jforum.util.TreeGroup in project jforum2 by rafaelsteil.

the class GroupAction method edit.

// Edit a group
public void edit() {
    int groupId = this.request.getIntParameter("group_id");
    GroupDAO gm = DataAccessDriver.getInstance().newGroupDAO();
    this.setTemplateName(TemplateKeys.GROUP_EDIT);
    this.context.put("group", gm.selectById(groupId));
    this.context.put("groups", new TreeGroup().getNodes());
    this.context.put("selectedList", new ArrayList());
    this.context.put("action", "editSave");
}
Also used : TreeGroup(net.jforum.util.TreeGroup) ArrayList(java.util.ArrayList) GroupDAO(net.jforum.dao.GroupDAO)

Example 3 with TreeGroup

use of net.jforum.util.TreeGroup in project jforum2 by rafaelsteil.

the class UserAction method groups.

// Groups
public void groups() {
    int userId = this.request.getIntParameter("id");
    UserDAO um = DataAccessDriver.getInstance().newUserDAO();
    User u = um.selectById(userId);
    List selectedList = new ArrayList();
    for (Iterator iter = u.getGroupsList().iterator(); iter.hasNext(); ) {
        selectedList.add(new Integer(((Group) iter.next()).getId()));
    }
    this.context.put("selectedList", selectedList);
    this.context.put("groups", new TreeGroup().getNodes());
    this.context.put("user", u);
    this.context.put("userId", new Integer(userId));
    this.setTemplateName(TemplateKeys.USER_ADMIN_GROUPS);
    this.context.put("groupFor", I18n.getMessage("User.GroupsFor", new String[] { u.getUsername() }));
}
Also used : TreeGroup(net.jforum.util.TreeGroup) Group(net.jforum.entities.Group) User(net.jforum.entities.User) UserDAO(net.jforum.dao.UserDAO) TreeGroup(net.jforum.util.TreeGroup) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List)

Example 4 with TreeGroup

use of net.jforum.util.TreeGroup in project jforum2 by rafaelsteil.

the class UserAction method commonData.

private void commonData() {
    this.context.put("selectedList", new ArrayList());
    this.context.put("groups", new TreeGroup().getNodes());
    this.setTemplateName(TemplateKeys.USER_ADMIN_COMMON);
    this.context.put("searchAction", "list");
    this.context.put("searchId", new Integer(-1));
}
Also used : TreeGroup(net.jforum.util.TreeGroup) ArrayList(java.util.ArrayList)

Example 5 with TreeGroup

use of net.jforum.util.TreeGroup in project jforum2 by rafaelsteil.

the class AttachmentsAction method quotaLimit.

public void quotaLimit() {
    AttachmentDAO am = DataAccessDriver.getInstance().newAttachmentDAO();
    this.context.put("quotas", am.selectQuotaLimit());
    this.setTemplateName(TemplateKeys.ATTACHMENTS_QUOTA_LIMIT);
    this.context.put("groups", new TreeGroup().getNodes());
    this.context.put("selectedList", new ArrayList());
    this.context.put("groupQuotas", am.selectGroupsQuotaLimits());
}
Also used : AttachmentDAO(net.jforum.dao.AttachmentDAO) TreeGroup(net.jforum.util.TreeGroup) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)7 TreeGroup (net.jforum.util.TreeGroup)7 Iterator (java.util.Iterator)1 List (java.util.List)1 AttachmentDAO (net.jforum.dao.AttachmentDAO)1 CategoryDAO (net.jforum.dao.CategoryDAO)1 GroupDAO (net.jforum.dao.GroupDAO)1 UserDAO (net.jforum.dao.UserDAO)1 Group (net.jforum.entities.Group)1 User (net.jforum.entities.User)1