$iMenu = 0;
$sDateFormat = getEffectiveSetting("backend", "timeformat", "d.m.Y H:i");
// Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array();
$aMsg["DelTitle"] = i18n("Delete dispatch job", $plugin_name);
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter dispatch job:<br />", $plugin_name);
$aMsg["SendTitle"] = i18n("Run job", $plugin_name);
$aMsg["SendDescr"] = i18n("Do you really want to run the following job:<br />", $plugin_name);
// Prepare "send link" template
$sTplSend = '<a title="' . $aMsg["SendTitle"] . '" href="javascript://" onclick="showSendMsg(\'{ID}\',\'{NAME}\')"><img src="' . $cfg['path']['images'] . 'newsletter_16.gif" border="0" title="' . $aMsg["SendTitle"] . '" alt="' . $aMsg["SendTitle"] . '"></a>';
while ($oJob = $oJobs->next()) {
    $iMenu++;
    $iID = $oJob->get("idnewsjob");
    $sName = $oJob->get("name") . " (" . date($sDateFormat, strtotime($oJob->get("created"))) . ")";
    $oLnk = new cHTMLLink();
    $oLnk->setMultiLink($area, "", $area, "");
    $oLnk->setCustom("idnewsjob", $iID);
    // Is at present redundant
    // HerrB: No, it's just not used/set...
    //$oMenu->setImage($iMenu, "images/newsletter_16.gif");
    $oMenu->setTitle($iMenu, $sName);
    switch ($oJob->get("status")) {
        case 1:
            // Pending
            if ($oJob->get("cronjob") == 0) {
                // Standard job can be run if user has the right to do so
                if ($perm->have_perm_area_action($area, "news_job_run")) {
                    $sLnkSend = str_replace('{ID}', $iID, $sTplSend);
                    $sLnkSend = str_replace('{NAME}', addslashes($sName), $sLnkSend);
                    $oMenu->setActions($iMenu, 'send', $sLnkSend);
                }
$oTpl->set('s', 'CRECIPIENTS', $sContainer);
$oTpl->set('s', 'ID_CRECIPIENTS', $sContainerId);
######################################
# 4 Recipient groups
######################################
// See comment at 2. Job dispatch
$aFields = array();
$aFields["name"] = array("field" => "groupname", "caption" => i18n("Name", $plugin_name), "type" => "base,sort,search");
######################################
# 4.1 Recipient groups: Actions
######################################
$sContent = '<div style="padding: 4px; padding-left: 17px; border-bottom: 0px solid black; background: ' . $cfg['color']['table_dark'] . ';">' . "\n";
// Create a link to add a group
if ($perm->have_perm_area_action("recipientgroups", "recipientgroup_create")) {
    $oLnk = new cHTMLLink();
    $oLnk->setMultiLink("recipientgroups", "", "recipientgroups", "recipientgroup_create");
    $oLnk->setContent('<img style="margin-right: 4px;" src="' . $cfg["path"]["images"] . 'folder_new.gif" align="middle">' . i18n("Create group", $plugin_name) . '</a>');
    $sContent .= $oLnk->render() . '<br />' . "\n";
}
$sContent .= '</div>' . "\n";
$sLink = "actiongroup";
$oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a67", i18n("Actions", $plugin_name), $sLink, false);
$oListActionsRow->setContentData($sContent);
$oTpl->set('s', 'ACTIONLINKGROUP', $sLink);
######################################
# 4.2 Recipient groups: List Options
######################################
$iItemsPerPage = (int) $oUser->getProperty("itemsperpage", "recipientgroups");
if ($iItemsPerPage == 0) {
    $iItemsPerPage = 25;
    // All can't be saved