$oForm->setVar("area", $area);
 $oForm->setVar("action", "recipients_save");
 $oForm->setVar("idrecipient", $recipient->get("idnewsrcp"));
 $oForm->addHeader(i18n("Edit recipient", $plugin_name));
 $oTxtName = new cHTMLTextbox("name", $recipient->get("name"), 40);
 $oTxtEMail = new cHTMLTextbox("email", $recipient->get("email"), 40);
 $oCkbConfirmed = new cHTMLCheckbox("confirmed", "1");
 $oCkbConfirmed->setChecked($recipient->get("confirmed"));
 $oCkbDeactivated = new cHTMLCheckbox("deactivated", "1");
 $oCkbDeactivated->setChecked($recipient->get("deactivated"));
 $oSelNewsType = new cHTMLSelectElement("newstype");
 $oOption = new cHTMLOptionElement(i18n("Text only", $plugin_name), "0");
 $oSelNewsType->addOptionElement(0, $oOption);
 $oOption = new cHTMLOptionElement(i18n("HTML and text", $plugin_name), "1");
 $oSelNewsType->addOptionElement(1, $oOption);
 $oSelNewsType->setDefault($recipient->get("news_type"));
 $oForm->add(i18n("Name", $plugin_name), $oTxtName->render());
 $oForm->add(i18n("E-Mail", $plugin_name), $oTxtEMail->render());
 $oForm->add(i18n("Confirmed", $plugin_name), $oCkbConfirmed->toHTML(false) . " (" . $recipient->get("confirmeddate") . ")");
 $oForm->add(i18n("Deactivated", $plugin_name), $oCkbDeactivated->toHTML(false));
 $oForm->add(i18n("Message type", $plugin_name), $oSelNewsType->render());
 $aPluginOrder = trim_array(explode(",", getSystemProperty("plugin", "recipients-pluginorder")));
 // Check out if there are any plugins
 if (is_array($aPluginOrder)) {
     foreach ($aPluginOrder as $sPlugin) {
         if (function_exists("recipients_" . $sPlugin . "_getTitle") && function_exists("recipients_" . $sPlugin . "_display")) {
             $aPluginTitle = call_user_func("recipients_" . $sPlugin . "_getTitle");
             $aPluginDisplay = call_user_func("recipients_" . $sPlugin . "_display", $recipient);
             if (is_array($aPluginTitle) && is_array($aPluginDisplay)) {
                 foreach ($aPluginTitle as $sKey => $sValue) {
                     $oForm->add($sValue, $aPluginDisplay[$sKey]);
}
$oSelSortBy->setDefault("name");
$oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", $plugin_name), "DESC" => i18n("Descending", $plugin_name)));
$oSelSortOrder->setDefault("ASC");
$oTxtFilter = new cHTMLTextbox("filter", "", 16);
$oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --", $plugin_name), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) {
    if (strpos($aData["type"], "search") !== false) {
        $oOption = new cHTMLOptionElement($aData["caption"], $aData["field"]);
        $oSelSearchIn->addOptionElement($aData["field"], $oOption);
    }
}
$oSelSearchIn->setDefault("--all--");
$oBtnApply = new cHTMLButton("submit", i18n("Apply", $plugin_name));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: ' . $cfg['color']['table_dark'] . ';">' . "\n";
$sContent .= '<form target="left_bottom" onsubmit="reloadLeftBottomAndTransportFormVars(this);" id="groups_listoptionsform" name="groups_listoptionsform" method="get" action="">' . "\n";
$sContent .= '   <input type="hidden" name="area" value="recipientgroups">' . "\n";
$sContent .= '   <input type="hidden" name="frame" value="2">' . "\n";
$sContent .= '   <input type="hidden" name="contenido" value="' . $sess->id . '">' . "\n";
$sContent .= '   <table>' . "\n";
$sContent .= '      <tr>' . "\n";
$sContent .= '         <td>' . i18n("Items / page", $plugin_name) . '</td>' . "\n";
$sContent .= '         <td>' . $oSelItemsPerPage->render() . '</td>' . "\n";
$sContent .= '      </tr>' . "\n";
$sContent .= '      <tr>' . "\n";
$sContent .= '         <td>' . i18n("Sort by", $plugin_name) . '</td>' . "\n";
$sContent .= '         <td>' . $oSelSortBy->render() . '</td>' . "\n";
$sContent .= '      </tr>' . "\n";
 }
 $oSelSortBy->setDefault($_REQUEST["outsider_sortby"]);
 $oSelSortOrder = new cHTMLSelectElement("outsider_sortorder");
 $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", $plugin_name), "DESC" => i18n("Descending", $plugin_name)));
 $oSelSortOrder->setDefault($_REQUEST["outsider_sortorder"]);
 $oTxtFilter = new cHTMLTextbox("outsider_filter", $_REQUEST["outsider_filter"], 16);
 $oSelSearchIn = new cHTMLSelectElement("outsider_searchin");
 $oOption = new cHTMLOptionElement(i18n("-- All fields --", $plugin_name), "--all--");
 $oSelSearchIn->addOptionElement("all", $oOption);
 foreach ($aFields as $sKey => $aData) {
     if (strpos($aData["type"], "search") !== false) {
         $oOption = new cHTMLOptionElement($aData["caption"], $aData["field"]);
         $oSelSearchIn->addOptionElement($aData["field"], $oOption);
     }
 }
 $oSelSearchIn->setDefault($_REQUEST["outsider_searchin"]);
 $oSubmit = new cHTMLButton("submit", i18n("Apply", $plugin_name));
 $sContent = '<div style="border-bottom: 1px solid black; background: ' . $cfg['color']['table_dark'] . ';">' . chr(10);
 $sContent .= '   <table>' . chr(10);
 $sContent .= '      <tr>' . chr(10);
 $sContent .= '         <td>' . i18n("Items / page", $plugin_name) . '</td>' . chr(10);
 $sContent .= '         <td>' . $oSelItemsPerPage->render() . '</td>' . chr(10);
 $sContent .= '      </tr>' . chr(10);
 $sContent .= '      <tr>' . chr(10);
 $sContent .= '         <td>' . i18n("Sort by", $plugin_name) . '</td>' . chr(10);
 $sContent .= '         <td>' . $oSelSortBy->render() . '</td>' . chr(10);
 $sContent .= '      </tr>' . chr(10);
 $sContent .= '      <tr>' . chr(10);
 $sContent .= '         <td>' . i18n("Sort order", $plugin_name) . '</td>' . chr(10);
 $sContent .= '         <td>' . $oSelSortOrder->render() . '</td>' . chr(10);
 $sContent .= '      </tr>' . chr(10);
 $oFrmOptions->setVar("action", $action);
 $oFrmOptions->setVar("frame", $frame);
 $oFrmOptions->setVar("sortmode", $_REQUEST["sortmode"]);
 $oFrmOptions->setVar("sortby", $_REQUEST["sortby"]);
 $oFrmOptions->setVar("idnewsjob", $_REQUEST["idnewsjob"]);
 //$oFrmOptions->setVar("startpage", $startpage);
 //$oFrmOptions->setVar("appendparameters", $appendparameters);
 $oFrmOptions->addHeader(i18n("List options", $plugin_name));
 $oSelElements = new cHTMLSelectElement("elemperpage");
 $oSelElements->setEvent("onchange", "document.forms.frmOptions.submit();");
 $aData = array("0" => i18n("-All-", $plugin_name), "50" => "50", "100" => "100", "250" => "250", "500" => "500");
 foreach ($aData as $sKey => $sValue) {
     $oOption = new cHTMLOptionElement($sValue, $sKey);
     $oSelElements->addOptionElement($sKey, $oOption);
 }
 $oSelElements->setDefault($_REQUEST["elemperpage"]);
 //$oSelElements->setStyle('border:1px;border-style:solid;border-color:black;');
 $oFrmOptions->add(i18n("Items per page:", $plugin_name), $oSelElements->render());
 // Ouput data
 $oList = new cScrollList(true, "news_job_details");
 $oList->setCustom("idnewsjob", $_REQUEST["idnewsjob"]);
 $oList->setCustom("nextpage", $iNextPage);
 $oList->setCustom("elemperpage", $_REQUEST["elemperpage"]);
 $aCols = array("rcpname", "rcpemail", "", "status", "sent");
 $oList->setHeader(i18n("Recipient", $plugin_name), i18n("E-Mail", $plugin_name), i18n("Type", $plugin_name), i18n("Status", $plugin_name), i18n("Sent", $plugin_name), i18n("Actions", $plugin_name));
 $oList->setSortable(0, true);
 $oList->setSortable(1, true);
 $oList->setSortable(2, false);
 $oList->setSortable(3, true);
 $oList->setSortable(4, true);
 // Get data
 $sTagInfoHTML .= "</div>";
 $iTplIDArt = 0;
 // Used later for on change event
 if ($oNewsletter->get("type") == "html") {
     $iTplIDArt = $oNewsletter->get("template_idart");
     $oSelTemplate = new cHTMLSelectElement("selTemplate");
     $oSelTemplate->setEvent("change", "askSubmitOnTplChange(this);");
     $aOptions = array("idcat" => $oClientLang->getProperty("newsletter", "html_template_idcat"), "start" => true, "offline" => true, "order" => "title");
     $oTemplateArticles = new ArticleCollection($aOptions);
     $aItems = array();
     $aItems[] = array(0, i18n("-- none --", $plugin_name));
     while ($oArticle = $oTemplateArticles->nextArticle()) {
         $aItems[] = array($oArticle->get("idart"), $oArticle->get("title"));
     }
     $oSelTemplate->autoFill($aItems);
     $oSelTemplate->setDefault($iTplIDArt);
     unset($aItems);
     unset($oArticles);
     unset($oTemplateArticles);
     $oForm->add(i18n("HTML Template", $plugin_name), $oSelTemplate->render() . "&nbsp;" . i18n("Note, that changing the template discards the current html message content", $plugin_name));
     if ($iTplIDArt != 0) {
         $sFrameSrc = $cfgClient[$client]["path"]["htmlpath"] . "front_content.php?changeview=edit&action=con_editart&idart=" . $oNewsletter->get("idart") . "&idcat=" . $oClientLang->getProperty("newsletter", "html_newsletter_idcat") . "&lang=" . $lang . "&contenido=" . $sess->id;
         $oForm->add(i18n("HTML Message", $plugin_name), '<iframe width="100%" height="600" src="' . $sFrameSrc . '"></iframe><br />' . $sTagInfoHTML);
     } else {
         // Add a real note, that a template has to be specified
         $notis .= $notification->returnNotification("warning", i18n("Newsletter type has been set to HTML/text, please remember to select an html template", $plugin_name)) . "<br />";
         $oForm->add(i18n("HTML Message", $plugin_name), i18n("Please choose a template first", $plugin_name));
     }
 }
 $oTxtMessage = new cHTMLTextarea("txtMessage", $oNewsletter->get("message"), 80, 20);
 $oForm->add(i18n("Text Message", $plugin_name), $oTxtMessage->render() . "<br />" . $sTagInfoText);
        if ($iAdded > 0) {
            $oPage->setReload();
        }
    }
}
$oForm = new UI_Table_Form("properties");
$oForm->setVar("frame", $frame);
$oForm->setVar("area", $area);
$oForm->setVar("action", "recipients_import_exec");
$oForm->addHeader(i18n("Import recipients", $plugin_name));
$oSelDelimiter = new cHTMLSelectElement("selDelimiter");
$aItems = array();
$aItems[] = array("semicolon", i18n("Semicolon", $plugin_name));
$aItems[] = array("tab", i18n("Tab", $plugin_name));
$oSelDelimiter->autoFill($aItems);
$oSelDelimiter->setDefault($_REQUEST["selDelimiter"]);
$oForm->add(i18n("Delimiter", $plugin_name), $oSelDelimiter->render());
$oAreaData = new cHTMLTextarea("txtData", $_REQUEST["txtData"], 80, 20);
$sInfo = '<a href="javascript:fncShowHide(\'idInfoText\');"><strong>' . i18n("Import information", $plugin_name) . '</strong></a>' . '<div id="idInfoText" style="display: none">' . '<br /><br /><strong>' . i18n("Specify colum types:", $plugin_name) . '</strong>' . i18n("<br />The first line must contain the column names; this specifies the column order.<br />&lt;column name&gt;[delimiter]&lt;column name&gt;...", $plugin_name) . '<br /><br /><strong>' . i18n("Data structure:", $plugin_name) . '</strong><br />' . i18n("The recipients have to be entered using the following format:<br />&lt;data&gt;[Delimiter]&lt;data&gt;... - each recipient in a new line.", $plugin_name) . '<br /><br /><strong>' . i18n("Example:", $plugin_name) . '</strong>' . i18n("<br />name;mail;confirmed<br />Smith;jon.smith@example.org;1", $plugin_name) . '<br /><br /><strong>' . i18n("The following column names will be recognized:", $plugin_name) . '</strong><br />' . implode("<br />\n", $aFields) . '</div>';
$oForm->add(i18n("Recipients", $plugin_name), $oAreaData->render() . "<br />" . $sInfo);
unset($sInfo);
$sExecScript = '
<script type="text/javascript">
    /* Enabled/Disable group box */
    function fncShowHide(strItemID) {
        objItem = document.getElementById(strItemID);

        if (objItem.style.display == "none") {
           objItem.style.display = "inline";
        } else {
           objItem.style.display = "none";