function buildBannerForm($type, $aBanner, &$oComponent = null, $formDisabled = false)
{
    $form = new OA_Admin_UI_Component_Form("bannerForm", "POST", $_SERVER['SCRIPT_NAME'], null, array("enctype" => "multipart/form-data"));
    $form->forceClientValidation(true);
    $form->addElement('hidden', 'clientid', $aBanner['clientid']);
    $form->addElement('hidden', 'campaignid', $aBanner['campaignid']);
    $form->addElement('hidden', 'bannerid', $aBanner['bannerid']);
    $form->addElement('hidden', 'type', 'txt');
    $form->addElement('hidden', 'status', $aBanner['status']);
    $translation = new OX_Translation();
    $pluginConf = $GLOBALS['conf']['oxMarkedText'];
    $bannerTextMaxLength = $pluginConf['textMaxLength'];
    $regularLinkMaxLength = $pluginConf['anchor1MaxLength'];
    $highlightedLinkMaxLength = $pluginConf['anchor2MaxLength'];
    $form->addElement('header', 'header_b_links', "Banner content");
    $form->addElement('text', 'description', "Name");
    $fieldwithdescr[] = $form->createElement('textarea', 'bannertext', '<label for="bannertext" style="display: block; float: left; width: 170px;">Banner text</label>');
    $fieldwithdescr[] = $form->createElement('static', 'descr', str_replace(array('XX', 'YY', 'ZZ'), array($bannerTextMaxLength, $regularLinkMaxLength, $highlightedLinkMaxLength), '<p>Type your ad text, mark any blocks with brackets to add link. Example: <i>My [super ads] for only [[123$]]</i>.</p> Single brackets will show regular link and double brackets means highlighted link. You can use <ul><li>- up to XX chars for whole ad text</li><li>- 1 regular link, up to YY chars </li><li>- 1 highlighted link, up to ZZ chars</li></ul>'));
    $form->addGroup($fieldwithdescr, 'bannertext', null, '<br />');
    $form->addElement('text', 'url', $GLOBALS['strURL']);
    $form->addElement('hidden', 'ext_bannertype', 'bannerTypeText:oxMarkedText:oxMarkedTextComponent');
    $weightfield[] = $form->createElement('text', 'weight', '<label for="weight" style="display: block; float: left; width: 170px;">' . $GLOBALS['strWeight'] . '</label>');
    $weightfield[] = $form->createElement('static', 'weightdescr', '<p>If you want to show this ad more frequently, adjust its weight.</p>');
    $form->addGroup($weightfield, 'weight', null, '<br />');
    $weightPositiveRule = $translation->translate($GLOBALS['strXPositiveWholeNumberField'], array($GLOBALS['strWeight']));
    $form->addRule('weight', $weightPositiveRule, 'numeric');
    $form->addRule('bannertext', "Maximum {$bannerTextMaxLength} characters", 'maxlength', $bannerTextMaxLength);
    $form->addElement('controls', 'form-controls');
    $form->addElement('submit', 'submit', 'Save changes');
    $form->setDefaults($aBanner);
    if ($formDisabled) {
        $form->freeze();
    }
    return $form;
}