Search in sources :

Example 1 with OmMenuItem

use of org.apache.openmeetings.web.common.menu.OmMenuItem in project openmeetings by apache.

the class MainPanel method getMainMenu.

private List<IMenuItem> getMainMenu() {
    List<IMenuItem> mmenu = new ArrayList<>();
    {
        // Dashboard Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("290", "1450", MenuActions.dashboardModuleStartScreen, null));
        l.add(getSubItem("291", "1451", MenuActions.dashboardModuleCalendar, null));
        mmenu.add(new OmMenuItem(getString("124"), l));
    }
    {
        // Conference Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("777", "1506", MenuActions.conferenceModuleRoomList, MenuParams.publicTabButton));
        l.add(getSubItem("779", "1507", MenuActions.conferenceModuleRoomList, MenuParams.privateTabButton));
        if (cfgDao.getBool(CONFIG_MYROOMS_ENABLED, true)) {
            l.add(getSubItem("781", "1508", MenuActions.conferenceModuleRoomList, MenuParams.myTabButton));
        }
        List<Room> recent = roomDao.getRecent(getUserId());
        if (!recent.isEmpty()) {
            l.add(new OmMenuItem(DELIMITER, (String) null));
        }
        for (Room r : recent) {
            final Long roomId = r.getId();
            l.add(new OmMenuItem(r.getName(), r.getName()) {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    RoomEnterBehavior.roomEnter((MainPage) getPage(), target, roomId);
                }
            });
        }
        mmenu.add(new OmMenuItem(getString("792"), l));
    }
    {
        // Recording Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("395", "1452", MenuActions.recordModule, null));
        mmenu.add(new OmMenuItem(getString("395"), l));
    }
    Set<Right> r = WebSession.getRights();
    boolean isAdmin = hasAdminLevel(r);
    if (isAdmin || hasGroupAdminLevel(r)) {
        // Administration Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("125", "1454", MenuActions.adminModuleUser, null));
        if (isAdmin) {
            l.add(getSubItem("597", "1455", MenuActions.adminModuleConnections, null));
        }
        l.add(getSubItem("126", "1456", MenuActions.adminModuleOrg, null));
        l.add(getSubItem("186", "1457", MenuActions.adminModuleRoom, null));
        if (isAdmin) {
            l.add(getSubItem("263", "1458", MenuActions.adminModuleConfiguration, null));
            l.add(getSubItem("348", "1459", MenuActions.adminModuleLanguages, null));
            l.add(getSubItem("1103", "1454", MenuActions.adminModuleLDAP, null));
            l.add(getSubItem("1571", "1572", MenuActions.adminModuleOAuth, null));
            l.add(getSubItem("367", "1461", MenuActions.adminModuleBackup, null));
            l.add(getSubItem("main.menu.admin.email", "main.menu.admin.email.desc", MenuActions.adminModuleEmail, null));
        }
        mmenu.add(new OmMenuItem(getString("6"), l));
    }
    return mmenu;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) OmMenuItem(org.apache.openmeetings.web.common.menu.OmMenuItem) IMenuItem(com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem) ArrayList(java.util.ArrayList) Right(org.apache.openmeetings.db.entity.user.User.Right) List(java.util.List) ArrayList(java.util.ArrayList) Room(org.apache.openmeetings.db.entity.room.Room)

Aggregations

IMenuItem (com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Room (org.apache.openmeetings.db.entity.room.Room)1 Right (org.apache.openmeetings.db.entity.user.User.Right)1 OmMenuItem (org.apache.openmeetings.web.common.menu.OmMenuItem)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1