001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software GmbH & Co. KG, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.workplace.tools.accounts;
029
030import org.opencms.workplace.CmsDialog;
031import org.opencms.workplace.list.A_CmsListDialog;
032import org.opencms.workplace.list.CmsTwoListsDialog;
033
034/**
035 * Class for managing two organizational unit lists on the same dialog.<p>
036 *
037 * @since 6.5.6
038 */
039public class CmsTwoOrgUnitUsersList extends CmsTwoListsDialog {
040
041    /**
042     * Default constructor.<p>
043     *
044     * @param wp1 the workplace instance for the first list
045     * @param wp2 the workplace instance for the second list
046     */
047    public CmsTwoOrgUnitUsersList(A_CmsListDialog wp1, A_CmsListDialog wp2) {
048
049        super(wp1, wp2);
050    }
051
052    /**
053     * @see org.opencms.workplace.list.CmsTwoListsDialog#defaultActionHtml()
054     */
055    @Override
056    public String defaultActionHtml() {
057
058        StringBuffer result = new StringBuffer(2048);
059        result.append(defaultActionHtmlStart());
060        result.append(defaultActionHtmlContent());
061        result.append(customHtmlEnd());
062        result.append(defaultActionHtmlEnd());
063        return result.toString();
064    }
065
066    /**
067     * Returns the custom html end code for this dialog.<p>
068     *
069     * @return custom html code
070     */
071    protected String customHtmlEnd() {
072
073        StringBuffer result = new StringBuffer(512);
074        result.append("<form name='actions' method='post' action='");
075        result.append(getFirstWp().getDialogRealUri());
076        result.append("' class='nomargin' onsubmit=\"return submitAction('ok', null, 'actions');\">\n");
077        result.append(getFirstWp().allParamsAsHidden());
078        result.append("<div class=\"dialogspacer\" unselectable=\"on\">&nbsp;</div>\n");
079        result.append("<!-- button row start -->\n<div class=\"dialogbuttons\" unselectable=\"on\">\n");
080        result.append("<input name='");
081        result.append(CmsDialog.DIALOG_CONFIRMED);
082        result.append("' type='button' value='");
083        result.append(
084            Messages.get().container(Messages.GUI_ORGUNITUSERS_BUTTON_CONFIRM_0).key(getFirstWp().getLocale()));
085        result.append("' onclick=\"submitAction('");
086        result.append(CmsDialog.DIALOG_CONFIRMED);
087        result.append("', form);\" class='dialogbutton'>\n");
088        result.append("<input name='");
089        result.append(CmsDialog.DIALOG_CANCEL);
090        result.append("' type='button' value='");
091        result.append(
092            Messages.get().container(Messages.GUI_ORGUNITUSERS_BUTTON_CANCEL_0).key(getFirstWp().getLocale()));
093        result.append("' onclick=\"submitAction('");
094        result.append(CmsDialog.DIALOG_CANCEL);
095        result.append("', form);\" class='dialogbutton'>\n");
096        result.append("</div>\n<!-- button row end -->\n");
097        result.append("</form>\n");
098        return result.toString();
099    }
100}