Returns the HTML to build the input form of the upload dialog.<p>

@return the HTML to build the input form of the upload dialog
353714
protected String defaultActionHtml() {

        StringBuffer result = new StringBuffer(32);

        result.append(htmlStart());
        result.append(bodyStart(null));
        result.append(dialogStart());
        result.append(dialogContentStart(""));
        result.append("<form name=\"main\" class=\"nomargin\" action=\"");
        result.append(getJsp().link(getDialogReturnUri()));
        result.append("\" method=\"post\" onsubmit=\"submitAction('");
        result.append(DIALOG_OK);
        result.append("', null, 'main');\" enctype=\"multipart/form-data\">\n");
        result.append(paramsAsHidden());
        if (getParamFramename() == null) {
            result.append("<input type=\"hidden\" name=\"");
            result.append(PARAM_FRAMENAME);
            result.append("\" value=\"\">");
        }
        result.append(createDialogErrorMessage());
        result.append(dialogBlockStart(getStarttext()));
        result.append("<table border=\"0\" width=\"100%\">\n");
        result.append("<tr>\n\t<td style=\"white-space: nowrap;\" unselectable=\"on\">");
        result.append(getImportMessage());
        result.append(":</td>\n");
        result.append("\t<td class=\"maxwidth\">");
        result.append("<input type=\"file\" name=\"");
        result.append(PARAM_IMPORTFILE);
        result.append("\" class=\"maxwidth\" accept=\"application/zip\">");
        result.append("</td>\n</tr>");
        result.append(getAdditionalParameters());
        result.append("</table>\n");
        result.append(dialogBlockEnd());

        result.append(dialogContentEnd());
        result.append(dialogButtonsOkCancel());
        result.append("</form>\n");
        result.append(dialogEnd());
        result.append(bodyEnd());
        result.append(htmlEnd());
        return result.toString();
    }
1271457
public function getInput()
    {
        $this->htmlOptions['class'] = (isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' ' : '') . 'input markdown-input';
        $this->htmlOptions['ajax-url'] = $this->previewURL ?: WebApp::get()->request()->getCurrentURL();
        $this->htmlOptions['csrf-key'] = WebApp::get()->request()->getCsrfKey();
        $this->htmlOptions['csrf-value'] = WebApp::get()->request()->getCsrfValue();
        return Form::get()->textarea($this->getName(), $this->getValue(), $this->htmlOptions);
    }
1372015
protected function buildPayHtml()
    {
        $html = "<form id='alipaysubmit' name='alipaysubmit' action='{$this->gateway}' method='post'>";
        foreach ($this->options->get() as $key => $value) {
            $value = str_replace("'", '&apos;', $value);
            $html .= "<input type='hidden' name='{$key}' value='{$value}'/>";
        }
        $html .= "<input type='submit' value='ok' style='display:none;'></form>";
        return "{$html}<script>document.forms['alipaysubmit'].submit();</script>";
    }
100283
private String buildAddForm() {

        StringBuffer result = new StringBuffer(256);

        // only display form if the current user has the "control" right
        if (getEditable()) {
            result.append(dialogSpacer());
            result.append(dialogBlockStart(key(Messages.GUI_PERMISSION_ADD_ACE_0)));

            // get all possible entry types
            ArrayList<String> options = new ArrayList<String>();
            ArrayList<String> optionValues = new ArrayList<String>();
            for (int i = 0; i < (getTypes(false).length - (1 * (isRoleEditable() ? 0 : 1))); i++) {
                options.add(getTypesLocalized()[i]);
                optionValues.add(Integer.toString(i));
            }

            // create the input form for adding an ace
            result.append("<form action=\"").append(getDialogUri()).append(
                "\" method=\"post\" name=\"add\" class=\"nomargin\">\n");
            // set parameters to show correct hidden input fields
            setParamAction(DIALOG_ADDACE);
            setParamType(null);
            setParamName(null);
            result.append(paramsAsHidden());
            result.append("<table border=\"0\" width=\"100%\">\n");
            result.append("<tr>\n");
            result.append("\t<td>").append(
                buildSelect("name=\"" + PARAM_TYPE + "\"", options, optionValues, -1)).append("</td>\n");
            result.append("\t<td class=\"maxwidth\"><input type=\"text\" class=\"maxwidth\" name=\"");
            result.append(PARAM_NAME);
            result.append("\" value=\"\"></td>\n");

            result.append("<td><span style='display: block; height: 1px; width: 10px;'/></td>");

            result.append(
                button(
                    new CmsPrincipalWidget().getButtonJs(PARAM_NAME, "add"),
                    null,
                    "principal",
                    org.opencms.workplace.Messages.GUI_DIALOG_BUTTON_SEARCH_0,
                    getSettings().getUserSettings().getEditorButtonStyle()));

            result.append(
                button(
                    "javascript:document.forms['add'].submit();",
                    null,
                    "new",
                    Messages.GUI_LABEL_ADD_0,
                    getSettings().getUserSettings().getEditorButtonStyle()));

            result.append("</tr>\n");
            result.append("</form>\n");
            result.append("</table>\n");

            result.append(dialogBlockEnd());
        }
        return result.toString();
    }
1318484
protected String htmlEnd() {

        StringBuffer html = new StringBuffer(512);
        html.append("\t\t\t</td></tr>\n");
        html.append("\t\t</table>\n");
        if (isBoxed()) {
            html.append(getWp().dialogBlock(CmsWorkplace.HTML_END, m_name.key(getWp().getLocale()), false));
        }
        html.append("</div>\n");
        return html.toString();
    }
828151
@Override
    public String dialogScriptSubmit() {

        if (useNewStyle()) {
            return super.dialogScriptSubmit();
        }
        StringBuffer result = new StringBuffer(512);
        result.append("function submitAction(actionValue, theForm, formName) {\n");
        result.append("\tif (theForm == null) {\n");
        result.append("\t\ttheForm = document.forms[formName];\n");
        result.append("\t}\n");
        result.append("\ttheForm." + PARAM_FRAMENAME + ".value = window.name;\n");
        result.append("\tif (actionValue == \"" + DIALOG_OK + "\") {\n");
        result.append("\t\treturn true;\n");
        result.append("\t}");
        String declinedMessage = getConfigurationContentStringValue(NODE_MESSAGE_DECLINED);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(declinedMessage)) {
            // add the alert to show the declined message
            result.append(" else if (actionValue == \"" + DIALOG_CANCEL + "\") {\n");
            result.append("\t\talert(\"");
            result.append(CmsStringUtil.escapeJavaScript(declinedMessage));
            result.append("\");\n");
            result.append("\t}\n");
        }
        result.append("\ttheForm." + PARAM_ACTION + ".value = actionValue;\n");
        result.append("\ttheForm.submit();\n");
        result.append("\treturn false;\n");
        result.append("}\n");

        return result.toString();
    }
1079983
public String buildIncludeJs() {

        StringBuffer html = new StringBuffer(512);

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("commons/ajax.js'></script>\n");

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("editors/xmlcontent/help.js'></script>\n");

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("admin/javascript/general.js'></script>\n");

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("admin/javascript/list.js'></script>\n");

        html.append("<script type='text/javascript'><!--\n");

        html.append("\tvar ");
        html.append(CmsHtmlList.NO_SELECTION_HELP_VAR);
        html.append(" = '");
        html.append(
            CmsStringUtil.escapeJavaScript(key(org.opencms.workplace.list.Messages.GUI_LIST_ACTION_NO_SELECTION_0)));
        html.append("';\n");

        html.append("function doReportUpdate(msg, state) {\n");
        html.append("\tvar img = state + '.png';\n");
        html.append("\tvar txt = '';\n");
        html.append("\tvar elem = document.getElementById('ajaxreport');\n");
        html.append("\tif (state != 'ok') {\n");
        html.append("\t\tif (state == 'fatal') {\n");
        html.append("\t\t\timg = 'error.png';\n");
        html.append("\t\t\ttxt = '");
        html.append(key(org.opencms.workplace.Messages.GUI_AJAX_REPORT_GIVEUP_0));
        html.append("';\n");
        html.append("\t\t} else if (state == 'wait') {\n");
        html.append("\t\t\timg = 'wait.gif';\n");
        html.append("\t\t\ttxt = '");
        html.append(key(org.opencms.workplace.Messages.GUI_AJAX_REPORT_WAIT_0));
        html.append("'\n");
        html.append("\t\t} else if (state == 'error') {\n");
        html.append("\t\t\ttxt = '");
        html.append(key(org.opencms.workplace.Messages.GUI_AJAX_REPORT_ERROR_0));
        html.append("' + msg;\n");
        html.append("\t\t}\n");
        html.append("\t} else {");
        html.append("\t\telem.innerHTML = msg;\n");
        html.append("\t}\n");
        html.append("\tif (txt != '') {\n");
        html.append("\t\tvar html = \"<table border='0' style='vertical-align:middle; height: 200px;'>\";");
        html.append("\t\thtml += \"<tr><td width='40' align='center' valign='middle'><img src='");
        html.append(getSkinUri());
        html.append("commons/\";");
        html.append("\t\thtml += img;");
        html.append("\t\thtml += \"' width='32' height='32' alt=''></td>\";");
        html.append("\t\thtml += \"<td valign='middle'><span style='color: #000099; font-weight: bold;'>\";");
        html.append("\t\thtml += txt;");
        html.append("\t\thtml += \"</span><br></td></tr></table>\";");
        html.append("\t\telem.innerHTML = html;");
        html.append("\t}\n");
        html.append("}\n");

        html.append("function reloadReport() {\n");
        html.append("\tvar readtree = document.forms[\"");
        html.append(CmsDeletedResourcesList.LIST_ID);
        html.append("-form\"].");
        html.append(PARAM_READTREE);
        html.append(".checked;\n");
        html.append("\tmakeRequest('");
        html.append(getJsp().link("/system/workplace/commons/report-deleted.jsp"));
        html.append("', '");
        html.append(CmsDialog.PARAM_RESOURCE);
        html.append("=");
        html.append(getParamResource());
        html.append("&");
        html.append(PARAM_READTREE);
        html.append("=");
        html.append("' + readtree");
        html.append(", 'doReportUpdate');\n");
        html.append("}\n");

        html.append("// -->\n");
        html.append("</script>\n");

        return html.toString();
    }
510309
public String buildEditForm() {

        StringBuffer result = new StringBuffer(4096);

        // get currently active tab
        String activeTab = getActiveTabName();

        // initialize "disabled" attribute for the input fields
        String disabled = "";
        if (!isEditable()) {
            disabled = " disabled=\"disabled\"";
        }

        // get all properties for the resource
        List<String[]> properties = getPropertyValues();

        // check for presence of property definitions, should always be true
        if (properties.size() > 0) {
            // there are properties defined for this resource, build the form list
            result.append("<table border=\"0\" style=\"width:100%\">\n");
            result.append("<tr>\n");
            result.append("\t<td class=\"textbold\" nowrap>");
            result.append(key(Messages.GUI_PROPERTY_0));
            result.append("</td>\n");
            result.append("\t<td class=\"textbold\">");
            result.append(key(Messages.GUI_PROPERTY_VALUE_0));
            result.append("</td>\n");
            // build column for checkbox
            result.append("\t<td class=\"textbold\" style=\"white-space: nowrap;\">");
            result.append("&nbsp;");
            result.append("</td>\n");
            result.append("</tr>\n");
            result.append("<tr><td colspan=\"3\"><span style=\"height: 6px;\"></span></td></tr>\n");

            // show all possible properties for the resource
            Iterator<String[]> i = properties.iterator();
            while (i.hasNext()) {
                String[] curProp = i.next();
                // create a single property row
                result.append(buildPropertyRow(curProp[0], curProp[1], curProp[2], curProp[3], disabled, activeTab));
            }
            result.append("</table>");
        } else {
            // there are no properties defined for this resource, show nothing (should never happen)
            result.append(key(Messages.GUI_PROPERTY_ADVANCED_NO_PROPDEFS_0));
        }
        return result.toString();
    }
533575
public CmsFileInput createFileInput() {

        // remove the current file input field and add a new one
        CmsFileInput previous = m_fileInput;
        if (m_fileInput != null) {
            m_fileInput.getElement().getStyle().setDisplay(Display.NONE);
        }
        m_fileInput = new CmsFileInput();
        m_fileInput.addChangeHandler(new ChangeHandler() {

            public void onChange(ChangeEvent event) {

                CmsDomUtil.ensureMouseOut(m_main.getElement());
                m_buttonHandler.onChange(m_fileInput);
            }
        });
        m_buttonHandler.initializeFileInput(m_fileInput);
        m_main.add(m_fileInput);
        return previous;
    }
733050
protected String defaultActionHtmlContent() {

        StringBuffer result = new StringBuffer(2048);
        result.append("<table id='twolists' cellpadding='0' cellspacing='0' align='center' width='100%'>\n");
        Iterator<A_CmsListDialog> i = m_wps.iterator();
        while (i.hasNext()) {
            A_CmsListDialog wp = i.next();
            result.append("\t<tr>\n");
            result.append("\t\t<td valign='top'>\n");
            result.append("\t\t\t").append(wp.defaultActionHtmlContent()).append("\n");
            result.append("\t\t</td>\n");
            result.append("\t</tr>\n");
            result.append("\t<tr><td height='20'/></tr>\n");
        }
        result.append("</table>\n");
        return result.toString();
    }
457475
public String toHtml() {

        CmsMacroResolver resolver = new CmsMacroResolver();
        if (CmsStringUtil.isEmpty(m_title)) {
            m_title = m_messages.key(Messages.GUI_ERROR_0, new Object[] {});
        }
        resolver.addMacro("title", m_title);
        resolver.addMacro("label_error", m_messages.key(Messages.GUI_ERROR_0, new Object[] {}));
        resolver.addMacro("errorstack", CmsException.getFormattedErrorstack(m_throwable));
        resolver.addMacro("message", CmsStringUtil.escapeHtml(getErrorMessage()));
        resolver.addMacro(
            "styleuri",
            OpenCms.getLinkManager().substituteLink(m_cms, "/system/workplace/commons/style/workplace.css"));
        if (CmsStringUtil.isEmpty(m_buttons)) {
            resolver.addMacro("buttons", getDefaultButtonsHtml());
        } else {
            resolver.addMacro("buttons", m_buttons);
            resolver.addMacro("paramaction", m_paramAction);
        }

        if (CmsStringUtil.isNotEmpty(m_hiddenParams)) {
            resolver.addMacro("hiddenparams", m_hiddenParams);
        }
        resolver.addMacro(
            "erroricon",
            OpenCms.getLinkManager().substituteLink(m_cms, "/system/workplace/resources/commons/error.png"));
        Properties errorpage = new Properties();
        try {
            errorpage.load(CmsErrorBean.class.getClassLoader().getResourceAsStream(ERRORPAGE));
        } catch (Throwable th) {
            CmsLog.INIT.error(
                org.opencms.main.Messages.get().getBundle().key(
                    org.opencms.main.Messages.INIT_ERR_LOAD_HTML_PROPERTY_FILE_1,
                    ERRORPAGE),
                th);
        }
        return resolver.resolveMacros(errorpage.getProperty("ERRORPAGE"));
    }
61125
@Override
    public String buildEditForm() {

        CmsMessages messages = Messages.get().getBundle(getLocale());
        StringBuffer retValue = new StringBuffer(2048);

        // check if the properties are editable
        boolean editable = isEditable();
        // create "disabled" attribute if properties are not editable
        String disabled = "";
        if (!editable) {
            disabled = " disabled=\"disabled\"";
        }

        retValue.append("<table border=\"0\">\n");
        retValue.append("<tr>\n");
        retValue.append("\t<td class=\"textbold\">" + messages.key(Messages.GUI_INPUT_PROPERTY_0) + "</td>\n");
        retValue.append("\t<td class=\"textbold\">" + messages.key(Messages.GUI_LABEL_VALUE_0) + "</td>\n");
        retValue.append(
            "\t<td class=\"textbold\" style=\"white-space: nowrap;\">"
                + messages.key(Messages.GUI_INPUT_USEDPROPERTY_0)
                + "</td>\n");
        retValue.append("</tr>\n");
        retValue.append("<tr><td><span style=\"height: 6px;\"></span></td></tr>\n");

        // create template select box row
        retValue.append(buildTableRowStart(messages.key(Messages.GUI_INPUT_TEMPLATE_0)));
        retValue.append(
            buildSelectTemplates(
                "name=\"" + CmsPropertyDefinition.PROPERTY_TEMPLATE + "\" class=\"maxwidth noborder\"" + disabled));
        retValue.append("</td>\n");
        retValue.append("\t<td class=\"textcenter\">");
        retValue.append("&nbsp;");
        retValue.append(buildTableRowEnd());

        // create the text property input rows
        retValue.append(buildTextInput(editable));

        // show navigation properties if enabled in explorer type settings
        if (showNavigation()) {
            retValue.append(buildNavigationProperties(editable));
        }

        retValue.append("</table>");

        return retValue.toString();
    }
1091202
public String defaultActionHtml() {

        String params = allParamsAsRequest();
        String titleUri = CmsEncoder.escapeXml(getJsp().getRequest().getParameter(PARAM_TITLE_URI));
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(titleUri)) {
            titleUri = CmsToolManager.ADMINVIEW_ROOT_LOCATION + "/list-title.jsp";
        }
        String titleSrc = getFrameSource("tool_title", getJsp().link(titleUri + "?" + params));
        String contentSrc = getFrameSource(
            "tool_content",
            getJsp().link(CmsToolManager.ADMINVIEW_ROOT_LOCATION + "/list-explorer.jsp") + "?" + params);
        StringBuffer html = new StringBuffer(1024);
        html.append("<!DOCTYPE html>\n");
        html.append("<html>\n");
        html.append("\t<head>\n");
        html.append("\t\t<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=\"").append(
            getEncoding()).append("\">\n");
        String uplink = "/opencms_a/opencms/system/workplace/views/admin/admin-main.jsp?path=/projects/files&action=initial&projectid=fa9f561f-be30-11e2-bac3-21ebf444feef&showexplorer=true";
        html.append(
            "<script type='text/javascript'>var uplink = \""
                + CmsStringUtil.escapeJavaScript(uplink)
                + "\";</script>\n");
        html.append("\t\t<title>\n");
        html.append(
            "\t\t\t").append(
                key(
                    org.opencms.workplace.Messages.GUI_LABEL_WPTITLE_1,
                    new Object[] {getSettings().getUser().getFullName()})).append("\n");
        html.append("\t\t</title>\n");
        html.append("\t</head>\n");
        html.append("\t<frameset rows='57,*' border='0' frameborder='0' framespacing='0'>\n");
        html.append("\t\t<frame ").append(titleSrc).append(" frameborder='0' border='0' noresize scrolling='no'>\n");
        html.append("\t\t<frame ").append(contentSrc).append(
            " frameborder='0' border='0' noresize scrolling='auto' framespacing='0' marginheight='2' marginwidth='2' >\n");
        html.append("\t</frameset>\n");
        html.append("</html>\n");
        return html.toString();
    }
1258070
protected String defaultActionHtmlEnd() {

        StringBuffer result = new StringBuffer(2048);
        result.append(dialogEnd());
        result.append(bodyEnd());
        result.append(htmlEnd());
        return result.toString();
    }
303234
public String html() {
        StringBuilder sb = StringUtil.borrowBuilder();
        for (Element element : this) {
            if (sb.length() != 0)
                sb.append("\n");
            sb.append(element.html());
        }
        return StringUtil.releaseBuilder(sb);
    }
1000120
private function build() {

    	if(null === $this -> text) {

    		$html = '<input type="'. $this -> type .'"';
    		
    		foreach($this -> attributes as $attribute => $value) {
    		    $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
    		}

    		$html .= '>';

    		return $html;
    	}

        $this -> fill();
        
        $html = '<button';
        
        foreach($this -> attributes as $attribute => $value) {
            $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
        }

        $html .= '>' . Escape :: html($this -> text) . '</button>';

        return $html;
        
    }
1218513
protected function buildHtmlPart()
    {
        if ($this->bodyHTML === false) {
            $result = null;
        } else {
            $html = new MimePart($this->bodyHTML);
            $html->setType(Mime::TYPE_HTML);
            $html->setCharset(APP_CHARSET);
            $inlineAttachments = [];
            foreach ($this->attachments as $attachment) {
                if ($this->isInlineAttachment($attachment)) {
                    $inlineAttachments[] = $attachment;
                }
            }
            if (empty($inlineAttachments)) {
                $result = $html;
            } else {
                $related = new MimeMessage();
                $related->addPart($html);
                foreach ($inlineAttachments as $inlineAttachment) {
                    $related->addPart($inlineAttachment);
                }
                $result = new MimePart($related->generateMessage());
                $result->setType(Mime::MULTIPART_RELATED);
                $result->setBoundary($related->getMime()->boundary());
            }
        }

        return $result;
    }