Die letzten Reinlichkeiten für V4.6:
include.newsletter_edit.php:
Nach
Code: Alles auswählen
if ($newsletter->virgin == false && $newsletter->get("idclient") == $client && $newsletter->get("idlang") == $lang) {
if ($action == "news_save" && $perm->have_perm_area_action($area, $action)) {
$page->setReload();
$messages = array();
folgenden Code einfügen:
Code: Alles auswählen
/* Changing e.g. \' back to ' (magic_quotes) */
$name = stripslashes($name);
$newsfrom = stripslashes($newsfrom);
$subject = stripslashes($subject);
$message = stripslashes($message);
Die direkt danach folgende Abfrage
Code: Alles auswählen
$newsletters->select("name='$name' and idclient='$client' AND idlang='$lang'");
in
Code: Alles auswählen
$newsletters->select("name='".urlencode($name)."' and idclient='$client' AND idlang='$lang'");
ändern.
include.newsletter_menu.php:
Code: Alles auswählen
$delete = '<a title="'.$sDelTitle.'" href="javascript://" onclick="showDelMsg('.$idnewsletter.',\''.$params["name"].'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$sDelTitle.'" alt="'.$sDelTitle.'"></a>';
$mList->setTitle($iMenu, $params["name"]);
$mList->setLink($iMenu, $oLink);
if ($lIdCatArt) {
$send = '<a title="'.$sSendTitle.'" href="javascript://" onclick="showSendMsg('.$idnewsletter.',\''.$params["name"].'\')"><img src="'.$cfg['path']['images'].'newsletter.gif" border="0" title="'.$sSendTitle.'" alt="'.$sSendTitle.'"></a>';
$mList->setActions($iMenu, 'send', $send);
}
durch
Code: Alles auswählen
$delete = '<a title="'.$sDelTitle.'" href="javascript://" onclick="showDelMsg('.$idnewsletter.',\''.addslashes($params["name"]).'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$sDelTitle.'" alt="'.$sDelTitle.'"></a>';
$mList->setTitle($iMenu, $params["name"]);
$mList->setLink($iMenu, $oLink);
if ($lIdCatArt) {
$send = '<a title="'.$sSendTitle.'" href="javascript://" onclick="showSendMsg('.$idnewsletter.',\''.addslashes($params["name"]).'\')"><img src="'.$cfg['path']['images'].'newsletter.gif" border="0" title="'.$sSendTitle.'" alt="'.$sSendTitle.'"></a>';
$mList->setActions($iMenu, 'send', $send);
}
ersetzen.
include.recipients.group_edit.php:
Code: Alles auswählen
$rgroups->select("groupname = '$groupname' AND idclient='$client' AND idlang='$lang'");
durch
Code: Alles auswählen
$rgroups->select("groupname = '".urlencode($groupname)."' AND idclient='$client' AND idlang='$lang'");
ersetzen.
include.recipients.group_menu.php:
Code: Alles auswählen
$delete = '<a title="'.$delTitle.'" href="javascript://" onclick="showMsg('.$idrgroup.',\''.$groupname.'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$delTitle.'" alt="'.$delTitle.'"></a>';
durch
Code: Alles auswählen
$delete = '<a title="'.$delTitle.'" href="javascript://" onclick="showMsg('.$idrgroup.',\''.addslashes($groupname).'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$delTitle.'" alt="'.$delTitle.'"></a>';
ersetzen.
include.recipients_edit.php:
Code: Alles auswählen
$name = stripslashes($name);
$email = stripslashes($email);
am Anfang entfernen und unter
Code: Alles auswählen
if ($recipient->virgin == false && $recipient->get("idclient") == $client && $recipient->get("idlang") == $lang) {
if ($action == "recipients_save" && $perm->have_perm_area_action($area, $action)) {
$page->setReload();
$messages = array();
wieder einfügen.
Außerdem ist eine Korrektur nicht angekommen, der Bereich sieht endgültig so aus:
Code: Alles auswählen
if ($recipient->virgin == false && $recipient->get("idclient") == $client && $recipient->get("idlang") == $lang) {
if ($action == "recipients_save" && $perm->have_perm_area_action($area, $action)) {
$page->setReload();
$messages = array();
$name = stripslashes($name);
$email = stripslashes($email);
$recipient->set("name", $name);
$email = strtolower($email); // E-Mail always in lower case
if ($recipient->get("email") != $email) {
$recipients->select("email='".urlencode($email)."' and idclient='$client' AND idlang='$lang'");
(hier fehlte das urlencode in der letzten Zeile)
include.recipients_menu.php:
Code: Alles auswählen
$delete = '<a title="'.$delTitle.'" href="javascript://" onclick="showDelMsg('.$idnewsrcp.',\''.$params["name"].'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$delTitle.'" alt="'.$delTitle.'"></a>';
durch
Code: Alles auswählen
$delete = '<a title="'.$delTitle.'" href="javascript://" onclick="showDelMsg('.$idnewsrcp.',\''.addslashes($params["name"]).'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$delTitle.'" alt="'.$delTitle.'"></a>';
ersetzen.
Newsletter Form, nur Input:
Code: Alles auswählen
cInclude("classes", "class.newsletter.groups.php");
$db2 = new DB_Contenido;
$properties = new PropertyCollection;
/* Used variables:
* JoinSel: Selection, which group will be joined (Default, Selected, User specified)
* JoinMultiple: If $strJoinSel = User specified then: If more then one group may be selected (currently not supported)
* JoinGroups: Selected group(s)
* OptNewWindow: Open handler window in new browser window?
*/
// Initialisation
$arrSettings = array();
$arrSettings["JoinSel"] = $properties->getValue("clientsetting", $client, "newsletter", "joinsel");
$arrSettings["JoinMultiple"] = $properties->getValue("clientsetting", $client, "newsletter", "joinmultiple");
$arrSettings["JoinGroups"] = $properties->getValue("clientsetting", $client, "newsletter", "joingroups");
$arrSettings["OptNewWindow"] = "CMS_VALUE[4]";
// Setting default values
/* If nothing is set or if the option UserSelected has been activated, but no groups
* has been selected, set option Default. Note, that requiring to select groups when option
* Selected has been activated doesn't make so much sense here (even, as it is possible to do).
* Why? Because the groups to be joined have to be specified on the handler page, not here...
* To prevent users to select a group (or not to save the selection) when the option Selected is
* active should make more problems than just to ignore the selection in the Output area */
if ($arrSettings["JoinSel"] == "" || ($arrSettings["JoinSel"] == "UserSelected" && $arrSettings["JoinGroups"] == "")) {
$arrSettings["JoinSel"] = "Default";
}
/* Saving changes, if any */
if ($_REQUEST["JoinSel"] != "" && $_REQUEST["JoinSel"] != $arrSettings["JoinSel"]) {
$arrSettings["JoinSel"] = $_REQUEST["JoinSel"];
$properties->setValue("clientsetting", $client, "newsletter", "joinsel", $arrSettings["JoinSel"]);
}
if ($_REQUEST["JoinMultiple"] != "" && $_REQUEST["JoinMultiple"] != $arrSettings["JoinMultiple"]) {
$arrSettings["JoinMultiple"] = $_REQUEST["JoinMultiple"];
$properties->setValue("clientsetting", $client, "newsletter", "joinmultiple", $arrSettings["JoinMultiple"]);
}
if ($_REQUEST["JoinGroups"] != "" && $_REQUEST["JoinGroups"] != $arrSettings["JoinGroups"]) {
$arrSettings["JoinGroups"] = $_REQUEST["JoinGroups"];
$properties->setValue("clientsetting", $client, "newsletter", "joingroups", $arrSettings["JoinGroups"]);
}
if ($_REQUEST['UpdateHandlerID'] == 'enabled' && is_numeric($_REQUEST['HandlerID'])) {
// Trick: If UpdateHandlerID is enabled, save id as client setting
$strHandlerID = $_REQUEST['HandlerID'];
$properties->setValue("clientsetting", $client, "Newsletter", "idcatart", $strHandlerID);
} else {
// Getting current handler article id
$strHandlerID = $properties->getValue("clientsetting", $client, "Newsletter", "idcatart");
}
// Showing options
echo ' <table cellspacing="0" cellpadding="5" border="0" width="100%">',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Handler Article:").'</td>',chr(10);
echo ' <td><select name="HandlerID" size="1" disabled>',chr(10);
echo ' <option value="">'.i18n("None").'</option>',chr(10);
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS a,".$cfg["tab"]["cat_lang"]." AS b,
".$cfg["tab"]["cat"]." AS c WHERE a.idcat = b.idcat AND c.idcat = a.idcat AND
c.idclient = '".$client."' AND b.idlang = '".$lang."' ORDER BY a.idtree";
$db->query($sql);
while ($db->next_record()) {
$spaces = "";
for ($i=0; $i<$db->f("level"); $i++) {
$spaces .= " ";
}
echo ' <option style="font-weight: bold; color: #666666; background-color: #eeeeee;" value="">'.$spaces.' > '.$db->f("name").'</option>',chr(10);
if ($cfg["is_start_compatible"] == true) {
$sql2 = "SELECT * FROM ".$cfg["tab"]["cat_art"]." AS a, ".$cfg["tab"]["art"]." AS b,
".$cfg["tab"]["art_lang"]." AS c WHERE a.idcat = '".$db->f("idcat")."'
AND b.idart = a.idart AND c.idart = a.idart AND
c.idlang = '".$lang."' AND b.idclient = '".$client."' ORDER BY a.is_start DESC, c.title ASC";
} else {
$sql2 = "SELECT * FROM ".$cfg["tab"]["cat_art"]." AS a, ".$cfg["tab"]["art"]." AS b,
".$cfg["tab"]["art_lang"]." AS c WHERE a.idcat = '".$db->f("idcat")."'
AND b.idart = a.idart AND c.idart = a.idart AND
c.idlang = '".$lang."' AND b.idclient = '".$client."' ORDER BY c.title ASC";
}
$db2->query($sql2);
while ($db2->next_record()) {
$selected = "";
$tmp_title = $db2->f("title");
if (strlen($tmp_title) > 32) {
$tmp_title = substr($tmp_title, 0, 32);
}
$style = "";
if ($cfg["is_start_compatible"] == true) {
$is_start = $db2->f("is_start");
} else {
$is_start = isStartArticle($db2->f("idartlang"), $db2->f("idcat"), $lang);
if ($is_start == true) {
$is_start = 1;
} else {
$is_start = 0;
}
}
$strValue = $db2->f("idcatart");
if ($is_start == 1 && $db2->f("online") == 0) {
$style = "color: #ff0000";
$strValue = "";
}
if ($is_start == 1 && $db2->f("online") == 1) {
$style = "color: #0000ff";
}
if ($is_start == 0 && $db2->f("online") == 0) {
$style = "color: #666666";
$strValue = "";
}
if ($strHandlerID == $db2->f("idcatart")) {
$selected = " selected";
}
echo ' <option style="'.$style.'" value="'.$strValue.'"'.$selected.'> '.$spaces.' | '.$tmp_title.'</option>',chr(10);
}
}
echo ' </select>',chr(10);
echo ' <input type="checkbox" name="UpdateHandlerID" value="enabled" onClick="if (this.checked) {document.forms[0].HandlerID.disabled = false;} else {document.forms[0].HandlerID.disabled = true;}">'.mi18n("Update"),chr(10);
echo ' <td>',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Join:").'</td>',chr(10);
// Getting newsletter groups (if any)
$rgroups = new RecipientGroupCollection;
$rgroups->select("idclient = '$client' AND idlang = '$lang' AND defaultgroup = '0'","", "defaultgroup DESC, groupname ASC");
/* If newsletter groups are available, provide group options, otherwise show only
* 'Default' option. This is necessary, as there may have been groups specified (and used)
* but they have been deleted, later on. */
if ($rgroups->Count() == 0) {
echo ' <td><input type="radio" name="JoinSel" value="Default" checked>'.mi18n("default group").'</td>',chr(10);
echo ' </tr>',chr(10);
} else {
echo ' <td>',chr(10);
echo ' <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">',chr(10);
echo ' <tr>',chr(10);
if ($arrSettings["JoinSel"] == "Default") {
echo ' <td><input type="radio" name="JoinSel" value="Default" checked onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = true;"></td>',chr(10);
} else {
echo ' <td><input type="radio" name="JoinSel" value="Default" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = true;"></td>',chr(10);
}
echo ' <td>'.mi18n("default group").'</td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
if ($arrSettings["JoinSel"] == "Selected") {
echo ' <td><input type="radio" name="JoinSel" value="Selected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = false;" checked></td>',chr(10);
} else {
echo ' <td><input type="radio" name="JoinSel" value="Selected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = false;"></td>',chr(10);
}
echo ' <td>'.mi18n("selected group(s)").'</td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
if ($arrSettings["JoinSel"] == "UserSelected") {
echo ' <td valign="top"><input type="radio" name="JoinSel" value="UserSelected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = false;document.forms[0].GroupSel.disabled = false;" checked></td>',chr(10);
echo ' <td>'.mi18n("group(s) as selected by user").'<br />',chr(10);
if ($arrSettings["JoinMultiple"]) {
echo ' <input type="checkbox" name="JoinMultiple" value="enabled" checked>'.mi18n("Multiple group selection allowed").'</td>',chr(10);
} else {
echo ' <input type="checkbox" name="JoinMultiple" value="enabled">'.mi18n("Multiple group selection allowed").'</td>',chr(10);
}
} else {
echo ' <td valign="top"><input type="radio" name="JoinSel" value="UserSelected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = false;document.forms[0].GroupSel.disabled = false;"></td>',chr(10);
echo ' <td>'.mi18n("group(s) as selected by user").'<br />',chr(10);
echo ' <input type="checkbox" name="JoinMultiple" value="enabled" disabled>'.mi18n("Multiple group selection allowed").'</td>',chr(10);
}
echo ' </tr>',chr(10);
echo ' </table>',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Select group(s):").'</td>',chr(10);
// Trick: To save multiple selections in <select>-Element, add some JS which saves the
// selection, comma separated in a hidden input field on change.
echo ' <td><script type="text/javascript"><!--',chr(10);
echo ' function fncUpdateSel() {',chr(10);
echo ' var strSel = "";',chr(10);
echo ' for(i=0; i<document.forms[0].GroupSel.length; i++) {', chr(10);
echo ' if(document.forms[0].GroupSel.options[i].selected == true) {',chr(10);
echo ' if (strSel != "")',chr(10);
echo ' strSel = strSel + ",";',chr(10);
echo ' strSel = strSel + document.forms[0].GroupSel.options[i].value;',chr(10);
echo ' }',chr(10);
echo ' }',chr(10);
echo ' document.forms[0].elements["JoinGroups"].value = strSel;',chr(10);
echo ' }',chr(10);
echo ' //--></script>',chr(10);
if ($arrSettings["JoinSel"] == "Default") {
echo ' <select size="5" name="GroupSel" onChange="fncUpdateSel()" multiple disabled>',chr(10);
} else {
echo ' <select size="5" name="GroupSel" onChange="fncUpdateSel()" multiple>',chr(10);
}
$arrGroups = explode(",",$arrSettings["JoinGroups"]);
while ($rgroup = $rgroups->next()) {
if (in_array ($rgroup->get("idnewsgroup"), $arrGroups)) {
echo ' <option value="'.$rgroup->get("idnewsgroup").'" selected>'.$rgroup->get("groupname").'</option>',chr(10);
} else {
echo ' <option value="'.$rgroup->get("idnewsgroup").'">'.$rgroup->get("groupname").'</option>',chr(10);
}
}
echo ' </select><input type="hidden" name="JoinGroups" value="'.$arrSettings["JoinGroups"].'">',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
}
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Options:").'</td>',chr(10);
if ($arrSettings["OptNewWindow"] != "") {
echo ' <td><input type="checkbox" name="CMS_VAR[4]" value="enabled" checked>'.mi18n("Open handler form in new window").'</td>',chr(10);
} else {
echo ' <td><input type="checkbox" name="CMS_VAR[4]" value="enabled">'.mi18n("Open handler form in new window").'</td>',chr(10);
}
echo ' </tr>',chr(10);
echo ' </table>',chr(10);
Newsletter Handler, nur Input:
Code: Alles auswählen
cInclude("classes", "class.newsletter.groups.php");
/* Used variables:
* JoinSel: Selection, which group will be joined (Default, Selected, User specified)
* JoinMultiple: If $strJoinSel = User specified then: If more then one group may be selected (currently not supported)
* JoinGroups: Selected group(s)
* FrontendLink: Link to Frontend Users enabled?
* FrontendConfirm: Confirmation of newsletter subscription means: Activate frontend account, nothing
* FrontendDel: Cancellation of newsletter subscription means: Delete frontend account, Deactivate account, nothing
* SenderEMail: Sender e-mail address
* HandlerID: ID of handler article
* ChangeEMailID: ID of change e-mail handler article
*/
// Initialisation
$db2 = new DB_Contenido;
$properties = new PropertyCollection;
$arrSettings = array();
$arrSettings["JoinSel"] = $properties->getValue("clientsetting", $client, "newsletter", "joinsel");
$arrSettings["JoinMultiple"] = $properties->getValue("clientsetting", $client, "newsletter", "joinmultiple");
$arrSettings["JoinGroups"] = $properties->getValue("clientsetting", $client, "newsletter", "joingroups");
$arrSettings["FrontendLink"] = $properties->getValue("clientsetting", $client, "newsletter", "frontendlink");
$arrSettings["FrontendConfirm"] = "CMS_VALUE[5]";
$arrSettings["FrontendDel"] = "CMS_VALUE[6]";
$arrSettings["SenderEMail"] = "CMS_VALUE[7]";
// Setting default values
/* If there is no selection option set or if no groups has been selected, activate option Default */
if ($arrSettings["JoinSel"] == "" || $arrSettings["JoinGroups"] == "") {
$arrSettings["JoinSel"] = "Default";
}
if ($arrSettings["FrontendConfirm"] == "") {
$arrSettings["FrontendConfirm"] = "ActivateUser";
}
if ($arrSettings["FrontendDel"] == "") {
$arrSettings["FrontendDel"] = "DeleteUser";
}
/* Saving changes, if any */
if ($_REQUEST['UpdateHandlerID'] == 'enabled' && is_numeric($_REQUEST['HandlerID'])) {
// Trick: If UpdateHandlerID is enabled, save id as client setting
$arrSettings["HandlerID"] = $_REQUEST['HandlerID'];
$properties->setValue("clientsetting", $client, "newsletter", "idcatart", $arrSettings["HandlerID"]);
} else {
// Getting current handler article id
$arrSettings["HandlerID"] = $properties->getValue("clientsetting", $client, "newsletter", "idcatart");
}
if ($_REQUEST["JoinSel"] != "" && $_REQUEST["JoinSel"] != $arrSettings["JoinSel"]) {
$arrSettings["JoinSel"] = $_REQUEST["JoinSel"];
$properties->setValue("clientsetting", $client, "newsletter", "joinsel", $arrSettings["JoinSel"]);
}
if ($_REQUEST["JoinMultiple"] != "" && $_REQUEST["JoinMultiple"] != $arrSettings["JoinMultiple"]) {
$arrSettings["JoinMultiple"] = $_REQUEST["JoinMultiple"];
$properties->setValue("clientsetting", $client, "newsletter", "joinmultiple", $arrSettings["JoinMultiple"]);
}
if ($_REQUEST["JoinGroups"] != "" && $_REQUEST["JoinGroups"] != $arrSettings["JoinGroups"]) {
$arrSettings["JoinGroups"] = $_REQUEST["JoinGroups"];
$properties->setValue("clientsetting", $client, "newsletter", "joingroups", $arrSettings["JoinGroups"]);
}
if ($_REQUEST["FrontendLink"] != "" && $_REQUEST["FrontendLink"] != $arrSettings["FrontendLink"]) {
$arrSettings["FrontendLink"] = $_REQUEST["FrontendLink"];
$properties->setValue("clientsetting", $client, "newsletter", "frontendlink", $arrSettings["FrontendLink"]);
}
// Show options
echo ' <table cellspacing="0" cellpadding="5" border="0" width="100%">',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Sender e-mail:").'</td>',chr(10);
echo ' <td><input type="text" name="CMS_VAR[7]" value="'.$arrSettings["SenderEMail"].'" size="30"></td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Handler Article:").'</td>',chr(10);
echo ' <td><select name="HandlerID" size="1" disabled>',chr(10);
echo ' <option value="">'.i18n("None").'</option>',chr(10);
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS a,".$cfg["tab"]["cat_lang"]." AS b,
".$cfg["tab"]["cat"]." AS c WHERE a.idcat = b.idcat AND c.idcat = a.idcat AND
c.idclient = '".$client."' AND b.idlang = '".$lang."' ORDER BY a.idtree";
$db->query($sql);
while ($db->next_record()) {
$spaces = "";
for ($i=0; $i<$db->f("level"); $i++) {
$spaces .= " ";
}
// echo ' <option style="'.$style.'" value="'.$db->f("idcat").'">'.$spaces.' > '.$db->f("name").'</option>',chr(10);
echo ' <option style="font-weight: bold; color: #666666; background-color: #eeeeee;" value="">'.$spaces.' > '.$db->f("name").'</option>',chr(10);
if ($cfg["is_start_compatible"] == true) {
$sql2 = "SELECT * FROM ".$cfg["tab"]["cat_art"]." AS a, ".$cfg["tab"]["art"]." AS b,
".$cfg["tab"]["art_lang"]." AS c WHERE a.idcat = '".$db->f("idcat")."'
AND b.idart = a.idart AND c.idart = a.idart AND
c.idlang = '".$lang."' AND b.idclient = '".$client."' ORDER BY a.is_start DESC, c.title ASC";
} else {
$sql2 = "SELECT * FROM ".$cfg["tab"]["cat_art"]." AS a, ".$cfg["tab"]["art"]." AS b,
".$cfg["tab"]["art_lang"]." AS c WHERE a.idcat = '".$db->f("idcat")."'
AND b.idart = a.idart AND c.idart = a.idart AND
c.idlang = '".$lang."' AND b.idclient = '".$client."' ORDER BY c.title ASC";
}
$db2->query($sql2);
while ($db2->next_record()) {
$selected = "";
$style = "";
$tmp_title = $db2->f("title");
if (strlen($tmp_title) > 32) {
$tmp_title = substr($tmp_title, 0, 32);
}
if ($cfg["is_start_compatible"] == true) {
$is_start = $db2->f("is_start");
} else {
if (isStartArticle($db2->f("idartlang"), $db2->f("idcat"), $lang) == true) {
$is_start = 1;
} else {
$is_start = 0;
}
}
$strValue = $db2->f("idcatart");
if ($is_start == 1 && $db2->f("online") == 0) {
$style = "color: #ff0000";
$strValue = "";
}
if ($is_start == 1 && $db2->f("online") == 1) {
$style = "color: #0000ff";
}
if ($is_start == 0 && $db2->f("online") == 0) {
$style = "color: #666666";
$strValue = "";
}
if ($arrSettings["HandlerID"] == $db2->f("idcatart")) {
$selected = " selected";
}
echo ' <option style="'.$style.'" value="'.$strValue.'"'.$selected.'> '.$spaces.' | '.$tmp_title.'</option>',chr(10);
}
}
echo ' </select>',chr(10);
echo ' <input type="checkbox" name="UpdateHandlerID" value="enabled" onClick="if (this.checked) {document.forms[0].HandlerID.disabled = false;} else {document.forms[0].HandlerID.disabled = true;}">'.mi18n("Update"),chr(10);
echo ' <td>',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Join:").'</td>',chr(10);
// Getting newsletter groups (if any)
$rgroups = new RecipientGroupCollection;
$rgroups->select("idclient = '$client' AND idlang = '$lang' AND defaultgroup = 0","", "defaultgroup DESC, groupname ASC");
/* If newsletter groups are available, provide group options, otherwise show only
* 'Default' option. This is necessary, as there may have been groups specified (and used)
* but they have been deleted, later on. */
if ($rgroups->Count() == 0) {
echo ' <td><input type="radio" name="JoinSel" value="Default" checked>'.mi18n("default group").'</td>',chr(10);
echo ' </tr>',chr(10);
} else {
echo ' <td>',chr(10);
echo ' <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">',chr(10);
echo ' <tr>',chr(10);
if ($arrSettings["JoinSel"] == "Default") {
echo ' <td><input type="radio" name="JoinSel" value="Default" checked onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = true;"></td>',chr(10);
} else {
echo ' <td><input type="radio" name="JoinSel" value="Default" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = true;"></td>',chr(10);
}
echo ' <td>'.mi18n("default group").'</td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
if ($arrSettings["JoinSel"] == "Selected") {
echo ' <td><input type="radio" name="JoinSel" value="Selected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = false;" checked></td>',chr(10);
} else {
echo ' <td><input type="radio" name="JoinSel" value="Selected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = true;document.forms[0].GroupSel.disabled = false;"></td>',chr(10);
}
echo ' <td>'.mi18n("selected group(s)").'</td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
if ($arrSettings["JoinSel"] == "UserSelected") {
echo ' <td valign="top"><input type="radio" name="JoinSel" value="UserSelected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = false;document.forms[0].GroupSel.disabled = false;" checked></td>',chr(10);
echo ' <td>'.mi18n("group(s) as selected by user").'<br />',chr(10);
if ($arrSettings["JoinMultiple"]) {
echo ' <input type="checkbox" name="JoinMultiple" value="enabled" checked>'.mi18n("Multiple group selection allowed").'</td>',chr(10);
} else {
echo ' <input type="checkbox" name="JoinMultiple" value="enabled">'.mi18n("Multiple group selection allowed").'</td>',chr(10);
}
} else {
echo ' <td valign="top"><input type="radio" name="JoinSel" value="UserSelected" onClick="document.forms[0].elements[\'JoinMultiple\'].disabled = false;document.forms[0].GroupSel.disabled = false;"></td>',chr(10);
echo ' <td>'.mi18n("group(s) as selected by user").'<br />',chr(10);
echo ' <input type="checkbox" name="JoinMultiple" value="enabled" disabled>'.mi18n("Multiple group selection allowed").'</td>',chr(10);
}
echo ' </tr>',chr(10);
echo ' </table>',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Select group(s):").'</td>',chr(10);
// Trick: To save multiple selections in <select>-Element, add some JS which saves the
// selection, comma separated in a hidden input field on change.
echo ' <td><script type="text/javascript"><!--',chr(10);
echo ' function fncUpdateSel() {',chr(10);
echo ' var strSel = "";',chr(10);
echo ' for(i=0; i<document.forms[0].GroupSel.length; i++) {', chr(10);
echo ' if(document.forms[0].GroupSel.options[i].selected == true) {',chr(10);
echo ' if (strSel != "")',chr(10);
echo ' strSel = strSel + ",";',chr(10);
echo ' strSel = strSel + document.forms[0].GroupSel.options[i].value;',chr(10);
echo ' }',chr(10);
echo ' }',chr(10);
echo ' document.forms[0].elements["JoinGroups"].value = strSel;',chr(10);
echo ' }',chr(10);
echo ' //--></script>',chr(10);
if ($arrSettings["JoinSel"] == "Default") {
echo ' <select size="5" name="GroupSel" onChange="fncUpdateSel()" multiple disabled>',chr(10);
} else {
echo ' <select size="5" name="GroupSel" onChange="fncUpdateSel()" multiple>',chr(10);
}
$arrGroups = explode(",",$arrSettings["JoinGroups"]);
while ($rgroup = $rgroups->next()) {
if (in_array ($rgroup->get("idnewsgroup"),$arrGroups)) {
echo ' <option value="'.$rgroup->get("idnewsgroup").'" selected>'.$rgroup->get("groupname").'</option>',chr(10);
} else {
echo ' <option value="'.$rgroup->get("idnewsgroup").'">'.$rgroup->get("groupname").'</option>',chr(10);
}
}
echo ' </select><input type="hidden" name="JoinGroups" value="' . $arrSettings["JoinGroups"] . '">',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
}
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Frontend Users:").'</td>',chr(10);
echo ' <td>',chr(10);
echo ' <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">',chr(10);
echo ' <tr>',chr(10);
if ($arrSettings["FrontendLink"] != "") {
$strDisabled = "";
echo ' <td><input type="checkbox" name="FrontendLink" value="enabled" checked
onClick="if (this.checked) {document.forms[0].elements[\'CMS_VAR[5]\'][0].disabled = false;document.forms[0].elements[\'CMS_VAR[5]\'][1].disabled = false;
document.forms[0].elements[\'CMS_VAR[6]\'][0].disabled = false;document.forms[0].elements[\'CMS_VAR[6]\'][1].disabled = false;document.forms[0].elements[\'CMS_VAR[6]\'][2].disabled = false;}
else {document.forms[0].elements[\'CMS_VAR[5]\'][0].disabled = true;document.forms[0].elements[\'CMS_VAR[5]\'][1].disabled = true;
document.forms[0].elements[\'CMS_VAR[6]\'][0].disabled = true;document.forms[0].elements[\'CMS_VAR[6]\'][1].disabled = true;document.forms[0].elements[\'CMS_VAR[6]\'][2].disabled = true;}">',chr(10);
} else {
$strDisabled = " disabled";
echo ' <td><input type="checkbox" name="FrontendLink" value="enabled"
onClick="if (this.checked) {document.forms[0].elements[\'CMS_VAR[5]\'][0].disabled = false;document.forms[0].elements[\'CMS_VAR[5]\'][1].disabled = false;
document.forms[0].elements[\'CMS_VAR[6]\'][0].disabled = false;document.forms[0].elements[\'CMS_VAR[6]\'][1].disabled = false;document.forms[0].elements[\'CMS_VAR[6]\'][2].disabled = false;}
else {document.forms[0].elements[\'CMS_VAR[5]\'][0].disabled = true;document.forms[0].elements[\'CMS_VAR[5]\'][1].disabled = true;
document.forms[0].elements[\'CMS_VAR[6]\'][0].disabled = true;document.forms[0].elements[\'CMS_VAR[6]\'][1].disabled = true;document.forms[0].elements[\'CMS_VAR[6]\'][2].disabled = true;}">',chr(10);
}
echo ' <td>'.mi18n("Activate Link").'</td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td> </td>',chr(10);
echo ' <td>'.mi18n("Confirmation means:").'<br />',chr(10);
if ($arrSettings["FrontendConfirm"] == "ActivateUser") {
echo ' <input type="radio" name="CMS_VAR[5]" value="ActivateUser" checked'.$strDisabled.'>'.mi18n("Activate"),chr(10);
} else {
echo ' <input type="radio" name="CMS_VAR[5]" value="ActivateUser"'.$strDisabled.'>'.mi18n("Activate"),chr(10);
}
if ($arrSettings["FrontendConfirm"] == "Nothing") {
echo ' <input type="radio" name="CMS_VAR[5]" value="Nothing" checked'.$strDisabled.'>'.mi18n("No changes"),chr(10);
} else {
echo ' <input type="radio" name="CMS_VAR[5]" value="Nothing"'.$strDisabled.'>'.mi18n("No changes"),chr(10);
}
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td> </td>',chr(10);
echo ' <td>'.mi18n("Cancellation means:").'<br />',chr(10);
if ($arrSettings["FrontendDel"] == "DeleteUser") {
echo ' <input type="radio" name="CMS_VAR[6]" value="DeleteUser" checked'.$strDisabled.'>'.mi18n("Delete"),chr(10);
} else {
echo ' <input type="radio" name="CMS_VAR[6]" value="DeleteUser"'.$strDisabled.'>'.mi18n("Delete"),chr(10);
}
if ($arrSettings["FrontendDel"] == "DisableUser") {
echo ' <input type="radio" name="CMS_VAR[6]" value="DisableUser" checked'.$strDisabled.'>'.mi18n("Disable"),chr(10);
} else {
echo ' <input type="radio" name="CMS_VAR[6]" value="DisableUser"'.$strDisabled.'>'.mi18n("Disable"),chr(10);
}
if ($arrSettings["FrontendDel"] == "Nothing") {
echo ' <input type="radio" name="CMS_VAR[6]" value="Nothing" checked'.$strDisabled.'>'.mi18n("No changes"),chr(10);
} else {
echo ' <input type="radio" name="CMS_VAR[6]" value="Nothing"'.$strDisabled.'>'.mi18n("No changes"),chr(10);
}
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' </table>',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' </table>',chr(10);
Die Änderungen beheben Probleme mit Einträgen in der Art "Mac's Weinladen" an allen möglichen Stellen und ermöglicht die Konfiguration der Module unter Firefox.
Übersetzungen wolltet ihr ja mal bei Gelegenheit nochmal überarbeiten; sagt Bescheid, ich stehe gerne helfend zur Verfügung.
Gruß
HerrB