}
$oSelHTMLTemplateIDCat->setDefault($iHTMLTemplateIDCat);
// Get html newsletter article category
$iHTMLNewsletterIDCat = (int) $oClientLang->getProperty("newsletter", "html_newsletter_idcat");
if ($iHTMLNewsletterIDCat < 0) {
    $iHTMLNewsletterIDCat = 0;
}
$oSelHTMLNewsletterIDCat->setDefault($iHTMLNewsletterIDCat);
// Global HTML newsletter option
$bHTMLNewsletter = false;
if ($iHTMLTemplateIDCat > 0 && $iHTMLNewsletterIDCat > 0 && $oClientLang->getProperty("newsletter", "html_newsletter") == "true") {
    // If necessary idcats are not specified or the option is disabled,
    // then HTML are not used
    $bHTMLNewsletter = true;
}
$oCkbHTMLNewsletter = new cHTMLCheckbox("ckbHTMLNewsletter", "enabled", "", $bHTMLNewsletter);
// Disable HTML options, if user has no rights
if (!$perm->have_perm_area_action($area, "news_html_settings")) {
    $oSelHTMLTemplateIDCat->setDisabled("disabled");
    $oSelHTMLNewsletterIDCat->setDisabled("disabled");
    $oCkbHTMLNewsletter->setDisabled("disabled");
}
// Destination for sending test newsletter
$oSelTestDestination = new cHTMLSelectElement("selTestDestination");
$oSelTestDestination->setStyle("width: 220px;");
$oOption = new cHTMLOptionElement(i18n("My mail address", $plugin_name), 0);
$oSelTestDestination->addOptionElement(0, $oOption);
$oRcpGroups = new RecipientGroupCollection();
$oRcpGroups->setWhere("idclient", (int) $client);
$oRcpGroups->setWhere("idlang", (int) $lang);
$oRcpGroups->setOrder("groupname");
    $oAssocGroups = new RecipientGroupMemberCollection();
    $oAssocGroups->link("RecipientGroupCollection");
    $oAssocGroups->setWhere("recipientgroupmembercollection.idnewsrcp", $recipient->get("idnewsrcp"));
    $oAssocGroups->setOrder("recipientgroupcollection.groupname");
    $oAssocGroups->query();
    if ($oAssocGroups->count() == 0) {
        $oGroupList->setCell(0, 1, i18n("Recipient is not member of any group", $plugin_name));
    } else {
        // Headline
        $oGroupList->setCell(0, 1, "<strong>" . i18n("Groupname", $plugin_name) . "</strong>");
        $oImgDel = new cHTMLImage("images/delete.gif");
        $oGroupList->setCell(0, 2, $oImgDel->render());
        $oGroupList->setCellAlignment(0, 2, "right");
        // Data
        while ($oAssocGroup = $oAssocGroups->next()) {
            $oGroup = $oAssocGroups->fetchObject("RecipientGroupCollection");
            $oCkbRemove = new cHTMLCheckbox("ckbRemove[]", $oAssocGroup->get("idnewsgroupmember"));
            echo $oGroup->get("idnewsgroupmember");
            $oGroupList->setCell($oAssocGroup->get("idnewsgroupmember"), 1, $oGroup->get("groupname"));
            $oGroupList->setCell($oAssocGroup->get("idnewsgroupmember"), 2, $oCkbRemove->toHTML(false));
            $oGroupList->setCellAlignment($oAssocGroup->get("idnewsgroupmember"), 2, "right");
        }
    }
    $oForm->add(i18n("Associated Groups", $plugin_name), $oGroupList->render());
    $oForm->add(i18n("Author", $plugin_name), $classuser->getUserName($recipient->get("author")) . " (" . $recipient->get("created") . ")");
    $oForm->add(i18n("Last modified by", $plugin_name), $classuser->getUserName($recipient->get("modifiedby")) . " (" . $recipient->get("lastmodified") . ")");
    $oPage->setContent($sNotis . $oForm->render(true));
} else {
    $oPage->setContent($sNotis . "");
}
$oPage->render();
     $oAddedRecipientList->setCell(1, 2, '&nbsp;');
 } else {
     if ($iItems == 0) {
         $oAddedRecipientList->setCell(1, 1, i18n("No recipients found", $plugin_name));
         $oAddedRecipientList->setCell(1, 2, '&nbsp;');
     } else {
         while ($oRcp = $oInsiders->next()) {
             $iID = $oRcp->get("idnewsrcp");
             $sName = $oRcp->get("name");
             $sEMail = $oRcp->get("email");
             if (empty($sName)) {
                 $sName = $sEMail;
             }
             $oAddedRecipientList->setCell($iID, 1, $sName . " (" . $sEMail . ")");
             if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete")) {
                 $oCkbDel = new cHTMLCheckbox("deluser[]", $iID);
                 $oAddedRecipientList->setCell($iID, 2, $oCkbDel->toHTML(false));
             } else {
                 $oAddedRecipientList->setCell($iID, 2, "&nbsp;");
             }
             $oAddedRecipientList->setCellAlignment($iID, 2, "right");
         }
     }
 }
 // Member list pager (-> below data, as iMembers is needed)
 $oPagerLink = new cHTMLLink();
 $oPagerLink->setLink("main.php");
 $oPagerLink->setCustom("member_elemperpage", $_REQUEST["member_elemperpage"]);
 $oPagerLink->setCustom("member_filter", $_REQUEST["member_filter"]);
 $oPagerLink->setCustom("member_sortby", $_REQUEST["member_sortby"]);
 $oPagerLink->setCustom("member_sortorder", $_REQUEST["member_sortorder"]);