localization FS#172

Dieser Commit ist enthalten in:
oldperl 2017-08-01 12:52:06 +00:00
Ursprung 520f406556
Commit bdf5a43d06
23 geänderte Dateien mit 4792 neuen und 2737 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,7 +29,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -36,22 +36,20 @@ if (!defined('CON_FRAMEWORK')) {
/**
* Recipient group management class
*/
class RecipientGroupCollection extends ItemCollection
{
class RecipientGroupCollection extends ItemCollection {
/**
* Constructor Function
* @param none
*/
public function __construct()
{
public function __construct() {
global $cfg;
parent::__construct($cfg["tab"]["news_groups"], "idnewsgroup");
$this->_setItemClass("RecipientGroup");
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroupCollection()
{
public function RecipientGroupCollection() {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct();
}
@ -61,8 +59,7 @@ class RecipientGroupCollection extends ItemCollection
* @param $groupname string Specifies the groupname
* @param $defaultgroup integer Specfies, if group is default group (optional)
*/
public function create($groupname, $defaultgroup = 0)
{
public function create($groupname, $defaultgroup = 0) {
global $client, $lang;
$client = Contenido_Security::toInteger($client);
@ -99,8 +96,7 @@ class RecipientGroupCollection extends ItemCollection
*
* @param $itemID int specifies the newsletter recipient group
*/
public function delete($itemID)
{
public function delete($itemID) {
$oAssociations = new RecipientGroupMemberCollection;
$oAssociations->setWhere("idnewsgroup", $itemID);
$oAssociations->query();
@ -110,20 +106,19 @@ class RecipientGroupCollection extends ItemCollection
}
parent::delete($itemID);
}
}
}
/**
* Single RecipientGroup Item
*/
class RecipientGroup extends Item
{
class RecipientGroup extends Item {
/**
* Constructor Function
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false)
{
public function __construct($mId = false) {
global $cfg;
parent::__construct($cfg["tab"]["news_groups"], "idnewsgroup");
if ($mId !== false) {
@ -132,8 +127,7 @@ class RecipientGroup extends Item
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroup($mId = false)
{
public function RecipientGroup($mId = false) {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId);
}
@ -141,8 +135,7 @@ class RecipientGroup extends Item
/**
* Overriden store() method to ensure, that there is only one default group
* */
public function store()
{
public function store() {
global $client, $lang;
$client = Contenido_Security::toInteger($client);
@ -163,20 +156,19 @@ class RecipientGroup extends Item
}
parent::store();
}
}
}
/**
* Recipient group member management class
*/
class RecipientGroupMemberCollection extends ItemCollection
{
class RecipientGroupMemberCollection extends ItemCollection {
/**
* Constructor Function
* @param none
*/
public function __construct()
{
public function __construct() {
global $cfg;
parent::__construct($cfg["tab"]["news_groupmembers"], "idnewsgroupmember");
$this->_setJoinPartner('RecipientGroupCollection');
@ -185,8 +177,7 @@ class RecipientGroupMemberCollection extends ItemCollection
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroupMemberCollection()
{
public function RecipientGroupMemberCollection() {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct();
}
@ -196,8 +187,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* @param $idrecipientgroup int specifies the newsletter group
* @param $idrecipient int specifies the newsletter user
*/
public function create($idrecipientgroup, $idrecipient)
{
public function create($idrecipientgroup, $idrecipient) {
$idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup);
$idrecipient = Contenido_Security::toInteger($idrecipient);
@ -223,8 +213,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* @param $idrecipientgroup int specifies the newsletter group
* @param $idrecipient int specifies the newsletter user
*/
public function remove($idrecipientgroup, $idrecipient)
{
public function remove($idrecipientgroup, $idrecipient) {
$idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup);
$idrecipient = Contenido_Security::toInteger($idrecipient);
@ -241,8 +230,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* Removes all associations from any newsletter group
* @param $idrecipient int specifies the newsletter recipient
*/
public function removeRecipientFromGroups($idrecipient)
{
public function removeRecipientFromGroups($idrecipient) {
$idrecipient = Contenido_Security::toInteger($idrecipient);
$this->setWhere("idnewsrcp", $idrecipient);
@ -257,8 +245,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* Removes all associations of a newsletter group
* @param $idgroup int specifies the newsletter recipient group
*/
public function removeGroup($idgroup)
{
public function removeGroup($idgroup) {
$idgroup = Contenido_Security::toInteger($idgroup);
$this->setWhere("idnewsgroup", $idgroup);
@ -275,8 +262,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* @param $asObjects boolean specifies if the function should return objects
* @return array RecipientRecipient items
*/
public function getRecipientsInGroup($idrecipientgroup, $asObjects = true)
{
public function getRecipientsInGroup($idrecipientgroup, $asObjects = true) {
$idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup);
$this->setWhere("idnewsgroup", $idrecipientgroup);
@ -297,20 +283,19 @@ class RecipientGroupMemberCollection extends ItemCollection
return ($aObjects);
}
}
}
/**
* Single RecipientGroup Item
*/
class RecipientGroupMember extends Item
{
class RecipientGroupMember extends Item {
/**
* Constructor Function
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false)
{
public function __construct($mId = false) {
global $cfg;
parent::__construct($cfg["tab"]["news_groupmembers"], "idnewsgroupmember");
if ($mId !== false) {
@ -319,11 +304,11 @@ class RecipientGroupMember extends Item
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroupMember($mId = false)
{
public function RecipientGroupMember($mId = false) {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId);
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,31 +29,27 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
/**
* Collection management class
*/
class cNewsletterJobCollection extends ItemCollection
{
class cNewsletterJobCollection extends ItemCollection {
/**
* Constructor Function
* @param none
*/
public function __construct()
{
public function __construct() {
global $cfg;
parent::__construct($cfg["tab"]["news_jobs"], "idnewsjob");
$this->_setItemClass("cNewsletterJob");
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterJobCollection()
{
public function cNewsletterJobCollection() {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct();
}
@ -62,8 +59,7 @@ class cNewsletterJobCollection extends ItemCollection
* @param $name string Specifies the name of the newsletter, the same name may be used more than once
* @param $idnews integer Newsletter id
*/
public function create($iIDNews, $iIDCatArt, $sName = "")
{
public function create($iIDNews, $iIDCatArt, $sName = "") {
global $client, $lang, $cfg, $cfgClient, $auth;
$oNewsletter = new Newsletter;
@ -207,7 +203,6 @@ class cNewsletterJobCollection extends ItemCollection
$oItem->set("author", $auth->auth["uid"]);
$oItem->set("authorname", $auth->auth["uname"]);
unset($oNewsletter); // Not needed anymore
// Adds log items for all recipients and returns recipient count
$oLogs = new cNewsletterLogCollection();
$iRecipientCount = $oLogs->initializeJob($oItem->get($oItem->primaryKey), $iIDNews);
@ -231,27 +226,25 @@ class cNewsletterJobCollection extends ItemCollection
*
* @param $iItemID int specifies the frontend user group
*/
public function delete($iItemID)
{
public function delete($iItemID) {
$oLogs = new cNewsletterLogCollection();
$oLogs->delete($iItemID);
parent::delete($iItemID);
}
}
}
/**
* Single NewsletterJob Item
*/
class cNewsletterJob extends Item
{
class cNewsletterJob extends Item {
/**
* Constructor Function
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false)
{
public function __construct($mId = false) {
global $cfg;
parent::__construct($cfg["tab"]["news_jobs"], "idnewsjob");
if ($mId !== false) {
@ -260,14 +253,12 @@ class cNewsletterJob extends Item
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterJob($mId = false)
{
public function cNewsletterJob($mId = false) {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId);
}
public function runJob()
{
public function runJob() {
global $cfg, $recipient;
$iCount = 0;
@ -486,8 +477,7 @@ class cNewsletterJob extends Item
/**
* Overriden store() method to set status to finished if rcpcount is 0
*/
public function store()
{
public function store() {
if ($this->get("rcpcount") == 0) {
// No recipients, job finished
$this->set("status", 9);
@ -499,6 +489,7 @@ class cNewsletterJob extends Item
parent::store();
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,31 +29,27 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
/**
* Collection management class
*/
class cNewsletterLogCollection extends ItemCollection
{
class cNewsletterLogCollection extends ItemCollection {
/**
* Constructor Function
* @param none
*/
public function __construct()
{
public function __construct() {
global $cfg;
parent::__construct($cfg["tab"]["news_log"], "idnewslog");
$this->_setItemClass("cNewsletterLog");
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterLogCollection()
{
public function cNewsletterLogCollection() {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct();
}
@ -64,8 +61,7 @@ class cNewsletterLogCollection extends ItemCollection
* @param $rcp_name string Name of the recipient (-> recipient may be deleted)
* @param $rcp_email string E-Mail of the recipient (-> recipient may be deleted)
*/
public function create($idnewsjob, $idnewsrcp)
{
public function create($idnewsjob, $idnewsrcp) {
global $client, $lang, $auth;
$idnewsjob = Contenido_Security::toInteger($idnewsjob);
@ -118,8 +114,7 @@ class cNewsletterLogCollection extends ItemCollection
* @param integer $idnews ID of newsletter
* @return integer Recipient count
*/
public function initializeJob($idnewsjob, $idnews)
{
public function initializeJob($idnewsjob, $idnews) {
global $cfg;
$idnewsjob = Contenido_Security::toInteger($idnewsjob);
@ -205,8 +200,7 @@ class cNewsletterLogCollection extends ItemCollection
* Overriden delete function to update recipient count if removing recipient from the list
* @param integer $idnewslog ID
*/
public function delete($idnewslog)
{
public function delete($idnewslog) {
$idnewslog = Contenido_Security::toInteger($idnewslog);
$oLog = new cNewsletterLog($idnewslog);
@ -221,8 +215,7 @@ class cNewsletterLogCollection extends ItemCollection
parent::delete($idnewslog);
}
public function deleteJob($idnewsjob)
{
public function deleteJob($idnewsjob) {
$idnewsjob = Contenido_Security::toInteger($idnewsjob);
$this->setWhere("idnewsjob", $idnewsjob);
$this->query();
@ -233,20 +226,19 @@ class cNewsletterLogCollection extends ItemCollection
return true;
}
}
}
/**
* Single NewsletterLog Item
*/
class cNewsletterLog extends Item
{
class cNewsletterLog extends Item {
/**
* Constructor Function
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false)
{
public function __construct($mId = false) {
global $cfg;
parent::__construct($cfg["tab"]["news_log"], "idnewslog");
if ($mId !== false) {
@ -255,11 +247,11 @@ class cNewsletterLog extends Item
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterLog($mId = false)
{
public function cNewsletterLog($mId = false) {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId);
}
}
?>

Datei anzeigen

@ -118,7 +118,7 @@ class NewsletterCollection extends ItemCollection
if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") {
$iIDArt = conCopyArticle($oBaseItem->get("idart"),
$oClientLang->getProperty("newsletter", "html_newsletter_idcat"),
sprintf(i18n("Newsletter: %s"), $oItem->get("name")));
sprintf(i18n("Newsletter: %s", "newsletter"), $oItem->get("name")));
conMakeOnline($iIDArt, $lang); // Article has to be online for sending...
}
unset ($oClientLang);
@ -564,7 +564,7 @@ class Newsletter extends Item
$sReturn = $sHTML;
} else {
if ($contenido) { // Use i18n only in backend
$sErrorText = i18n("There was a problem getting the newsletter article using http. Error: %s (%s)");
$sErrorText = i18n("There was a problem getting the newsletter article using http. Error: %s (%s)", "newsletter");
} else {
$sErrorText = "There was a problem getting the newsletter article using http. Error: %s (%s)";
}
@ -671,7 +671,7 @@ class Newsletter extends Item
// deleted). Exit with error instead of sending as text message only
if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: No html message available");
$sError = i18n("Newsletter to %s could not be sent: No html message available", "newsletter");
} else {
$sError = "Newsletter to %s could not be sent: No html message available";
}
@ -742,7 +742,7 @@ class Newsletter extends Item
if (!isValidMail($sEMail) || strtolower($sEMail) == "sysadmin@ihresite.de") {
// No valid destination mail address specified
if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: No valid e-mail address");
$sError = i18n("Newsletter to %s could not be sent: No valid e-mail address", "newsletter");
} else {
$sError = "Newsletter to %s could not be sent: No valid e-mail address";
}
@ -767,7 +767,7 @@ class Newsletter extends Item
if (!$oMail->Send()) {
if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent");
$sError = i18n("Newsletter to %s could not be sent", "newsletter");
} else {
$sError = "Newsletter to %s could not be sent";
}
@ -830,7 +830,7 @@ class Newsletter extends Item
// deleted). Exit with error instead of sending as text message only
if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter could not be sent: No html message available");
$sError = i18n("Newsletter could not be sent: No html message available", "newsletter");
} else {
$sError = "Newsletter could not be sent: No html message available";
}
@ -942,14 +942,14 @@ class Newsletter extends Item
if (strlen($sKey) != 30) { // Prevents sending without having a key
if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: Recipient has an incompatible or empty key");
$sError = i18n("Newsletter to %s could not be sent: Recipient has an incompatible or empty key", "newsletter");
} else {
$sError = "Newsletter to %s could not be sent: Recipient has an incompatible or empty key";
}
$aMessages[] = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
} else if (!isValidMail($sEMail)) {
if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: No valid e-mail address specified");
$sError = i18n("Newsletter to %s could not be sent: No valid e-mail address specified", "newsletter");
} else {
$sError = "Newsletter to %s could not be sent: No valid e-mail address specified";
}
@ -975,7 +975,7 @@ class Newsletter extends Item
$aSendRcps[] = $sName." (".$sEMail.")";
} else {
if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent");
$sError = i18n("Newsletter to %s could not be sent", "newsletter");
} else {
$sError = "Newsletter to %s could not be sent";
}
@ -985,7 +985,7 @@ class Newsletter extends Item
}
} else {
if ($contenido) { // Use i18n only in backend
$sError = i18n("No recipient with specified recipient/group id %s/%s found");
$sError = i18n("No recipient with specified recipient/group id %s/%s found", "newsletter");
} else {
$sError = "No recipient with specified recpient/group id %s/%s found";
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,31 +29,27 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
/**
* Recipient management class
*/
class RecipientCollection extends ItemCollection
{
class RecipientCollection extends ItemCollection {
/**
* Constructor Function
* @param none
*/
public function __construct()
{
public function __construct() {
global $cfg;
parent::__construct($cfg["tab"]["news_rcp"], "idnewsrcp");
$this->_setItemClass("Recipient");
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientCollection()
{
public function RecipientCollection() {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct();
}
@ -65,8 +62,7 @@ class RecipientCollection extends ItemCollection
* @param string $sJoinID Specifies additional recipient group ids to join (optional, e.g. 47,12,...)
* @param int $iMessageType Specifies the message type for the recipient (0 = text, 1 = html)
*/
public function create($sEMail, $sName = "", $iConfirmed = 0, $sJoinID = "", $iMessageType = 0)
{
public function create($sEMail, $sName = "", $iConfirmed = 0, $sJoinID = "", $iMessageType = 0) {
global $client, $lang, $auth;
$iConfirmed = (int) $iConfirmed;
@ -100,7 +96,6 @@ class RecipientCollection extends ItemCollection
$oItem->store();
$iIDRcp = $oItem->get("idnewsrcp"); // Getting internal id of new recipient
// Add this recipient to the default recipient group (if available)
$oGroups = new RecipientGroupCollection();
$oGroupMembers = new RecipientGroupMemberCollection();
@ -135,8 +130,7 @@ class RecipientCollection extends ItemCollection
*
* @param $itemID int specifies the recipient
*/
public function delete($itemID)
{
public function delete($itemID) {
$oAssociations = new RecipientGroupMemberCollection();
$oAssociations->setWhere("idnewsrcp", $itemID);
$oAssociations->query();
@ -152,8 +146,7 @@ class RecipientCollection extends ItemCollection
* @param $timeframe int Days after creation a not confirmed recipient will be removed
* @return int Count of deleted recipients
*/
public function purge($timeframe)
{
public function purge($timeframe) {
global $client, $lang;
$oRecipientCollection = new RecipientCollection();
@ -172,14 +165,12 @@ class RecipientCollection extends ItemCollection
return $oRecipientCollection->count();
}
/**
* checkEMail returns true, if there is no recipient with the same e-mail address; otherwise false
* @param $email string e-mail
* @return recpient item if item with e-mail exists, false otherwise
*/
public function emailExists($sEmail)
{
public function emailExists($sEmail) {
global $client, $lang;
$oRecipientCollection = new RecipientCollection();
@ -200,8 +191,7 @@ class RecipientCollection extends ItemCollection
* Sets a key for all recipients without key or an old key (len(key) <> 30)
* @param none
*/
public function updateKeys()
{
public function updateKeys() {
$this->setWhere("LENGTH(hash)", 30, "<>");
$this->query();
@ -213,20 +203,19 @@ class RecipientCollection extends ItemCollection
return $iUpdated;
}
}
}
/**
* Single Recipient Item
*/
class Recipient extends Item
{
class Recipient extends Item {
/**
* Constructor Function
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false)
{
public function __construct($mId = false) {
global $cfg;
parent::__construct($cfg["tab"]["news_rcp"], "idnewsrcp");
if ($mId !== false) {
@ -235,8 +224,7 @@ class Recipient extends Item
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function Recipient($mId = false)
{
public function Recipient($mId = false) {
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId);
}
@ -247,8 +235,7 @@ class Recipient extends Item
* @return boolean True if the hash matches, false otherwise
* @deprecated 4.6.15 - 10.08.2006
*/
public function checkMD5Email($md5email)
{
public function checkMD5Email($md5email) {
if ($md5email == md5($this->get("email"))) {
return true;
} else {
@ -256,8 +243,7 @@ class Recipient extends Item
}
}
public function store()
{
public function store() {
global $auth;
$this->set("lastmodified", date("Y-m-d H:i:s"), false);
@ -284,6 +270,7 @@ class Recipient extends Item
$oLog->store();
}
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,7 +29,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -47,10 +47,9 @@ if (is_array($cfg['plugins']['newsletters'])) {
}
}
if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create"))
{
if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create")) {
// Create new newsletter
$oNewsletter = $oNewsletters->create(i18n("-- new newsletter --"));
$oNewsletter = $oNewsletters->create(i18n("-- new newsletter --", "newsletter"));
$idnewsletter = $oNewsletter->get("idnews");
$oPage->setSubnav("idnewsletter=$idnewsletter", "news");
$oPage->setReload();
@ -110,7 +109,6 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
// Delete newsletter
$oNewsletters->delete($idnewsletter);
$oNewsletter = new Newsletter; // Generate empty newsletter object
// Setting blank subnav - "blank" doesn't mean anything special, it just can't be empty
// and must not contain "idnewsletter" as this is checked in the _subnav file.
$oPage->setSubnav("blank", "news");
@ -122,9 +120,9 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
unset($oJobs);
if ($oJob) {
$notis = $notification->returnNotification("info", i18n("Newsletter dispatch job has been added for this newsletter")) . "<br>";
$notis = $notification->returnNotification("info", i18n("Newsletter dispatch job has been added for this newsletter", "newsletter")) . "<br>";
} else {
$notis = $notification->returnNotification("error", i18n("Newsletter dispatch job has been not been added! Please check newsletter details")) . "<br>";
$notis = $notification->returnNotification("error", i18n("Newsletter dispatch job has been not been added! Please check newsletter details", "newsletter")) . "<br>";
}
$oNewsletter = new Newsletter($idnewsletter);
@ -153,8 +151,7 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
// Send test newsletter
$oNewsletter = new Newsletter($idnewsletter);
$aRecipients = array();
if ($iTestIDNewsGroup == 0)
{
if ($iTestIDNewsGroup == 0) {
// Send test newsletter to current user email address
$sName = $oUser->get("realname");
$sEMail = $oUser->get("email");
@ -163,7 +160,7 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
if ($bSend) {
$aRecipients[] = $sName . " (" . $sEMail . ")";
} else {
$aRecipients[] = i18n("None");
$aRecipients[] = i18n("None", "newsletter");
}
} else {
$bSend = $oNewsletter->sendDirect($oClientLang->getProperty("newsletter", "idcatart"), 0, $iTestIDNewsGroup, $aRecipients, $sEncoding);
@ -171,19 +168,18 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
unset($oUser);
if ($bSend) {
$notis = $notification->returnNotification("info", i18n("Test newsletter has been sent to:") . "<br />" . implode("<br />", $aRecipients) . "<br />");
$notis = $notification->returnNotification("info", i18n("Test newsletter has been sent to:", "newsletter") . "<br />" . implode("<br />", $aRecipients) . "<br />");
} else {
$notis = $notification->returnNotification("warning", i18n("Test newsletter has not been sent (partly or completely):") . "<br />" .
i18n("Successful:") . "<br />" . implode("<br />", $aRecipients) . "<br />" .
i18n("Error messages:") . "<br />" . $oNewsletter->_sError);
$notis = $notification->returnNotification("warning", i18n("Test newsletter has not been sent (partly or completely):", "newsletter") . "<br />" .
i18n("Successful:", "newsletter") . "<br />" . implode("<br />", $aRecipients) . "<br />" .
i18n("Error messages:", "newsletter") . "<br />" . $oNewsletter->_sError);
}
} else {
// No action, just get selected newsletter
$oNewsletter = new Newsletter($idnewsletter);
}
if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client && $oNewsletter->get("idlang") == $lang)
{
if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client && $oNewsletter->get("idlang") == $lang) {
// Check and set values
if ($_REQUEST["optSendTo"] == "") {
$_REQUEST["optSendTo"] = $oNewsletter->get("send_to");
@ -208,8 +204,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$_REQUEST["selTemplate"] = 0;
}
if ($action == "news_save" && $perm->have_perm_area_action($area, $action))
{
if ($action == "news_save" && $perm->have_perm_area_action($area, $action)) {
// Save changes
$aMessages = array();
@ -221,14 +216,12 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
if ($oNewsletter->get("name") != $sName ||
$oNewsletter->get("welcome") != $_REQUEST["ckbWelcome"] ||
!isValidMail($oNewsletter->get("newsfrom")) && isValidMail($sFromEMail))
{
!isValidMail($oNewsletter->get("newsfrom")) && isValidMail($sFromEMail)) {
// Only reload, if something visible has changed
$oPage->setReload();
}
if ($oNewsletter->get("name") != $sName)
{
if ($oNewsletter->get("name") != $sName) {
// Check, if item with same name exists
$oNewsletters->setWhere("name", $sName);
$oNewsletters->setWhere("idclient", $client);
@ -236,22 +229,19 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oNewsletters->setWhere($oNewsletter->primaryKey, $oNewsletter->get($oNewsletter->primaryKey), "!=");
$oNewsletters->query();
if ($oNewsletters->next())
{
$aMessages[] = i18n("Could not set new newsletter name: name already exists");
if ($oNewsletters->next()) {
$aMessages[] = i18n("Could not set new newsletter name: name already exists", "newsletter");
} else {
$oNewsletter->set("name", $sName);
if ($oNewsletter->get("idart") > 0)
{
if ($oNewsletter->get("idart") > 0) {
// Update also HTML newsletter article title, if newsletter name has been changed
$oArticles = new cApiArticleLanguageCollection;
$oArticles->setWhere("idlang", $lang);
$oArticles->setWhere("idart", $oNewsletter->get("idart"));
$oArticles->query();
if ($oArticle = $oArticles->next())
{
$oArticle->set("title", sprintf(i18n("Newsletter: %s"), $oNewsletter->get("name")));
if ($oArticle = $oArticles->next()) {
$oArticle->set("title", sprintf(i18n("Newsletter: %s", "newsletter"), $oNewsletter->get("name")));
$oArticle->store();
}
unset($oArticle);
@ -259,8 +249,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
}
}
}
if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true")
{
if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") {
$oNewsletter->set("type", $selType);
} else {
$oNewsletter->set("type", "text");
@ -273,16 +262,12 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oNewsletter->set("welcome", $_REQUEST["ckbWelcome"]);
// Check out if there are any plugins
if (is_array($cfg['plugins']['newsletters']))
{
foreach ($cfg['plugins']['newsletters'] as $plugin)
{
if (function_exists("newsletters_".$plugin."_wantedVariables") && function_exists("newsletters_".$plugin."_store"))
{
if (is_array($cfg['plugins']['newsletters'])) {
foreach ($cfg['plugins']['newsletters'] as $plugin) {
if (function_exists("newsletters_" . $plugin . "_wantedVariables") && function_exists("newsletters_" . $plugin . "_store")) {
$wantVariables = call_user_func("newsletters_" . $plugin . "_wantedVariables");
if (is_array($wantVariables))
{
if (is_array($wantVariables)) {
$varArray = array();
foreach ($wantVariables as $value) {
@ -297,14 +282,13 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
// If "selected groups" have been selected and no group specified, set
// selection to "all"
if ($_REQUEST["optSendTo"] == "selection" && !is_array($_REQUEST["selGroup"])) {
$aMessages[] = i18n("'Send to recipients in selected groups' has been selected, but no group has been specified. Selection has been set to 'Send to all recipients'");
$aMessages[] = i18n("'Send to recipients in selected groups' has been selected, but no group has been specified. Selection has been set to 'Send to all recipients'", "newsletter");
$_REQUEST["optSendTo"] = "all";
}
$oNewsletter->set("send_to", $_REQUEST["optSendTo"]);
$oNewsletter->set("send_ids", serialize($_REQUEST["selGroup"]));
if (getEffectiveSetting("newsletter", "option-cronjob-available", "false") == "true")
{
if (getEffectiveSetting("newsletter", "option-cronjob-available", "false") == "true") {
// Only store changes, if cronjob option is available
if (isset($_REQUEST["ckbCronJob"])) {
$oNewsletter->set("use_cronjob", 1);
@ -323,10 +307,8 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oNewsletter->set("dispatch_delay", $_REQUEST["txtDispatchDelay"]);
$oNewsletter->store(); // Note, that the properties are stored, anyway
// Storing from (e-mail), from (name) and options as default
if ($_REQUEST["ckbSetDefault"])
{
if ($_REQUEST["ckbSetDefault"]) {
$oClientLang->setProperty("newsletter", "newsfrom", $sFromEMail);
$oClientLang->setProperty("newsletter", "newsfromname", $sFromName);
$oClientLang->setProperty("newsletter", "sendto", $_REQUEST["optSendTo"]);
@ -350,8 +332,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
}
} else {
$_REQUEST["selGroup"] = unserialize($oNewsletter->get("send_ids"));
if (!is_array($_REQUEST["selGroup"]))
{
if (!is_array($_REQUEST["selGroup"])) {
$_REQUEST["selGroup"] = unserialize($oClientLang->getProperty("newsletter", "sendgroups"));
if (!is_array($_REQUEST["selGroup"])) {
$_REQUEST["selGroup"] = array();
@ -372,16 +353,16 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oForm->setVar("action", "news_save");
$oForm->setVar("idnewsletter", $oNewsletter->get("idnews"));
$oForm->addHeader(i18n("Edit newsletter"));
$oForm->addHeader(i18n("Edit newsletter", "newsletter"));
$oTxtName = new cHTMLTextbox("txtName", $oNewsletter->get("name"), 40);
$oForm->add(i18n("Name"), $oTxtName->render());
$oForm->add(i18n("Name", "newsletter"), $oTxtName->render());
$oSelType = new cHTMLSelectElement("selType");
$aItems = array();
$aItems[] = array("text", i18n("Text only"));
$aItems[] = array("text", i18n("Text only", "newsletter"));
if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") {
$aItems[] = array("html", i18n("HTML and text"));
$aItems[] = array("html", i18n("HTML and text", "newsletter"));
} else {
$oNewsletter->set("type", "text"); // just in case the global setting was switched off
// TODO: Should this setting be stored?
@ -389,15 +370,15 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oSelType->autoFill($aItems);
$oSelType->setDefault($oNewsletter->get("type"));
$oForm->add(i18n("Type"), $oSelType->render());
$oForm->add(i18n("Type", "newsletter"), $oSelType->render());
$oTxtFromEMail = new cHTMLTextbox("txtFromEMail", $oNewsletter->get("newsfrom"), 40);
$oTxtFromName = new cHTMLTextbox("txtFromName", $oNewsletter->get("newsfromname"), 40);
$oTxtSubject = new cHTMLTextarea("txtSubject", $oNewsletter->get("subject"), 80, 2);
$oForm->add(i18n("From (E-Mail)"), $oTxtFromEMail->render());
$oForm->add(i18n("From (Name)"), $oTxtFromName->render()."&nbsp;".i18n("optional"));
$oForm->add(i18n("Subject"), $oTxtSubject->render());
$oForm->add(i18n("From (E-Mail)", "newsletter"), $oTxtFromEMail->render());
$oForm->add(i18n("From (Name)", "newsletter"), $oTxtFromName->render() . "&nbsp;" . i18n("optional", "newsletter"));
$oForm->add(i18n("Subject", "newsletter"), $oTxtSubject->render());
// Send options
$oSendToAll = new cHTMLRadiobutton("optSendTo", "all");
@ -413,8 +394,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oRcpGroups->query();
$aItems = array();
while ($oRcpGroup = $oRcpGroups->next())
{
while ($oRcpGroup = $oRcpGroups->next()) {
$sGroupName = $oRcpGroup->get("groupname");
if ($oRcpGroup->get("defaultgroup")) {
$sGroupName = $sGroupName . "*";
@ -426,19 +406,17 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oSelGroup->setSize(10);
$oSelGroup->setStyle("width: 350px; margin-top: 5px; margin-bottom: 5px; margin-left: 25px;");
$oSelGroup->setMultiSelect();
$oSelGroup->setAlt(i18n("Note: Hold <Ctrl> to select multiple items."));
$oSelGroup->setAlt(i18n("Note: Hold <Ctrl> to select multiple items.", "newsletter"));
$oSelGroup->autoFill($aItems);
// No groups in the list, sendToGroups and group listbox disabled
if (count($aItems) == 0)
{
if (count($aItems) == 0) {
$oSendToGroups->setDisabled(true);
if ($_REQUEST["optSendTo"] == "selection") {
$_REQUEST["optSendTo"] == "all";
}
} else if (is_array($_REQUEST["selGroup"])) {
foreach ($_REQUEST["selGroup"] as $sValue)
{
foreach ($_REQUEST["selGroup"] as $sValue) {
if (array_key_exists($sValue, $oSelGroup->_options)) {
// only select, if item still exists
$oSelGroup->_options[$sValue]->setSelected(true);
@ -446,8 +424,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
}
}
switch ($_REQUEST["optSendTo"])
{
switch ($_REQUEST["optSendTo"]) {
case "default":
$oSendToDefault->setChecked(true);
$oSelGroup->setDisabled(true);
@ -461,10 +438,9 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
}
// Recipients
$oForm->add(i18n("Recipients"),
$oSendToAll->toHTML(false)."&nbsp;".i18n("Send newsletter to all recipients")."<br />".chr(10).
$oSendToDefault->toHTML(false)."&nbsp;".i18n("Send newsletter to the members of the default group")."<br />".chr(10).
$oSendToGroups->toHTML(false)."&nbsp;".i18n("Send newsletter to the members of the selected group(s):")."<br />".chr(10).
$oForm->add(i18n("Recipients", "newsletter"), $oSendToAll->toHTML(false) . "&nbsp;" . i18n("Send newsletter to all recipients", "newsletter") . "<br />" . chr(10) .
$oSendToDefault->toHTML(false) . "&nbsp;" . i18n("Send newsletter to the members of the default group", "newsletter") . "<br />" . chr(10) .
$oSendToGroups->toHTML(false) . "&nbsp;" . i18n("Send newsletter to the members of the selected group(s):", "newsletter") . "<br />" . chr(10) .
$oSelGroup->render());
/* TODO: Work in progress
@ -536,26 +512,25 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$ckbCronJob->setDisabled("");
} else {
// Give the user a hint
$ckbCronJob->setAlt(i18n("Option has to be enabled as client setting - see techref for details"));
$ckbCronJob->setAlt(i18n("Option has to be enabled as client setting - see techref for details", "newsletter"));
}
$oCkbDispatch = new cHTMLCheckbox("ckbDispatch", "enabled");
$oCkbDispatch->setChecked($oNewsletter->get("dispatch"));
$oTxtDispatchCount = new cHTMLTextbox("txtDispatchCount", $oNewsletter->get("dispatch_count"), 4);
$oTxtDispatchDelay = new cHTMLTextbox("txtDispatchDelay", $oNewsletter->get("dispatch_delay"), 4);
$oTxtDispatchDelay->setAlt(i18n("Note: Set to 0 to send chunks manually."));
$oTxtDispatchDelay->setAlt(i18n("Note: Set to 0 to send chunks manually.", "newsletter"));
$oCkbSaveAsDefault = new cHTMLCheckbox("ckbSetDefault", "1");
$oForm->add(i18n("Options"),
$ckbWelcome->toHTML(false)."&nbsp;".i18n("Welcome-Newsletter")."<br />".
$ckbCronJob->toHTML(false)."&nbsp;".i18n("Use cronjob")."<br />".
$oCkbDispatch->toHTML(false)."&nbsp;".i18n("Send in blocks:")."&nbsp;&nbsp;&nbsp;".
i18n("Recipients per block:")."&nbsp;".$oTxtDispatchCount->render()."&nbsp;".
i18n("Delay between blocks:")."&nbsp;".$oTxtDispatchDelay->render()."&nbsp;".i18n("sec.")."<br />".
$oCkbSaveAsDefault->toHTML(false)."&nbsp;".i18n("Save option settings as default"));
$oForm->add(i18n("Options", "newsletter"), $ckbWelcome->toHTML(false) . "&nbsp;" . i18n("Welcome-Newsletter", "newsletter") . "<br />" .
$ckbCronJob->toHTML(false) . "&nbsp;" . i18n("Use cronjob", "newsletter") . "<br />" .
$oCkbDispatch->toHTML(false) . "&nbsp;" . i18n("Send in blocks:", "newsletter") . "&nbsp;&nbsp;&nbsp;" .
i18n("Recipients per block:", "newsletter") . "&nbsp;" . $oTxtDispatchCount->render() . "&nbsp;" .
i18n("Delay between blocks:", "newsletter") . "&nbsp;" . $oTxtDispatchDelay->render() . "&nbsp;" . i18n("sec.", "newsletter") . "<br />" .
$oCkbSaveAsDefault->toHTML(false) . "&nbsp;" . i18n("Save option settings as default", "newsletter"));
$oForm->add(i18n("Author"), $classuser->getUserName($oNewsletter->get("author")) . " (". $oNewsletter->get("created").")" );
$oForm->add(i18n("Last modified by"), $classuser->getUserName($oNewsletter->get("modifiedby")). " (". $oNewsletter->get("modified").")" );
$oForm->add(i18n("Author", "newsletter"), $classuser->getUserName($oNewsletter->get("author")) . " (" . $oNewsletter->get("created") . ")");
$oForm->add(i18n("Last modified by", "newsletter"), $classuser->getUserName($oNewsletter->get("modifiedby")) . " (" . $oNewsletter->get("modified") . ")");
$sExecScript = '
<script type="text/javascript">
@ -578,5 +553,4 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
}
$oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,13 +28,11 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude("includes", "functions.con.php"); // For conDeleteArt and conCopyArt
// Initialization
$oPage = new cPage;
$oClientLang = new cApiClientLanguage(false, $client, $lang);
@ -59,28 +58,22 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
// text message he may still have the right to change the html article. To prevent
// changing the html article, give the user only read access right for the newsletter
// article category - the article will be shown also, if he doesn't have any rights at all...
if ($action == "news_save" && $perm->have_perm_area_action("news", $action)) // Don't use $area!
{
if ($action == "news_save" && $perm->have_perm_area_action("news", $action)) { // Don't use $area!
// Changing e.g. \' back to ' (magic_quotes)
$sMessage = Contenido_Security::unescapeDB($_REQUEST["txtMessage"]);
$oNewsletter->set("message", $sMessage);
if ($oNewsletter->get("template_idart") != $_REQUEST["selTemplate"])
{
if ($oNewsletter->get("idart") > 0)
{
if ($oNewsletter->get("template_idart") != $_REQUEST["selTemplate"]) {
if ($oNewsletter->get("idart") > 0) {
// Template has been changed: Delete old article
// (this discards the current html content as it deletes the existing newsletter article)
conDeleteArt($oNewsletter->get("idart"));
$iIDArt = 0;
}
if ($_REQUEST["selTemplate"] > 0)
{
if ($_REQUEST["selTemplate"] > 0) {
// Template has been changed, but specified: Store template article as new newsletter article
$iIDArt = conCopyArticle($_REQUEST["selTemplate"],
$oClientLang->getProperty("newsletter", "html_newsletter_idcat"),
sprintf(i18n("Newsletter: %s"), $oNewsletter->get("name")));
$iIDArt = conCopyArticle($_REQUEST["selTemplate"], $oClientLang->getProperty("newsletter", "html_newsletter_idcat"), sprintf(i18n("Newsletter: %s", "newsletter"), $oNewsletter->get("name")));
conMakeOnline($iIDArt, $lang); // Article has to be online for sending...
}
@ -96,10 +89,9 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oArticles->setWhere("idart", $oNewsletter->get("idart"));
$oArticles->query();
if ($oArticles->count() == 0)
{
if ($oArticles->count() == 0) {
// Ups, article lost, reset idart and template_idart for newsletter
$notis = $notification->returnNotification("error", sprintf(i18n("The html newsletter article has been deleted (idart: %s), the html message is lost"), $oNewsletter->get("idart"))) . "<br>";
$notis = $notification->returnNotification("error", sprintf(i18n("The html newsletter article has been deleted (idart: %s), the html message is lost", "newsletter"), $oNewsletter->get("idart"))) . "<br>";
$oNewsletter->set("idart", 0);
$oNewsletter->set("template_idart", 0);
@ -110,14 +102,11 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oArticles->setWhere("idart", $oNewsletter->get("template_idart"));
$oArticles->query();
if ($oArticles->count() == 0)
{
if ($oArticles->count() == 0) {
// Ups, template has been deleted: Restore from current newsletter message article
$notis = $notification->returnNotification("warning", i18n("The html newsletter template article has been deleted, it has been restored using the html message article of this newsletter")) . "<br>";
$notis = $notification->returnNotification("warning", i18n("The html newsletter template article has been deleted, it has been restored using the html message article of this newsletter", "newsletter")) . "<br>";
$iIDArt = conCopyArticle($oNewsletter->get("idart"),
$oClientLang->getProperty("newsletter", "html_template_idcat"),
sprintf(i18n("%s (Template restored)"), $oNewsletter->get("name")));
$iIDArt = conCopyArticle($oNewsletter->get("idart"), $oClientLang->getProperty("newsletter", "html_template_idcat"), sprintf(i18n("%s (Template restored)", "newsletter"), $oNewsletter->get("name")));
$oNewsletter->set("template_idart", $iIDArt);
$oNewsletter->store();
}
@ -131,49 +120,44 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oForm->setVar("idnewsletter", $idnewsletter);
$oForm->setWidth("100%");
$oForm->addHeader(sprintf(i18n("Edit newsletter message (%s)"), $oNewsletter->get("name")));
$oForm->addHeader(sprintf(i18n("Edit newsletter message (%s)", "newsletter"), $oNewsletter->get("name")));
$oForm->add(i18n("Subject"), $oNewsletter->get("subject"));
$sTagInfoText = '<a href="javascript:fncShowHide(\'idTagInfoText\');"><strong>'.i18n("Tag information").'</strong></a>'.
'<div id="idTagInfoText" style="display: none"><br /><b>'. i18n("Special message tags (will be replaced when sending)").':</b><br>'.
'MAIL_NAME: '.i18n("Name of the recipient").'<br />'.
'MAIL_DATE: '.i18n("Date, when the mail has been sent").'<br />'.
'MAIL_TIME: '.i18n("Time, when the mail has been sent").'<br />'.
'MAIL_NUMBER: '.i18n("Number of recipients").'<br />'.
#'MAIL_CHANGE: '.i18n("Link to change the e-mail adress").'<br />'.
'MAIL_UNSUBSCRIBE: '.i18n("Link to unsubscribe").'<br />'.
'MAIL_STOP: '.i18n("Link to pause the subscription").'<br />'.
'MAIL_GOON: '.i18n("Link to resume the subscription");
$sTagInfoText = '<a href="javascript:fncShowHide(\'idTagInfoText\');"><strong>' . i18n("Tag information", "newsletter") . '</strong></a>' .
'<div id="idTagInfoText" style="display: none"><br /><b>' . i18n("Special message tags (will be replaced when sending)", "newsletter") . ':</b><br>' .
'MAIL_NAME: ' . i18n("Name of the recipient", "newsletter") . '<br />' .
'MAIL_DATE: ' . i18n("Date, when the mail has been sent", "newsletter") . '<br />' .
'MAIL_TIME: ' . i18n("Time, when the mail has been sent", "newsletter") . '<br />' .
'MAIL_NUMBER: ' . i18n("Number of recipients", "newsletter") . '<br />' .
#'MAIL_CHANGE: '.i18n("Link to change the e-mail adress", "newsletter").'<br />'.
'MAIL_UNSUBSCRIBE: ' . i18n("Link to unsubscribe", "newsletter") . '<br />' .
'MAIL_STOP: ' . i18n("Link to pause the subscription", "newsletter") . '<br />' .
'MAIL_GOON: ' . i18n("Link to resume the subscription", "newsletter");
$sTagInfoHTML = '<a href="javascript:fncShowHide(\'idTagInfoHTML\');"><strong>'.i18n("Tag information").'</strong></a>'.
'<div id="idTagInfoHTML" style="display: none"><br /><b>'.i18n("Special message tags (will be replaced when sending, {..} = optional)").":</b><br />".
'[mail name="name" type="text"]{text}MAIL_NAME{text}[/mail]: '.i18n("Name of the recipient")."<br />".
'[mail name="date" type="text"]{text}MAIL_DATE{text}[/mail]: '.i18n("Date, when the mail has been sent")."<br />".
'[mail name="time" type="text"]{text}MAIL_TIME{text}[/mail]: '.i18n("Time, when the mail has been sent")."<br />".
'[mail name="number" type="text"]{text}MAIL_NUMBER{text}[/mail]: '.i18n("Number of recipients")."<br />".
#'[mail name="change" type="link" {text="'.i18n("Link text").'"}]{text}MAIL_CHANGE{text}[/mail]: '.i18n("Link to change the e-mail adress")."<br />".
'[mail name="unsubscribe" type="link" {text="'.i18n("Link text").'" }]{text}MAIL_UNSUBSCRIBE{text}[/mail]: '.i18n("Link to unsubscribe")."<br />".
'[mail name="stop" type="link" {text="'.i18n("Link text").'" }]{text}MAIL_STOP{text}[/mail]: '.i18n("Link to pause the subscription")."<br />".
'[mail name="goon" type="link" {text="'.i18n("Link text").'" }]{text}MAIL_GOON{text}[/mail]: '.i18n("Link to resume the subscription");
$sTagInfoHTML = '<a href="javascript:fncShowHide(\'idTagInfoHTML\');"><strong>' . i18n("Tag information", "newsletter") . '</strong></a>' .
'<div id="idTagInfoHTML" style="display: none"><br /><b>' . i18n("Special message tags (will be replaced when sending, {..} = optional)", "newsletter") . ":</b><br />" .
'[mail name="name" type="text"]{text}MAIL_NAME{text}[/mail]: ' . i18n("Name of the recipient", "newsletter") . "<br />" .
'[mail name="date" type="text"]{text}MAIL_DATE{text}[/mail]: ' . i18n("Date, when the mail has been sent", "newsletter") . "<br />" .
'[mail name="time" type="text"]{text}MAIL_TIME{text}[/mail]: ' . i18n("Time, when the mail has been sent", "newsletter") . "<br />" .
'[mail name="number" type="text"]{text}MAIL_NUMBER{text}[/mail]: ' . i18n("Number of recipients", "newsletter") . "<br />" .
#'[mail name="change" type="link" {text="'.i18n("Link text", "newsletter").'"}]{text}MAIL_CHANGE{text}[/mail]: '.i18n("Link to change the e-mail adress", "newsletter")."<br />".
'[mail name="unsubscribe" type="link" {text="' . i18n("Link text", "newsletter") . '" }]{text}MAIL_UNSUBSCRIBE{text}[/mail]: ' . i18n("Link to unsubscribe", "newsletter") . "<br />" .
'[mail name="stop" type="link" {text="' . i18n("Link text", "newsletter") . '" }]{text}MAIL_STOP{text}[/mail]: ' . i18n("Link to pause the subscription", "newsletter") . "<br />" .
'[mail name="goon" type="link" {text="' . i18n("Link text", "newsletter") . '" }]{text}MAIL_GOON{text}[/mail]: ' . i18n("Link to resume the subscription", "newsletter");
// Mention plugin interface
if (getSystemProperty("newsletter", "newsletter-recipients-plugin") == "true")
{
$sTagInfoText .= "<br /><br /><strong>".i18n("Additional message tags from recipients plugins:")."</strong><br />";
$sTagInfoHTML .= "<br /><br /><strong>".i18n("Additional message tags from recipients plugins:")."</strong><br />";
if (getSystemProperty("newsletter", "newsletter-recipients-plugin") == "true") {
$sTagInfoText .= "<br /><br /><strong>" . i18n("Additional message tags from recipients plugins:", "newsletter") . "</strong><br />";
$sTagInfoHTML .= "<br /><br /><strong>" . i18n("Additional message tags from recipients plugins:", "newsletter") . "</strong><br />";
if (is_array($cfg['plugins']['recipients']))
{
foreach ($cfg['plugins']['recipients'] as $plugin)
{
if (is_array($cfg['plugins']['recipients'])) {
foreach ($cfg['plugins']['recipients'] as $plugin) {
plugin_include("recipients", $plugin . "/" . $plugin . ".php");
if (function_exists("recipients_".$plugin."_wantedVariables"))
{
if (function_exists("recipients_" . $plugin . "_wantedVariables")) {
$aPluginVars = call_user_func("recipients_" . $plugin . "_wantedVariables");
foreach ($aPluginVars as $sPluginVar)
{
foreach ($aPluginVars as $sPluginVar) {
$sTagInfoText .= 'MAIL_' . strtoupper($sPluginVar) . '<br />';
$sTagInfoHTML .= '[mail name="' . strtolower($sPluginVar) . '" type="text"][/mail]<br />';
}
@ -187,8 +171,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$sTagInfoHTML .= "</div>";
$iTplIDArt = 0; // Used later for on change event
if ($oNewsletter->get("type") == "html")
{
if ($oNewsletter->get("type") == "html") {
$iTplIDArt = $oNewsletter->get("template_idart");
$oSelTemplate = new cHTMLSelectElement("selTemplate");
$oSelTemplate->setEvent("change", "askSubmitOnTplChange(this);");
@ -199,9 +182,8 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oTemplateArticles = new ArticleCollection($aOptions);
$aItems = array();
$aItems[] = array(0, i18n("-- none --"));
while ($oArticle = $oTemplateArticles->nextArticle())
{
$aItems[] = array(0, i18n("-- none --", "newsletter"));
while ($oArticle = $oTemplateArticles->nextArticle()) {
$aItems[] = array($oArticle->get("idart"), $oArticle->get("title"));
}
@ -211,22 +193,21 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
unset($oArticles);
unset($oTemplateArticles);
$oForm->add(i18n("HTML Template"), $oSelTemplate->render()."&nbsp;".i18n("Note, that changing the template discards the current html message content"));
$oForm->add(i18n("HTML Template", "newsletter"), $oSelTemplate->render() . "&nbsp;" . i18n("Note, that changing the template discards the current html message content", "newsletter"));
if ($iTplIDArt != 0)
{
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"), '<iframe width="100%" height="600" src="'.$sFrameSrc.'"></iframe><br />'.$sTagInfoHTML);
$oForm->add(i18n("HTML Message", "newsletter"), '<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")) . "<br />";
$notis .= $notification->returnNotification("warning", i18n("Newsletter type has been set to HTML/text, please remember to select an html template", "newsletter")) . "<br />";
$oForm->add(i18n("HTML Message"), i18n("Please choose a template first"));
$oForm->add(i18n("HTML Message", "newsletter"), i18n("Please choose a template first", "newsletter"));
}
}
$oTxtMessage = new cHTMLTextarea("txtMessage", $oNewsletter->get("message"), 80, 20);
$oForm->add(i18n("Text Message"), $oTxtMessage->render()."<br />".$sTagInfoText);
$oForm->add(i18n("Text Message", "newsletter"), $oTxtMessage->render() . "<br />" . $sTagInfoText);
$sExecScript = '
<script type="text/javascript">
@ -256,7 +237,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
submitForm();
} else {
// You may loose information, warn!
box.confirm("'.i18n("HTML newsletter template changed").'", "'.i18n("HTML template has been changed. Do you like to save now to apply changes?<br /><br /><b>Note, that existing HTML newsletter content will get lost!</b>").'", "submitForm()");
box.confirm("' . i18n("HTML newsletter template changed", "newsletter") . '", "' . i18n("HTML template has been changed. Do you like to save now to apply changes?<br /><br /><b>Note, that existing HTML newsletter content will get lost!</b>", "newsletter") . '", "submitForm()");
}
}
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -60,34 +60,32 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
if ($oJob->get("dispatch_delay") == 0) {
// Send manually
$oForm = new UI_Table_Form("properties", $sPathNext);
$oForm->addHeader(i18n("Report:"));
$oForm->addHeader(i18n("Report:", "newsletter"));
$oForm->add("", "");
$oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)"),
$iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)", "newsletter"), $iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml']."images/but_cancel.gif", i18n("Stop sending"), "c");
$oForm->setActionButton("submit", $cfg['path']['contenido_fullhtml']."images/but_ok.gif", i18n("Send next chunk"), "s", "news_job_run");
$oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml'] . "images/but_cancel.gif", i18n("Stop sending", "newsletter"), "c");
$oForm->setActionButton("submit", $cfg['path']['contenido_fullhtml'] . "images/but_ok.gif", i18n("Send next chunk", "newsletter"), "s", "news_job_run");
} else {
// Send automatically
$oForm = new UI_Table_Form("properties");
$oForm->addHeader(i18n("Report:"));
$oForm->addHeader(i18n("Report:", "newsletter"));
$oForm->add("", "");
$oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)"),
$iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)", "newsletter"), $iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oPage->addScript("Refresh", '<meta http-equiv="refresh" content="' . $oJob->get("dispatch_delay") . '; URL=' . $sPathNext . '">');
$oForm->unsetActionButton("submit");
$oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml']."images/but_cancel.gif", i18n("Stop sending"), "c");
$oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml'] . "images/but_cancel.gif", i18n("Stop sending", "newsletter"), "c");
}
} else {
// All newsletters should have been sent
$oForm = new UI_Table_Form("properties");
$oForm->addHeader(i18n("Report:"));
$oForm->addHeader(i18n("Report:", "newsletter"));
$oForm->add("", "");
$oForm->add("", sprintf(i18n("The newsletter has been sent to %s recipients"), $oJob->get("sendcount")));
$oForm->add("", sprintf(i18n("The newsletter has been sent to %s recipients", "newsletter"), $oJob->get("sendcount")));
$oPage->setReload();
}
@ -105,8 +103,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oLogs = new cNewsletterLogCollection;
// Remove recipient from a job
if ($action == "news_job_detail_delete" && is_numeric($_REQUEST["idnewslog"]) && $perm->have_perm_area_action($area, "news_job_detail_delete"))
{
if ($action == "news_job_detail_delete" && is_numeric($_REQUEST["idnewslog"]) && $perm->have_perm_area_action($area, "news_job_detail_delete")) {
$oLogs->delete($_REQUEST["idnewslog"]);
}
@ -145,19 +142,18 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oFrmOptions->setVar("idnewsjob", $_REQUEST["idnewsjob"]);
//$oFrmOptions->setVar("startpage", $startpage);
//$oFrmOptions->setVar("appendparameters", $appendparameters);
$oFrmOptions->addHeader(i18n("List options"));
$oFrmOptions->addHeader(i18n("List options", "newsletter"));
$oSelElements = new cHTMLSelectElement("elemperpage");
$oSelElements->setEvent("onchange", "document.forms.frmOptions.submit();");
$aData = Array("0" => i18n("-All-"),
$aData = Array("0" => i18n("-All-", "newsletter"),
"50" => "50",
"100" => "100",
"250" => "250",
"500" => "500");
foreach ($aData as $sKey => $sValue)
{
foreach ($aData as $sKey => $sValue) {
$oOption = new cHTMLOptionElement($sValue, $sKey);
$oSelElements->addOptionElement($sKey, $oOption);
}
@ -165,7 +161,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oSelElements->setDefault($_REQUEST["elemperpage"]);
//$oSelElements->setStyle('border:1px;border-style:solid;border-color:black;');
$oFrmOptions->add(i18n("Items per page:"), $oSelElements->render());
$oFrmOptions->add(i18n("Items per page:", "newsletter"), $oSelElements->render());
// Ouput data
$oList = new cScrollList(true, "news_job_details");
@ -174,7 +170,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oList->setCustom("elemperpage", $_REQUEST["elemperpage"]);
$aCols = array("rcpname", "rcpemail", "", "status", "sent");
$oList->setHeader(i18n("Recipient"), i18n("E-Mail"), i18n("Type"), i18n("Status"), i18n("Sent"), i18n("Actions"));
$oList->setHeader(i18n("Recipient", "newsletter"), i18n("E-Mail", "newsletter"), i18n("Type", "newsletter"), i18n("Status", "newsletter"), i18n("Sent", "newsletter"), i18n("Actions", "newsletter"));
$oList->setSortable(0, true);
$oList->setSortable(1, true);
$oList->setSortable(2, false);
@ -186,23 +182,19 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oLogs->setWhere("idnewsjob", $_REQUEST["idnewsjob"]);
$sBrowseLinks = "1";
if ($_REQUEST["elemperpage"] > 0)
{
if ($_REQUEST["elemperpage"] > 0) {
// First, get total data count
$oLogs->query();
$iRecipients = $oLogs->count(); // Getting item count without limit (for page function) - better idea anybody (performance)?
if ($iRecipients > 0 && $iRecipients > $_REQUEST["elemperpage"])
{
if ($iRecipients > 0 && $iRecipients > $_REQUEST["elemperpage"]) {
$sBrowseLinks = "";
for ($i = 1; $i <= ceil($iRecipients / $_REQUEST["elemperpage"]); $i++)
{
for ($i = 1; $i <= ceil($iRecipients / $_REQUEST["elemperpage"]); $i++) {
//$iNext = (($i - 1) * $_REQUEST["elemperpage"]) + 1;
if ($sBrowseLinks !== "") {
$sBrowseLinks .= "&nbsp;";
}
if ($iNextPage == $i)
{
if ($iNextPage == $i) {
$sBrowseLinks .= $i . "\n"; // I'm on the current page, no link
} else {
$sBrowseLinks .= '<a href="' . $sess->url("main.php?area=$area&action=$action&frame=$frame&idnewsjob=" .
@ -222,32 +214,30 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oLogs->query();
$oImgDelete = new cHTMLImage("images/delete.gif");
$oImgDelete->setAlt(i18n("Delete item"));
$oImgDelete->setAlt(i18n("Delete item", "newsletter"));
$sImgDelete = $oImgDelete->render();
unset($oImgDelete);
$iCount = 0;
$aNewsType[] = array(); // Performance
$aNewsType[0] = i18n("Text only");
$aNewsType[1] = i18n("HTML/Text");
while ($oLog = $oLogs->next())
{
$aNewsType[0] = i18n("Text only", "newsletter");
$aNewsType[1] = i18n("HTML/Text", "newsletter");
while ($oLog = $oLogs->next()) {
$sName = $oLog->get("rcpname");
$sEMail = $oLog->get("rcpemail");
switch ($oLog->get("status"))
{
switch ($oLog->get("status")) {
case "pending":
$sStatus = i18n("Waiting for sending");
$sStatus = i18n("Waiting for sending", "newsletter");
break;
case "sending":
$sStatus = i18n("Sending");
$sStatus = i18n("Sending", "newsletter");
break;
case "successful":
$sStatus = i18n("Successful");
$sStatus = i18n("Successful", "newsletter");
break;
default:
$sStatus = sprintf(i18n("Error: %s"), $oLog->get("status"));
$sStatus = sprintf(i18n("Error: %s", "newsletter"), $oLog->get("status"));
}
if ($oLog->get("sent") == "0000-00-00 00:00:00") {
@ -257,8 +247,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
}
$sLnkRemove = "";
if ($oLog->get("status") == "pending" && $perm->have_perm_area_action($area, "news_job_detail_delete"))
{
if ($oLog->get("status") == "pending" && $perm->have_perm_area_action($area, "news_job_detail_delete")) {
$oLnkRemove = new cHTMLLink;
$oLnkRemove->setCLink("news_jobs", 4, "news_job_detail_delete");
$oLnkRemove->setCustom("idnewsjob", $_REQUEST["idnewsjob"]);
@ -286,7 +275,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
</tr>
<tr class="text_medium" style="background-color: #ffffff;">
<td style="border: 1px; border-color: #B3B3B3; border-style: solid; background-color: #E2E2E2; color:#666666"> ' .
sprintf(i18n("Go to page: %s"), $sBrowseLinks) . '</td>
sprintf(i18n("Go to page: %s", "newsletter"), $sBrowseLinks) . '</td>
</tr>
</table>';
@ -301,91 +290,84 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oForm->setVar("action", "");
$oForm->setVar("idnewsjob", $idnewsjob);
$oForm->addHeader(i18n("Newsletter Dispatch Job"));
$oForm->addHeader(i18n("Newsletter Dispatch Job", "newsletter"));
$oForm->add(i18n("Name"), $oJob->get("name"));
$oForm->add(i18n("Name", "newsletter"), $oJob->get("name"));
$sDateFormat = getEffectiveSetting("backend", "timeformat", "d.m.Y H:i");
switch ($oJob->get("status"))
{
switch ($oJob->get("status")) {
case 1:
$oForm->add(i18n("Status"), i18n("Pending"));
$oForm->add(i18n("Status", "newsletter"), i18n("Pending", "newsletter"));
break;
case 2:
$oForm->add(i18n("Status"), sprintf(i18n("Sending (started: %s)"),
date($sDateFormat, strtotime($oJob->get("started")))));
$oForm->add(i18n("Status", "newsletter"), sprintf(i18n("Sending (started: %s)", "newsletter"), date($sDateFormat, strtotime($oJob->get("started")))));
break;
case 9:
$oForm->add(i18n("Status"), sprintf(i18n("Finished (started: %s, finished: %s)"),
date($sDateFormat, strtotime($oJob->get("started"))),
date($sDateFormat, strtotime($oJob->get("finished")))));
$oForm->add(i18n("Status", "newsletter"), sprintf(i18n("Finished (started: %s, finished: %s)", "newsletter"), date($sDateFormat, strtotime($oJob->get("started"))), date($sDateFormat, strtotime($oJob->get("finished")))));
break;
}
$oForm->add(i18n("Statistics"), sprintf(i18n("Planned: %s, Send: %s"), $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oForm->add(i18n("From"), $oJob->get("newsfrom") . " (" . $oJob->get("newsfromname") . ")");
$oForm->add(i18n("Subject"), $oJob->get("subject"));
$oForm->add(i18n("Statistics", "newsletter"), sprintf(i18n("Planned: %s, Send: %s", "newsletter"), $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oForm->add(i18n("From", "newsletter"), $oJob->get("newsfrom") . " (" . $oJob->get("newsfromname") . ")");
$oForm->add(i18n("Subject", "newsletter"), $oJob->get("subject"));
if ($oJob->get("type") == "html")
{
$oForm->add(i18n("Type"), i18n("HTML and text"));
if ($oJob->get("type") == "html") {
$oForm->add(i18n("Type", "newsletter"), i18n("HTML and text", "newsletter"));
$txtMessageHTML = new cHTMLTextarea("txtMessageHTML", $oJob->get("message_html"), 80, 20);
$txtMessageHTML->setDisabled("disabled");
$oForm->add(i18n("HTML Message"), $txtMessageHTML->render());
$oForm->add(i18n("HTML Message", "newsletter"), $txtMessageHTML->render());
} else {
$oForm->add(i18n("Type"), i18n("Text only"));
$oForm->add(i18n("Type", "newsletter"), i18n("Text only", "newsletter"));
}
$txtMessageText = new cHTMLTextarea("txtMessageText", $oJob->get("message_text"), 80, 20);
$txtMessageText->setDisabled("disabled");
$oForm->add(i18n("Text Message"), $txtMessageText->render());
$oForm->add(i18n("Text Message", "newsletter"), $txtMessageText->render());
$aSendTo = unserialize($oJob->get("send_to"));
switch ($aSendTo[0])
{
switch ($aSendTo[0]) {
case "all":
$sSendToInfo = i18n("Send newsletter to all recipients");
$sSendToInfo = i18n("Send newsletter to all recipients", "newsletter");
break;
case "default":
$sSendToInfo = i18n("Send newsletter to the members of the default group");
$sSendToInfo = i18n("Send newsletter to the members of the default group", "newsletter");
break;
case "selection":
$sSendToInfo = i18n("Send newsletter to the members of the selected group(s):");
$sSendToInfo = i18n("Send newsletter to the members of the selected group(s):", "newsletter");
unset($aSendTo[0]);
foreach ($aSendTo as $sGroup)
{
foreach ($aSendTo as $sGroup) {
$sSendToInfo .= "<br />" . $sGroup;
}
break;
case "single":
$sSendToInfo = i18n("Send newsletter to single recipient:");
$sSendToInfo = i18n("Send newsletter to single recipient:", "newsletter");
$sSendToInfo .= "<br />" . $aSendTo[1] . " (" . $aSendTo[2] . ")";
break;
default:
}
unset($aSendTo);
$oForm->add(i18n("Recipients"), $sSendToInfo);
$oForm->add(i18n("Recipients", "newsletter"), $sSendToInfo);
if ($oJob->get("use_cronjob") == 1) {
$sOptionsInfo = i18n("Use cronjob: Enabled");
$sOptionsInfo = i18n("Use cronjob: Enabled", "newsletter");
} else {
$sOptionsInfo = i18n("Use cronjob: Not enabled");
$sOptionsInfo = i18n("Use cronjob: Not enabled", "newsletter");
}
if ($oJob->get("dispatch")) {
$sOptionsInfo .= "<br />" . sprintf(i18n("Dispatch: Enabled (block size: %s, delay: %s sec.)"), $oJob->get("dispatch_count"), $oJob->get("dispatch_delay"));
$sOptionsInfo .= "<br />" . sprintf(i18n("Dispatch: Enabled (block size: %s, delay: %s sec.)", "newsletter"), $oJob->get("dispatch_count"), $oJob->get("dispatch_delay"));
} else {
$sOptionsInfo .= "<br />" . i18n("Dispatch: Disabled");
$sOptionsInfo .= "<br />" . i18n("Dispatch: Disabled", "newsletter");
}
$oForm->add(i18n("Options"), $sOptionsInfo);
$oForm->add(i18n("Options", "newsletter"), $sOptionsInfo);
$oForm->add(i18n("Author"), $oJob->get("authorname"));
$oForm->add(i18n("Created"), $oJob->get("created"));
$oForm->add(i18n("Author", "newsletter"), $oJob->get("authorname"));
$oForm->add(i18n("Created", "newsletter"), $oJob->get("created"));
// Just remove the "save changes" message (as it is not possible to remove the image completely in ui_table_form)
$oForm->setActionButton("submit", $cfg['path']['contenido_fullhtml'] . "images/but_ok.gif", "", "s");
@ -394,5 +376,4 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
}
$oPage->render();
?>

Datei anzeigen

@ -50,9 +50,9 @@ $oUser = new cApiUser($auth->auth["uid"]);
// sort: Element can be used to be sorted by
// search: Element can be used to search in
$aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["created"] = array("field" => "created", "caption" => i18n("Created"), "type" => "base,sort");
$aFields["status"] = array("field" => "status", "caption" => i18n("Status"), "type" => "base,sort");
$aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["created"] = array("field" => "created", "caption" => i18n("Created", "newsletter"), "type" => "base,sort");
$aFields["status"] = array("field" => "status", "caption" => i18n("Status", "newsletter"), "type" => "base,sort");
// Not needed, as no sort/search, but keep as memo: $aFields["cronjob"] = array("field" => "use_cronjob", "caption" => i18n("Use cronjob"), "type" => "base");
##################################
@ -158,11 +158,11 @@ $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");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter dispatch job:<br>");
$aMsg["DelTitle"] = i18n("Delete dispatch job", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter dispatch job:<br>", "newsletter");
$aMsg["SendTitle"] = i18n("Run job");
$aMsg["SendDescr"] = i18n("Do you really want to run the following job:<br>");
$aMsg["SendTitle"] = i18n("Run job", "newsletter");
$aMsg["SendDescr"] = i18n("Do you really want to run the following job:<br>", "newsletter");
// 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>';

Datei anzeigen

@ -36,7 +36,7 @@ if (!defined('CON_FRAMEWORK')) {
if (isset($_GET['idnewsjob']) && (int)$_GET['idnewsjob'] > 0)
{
$sCaption = i18n("View");
$sCaption = i18n("View", "newsletter");
$tmp_area = "foo2";
# Set template data
@ -46,7 +46,7 @@ if (isset($_GET['idnewsjob']) && (int)$_GET['idnewsjob'] > 0)
$tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="'.$sess->url("main.php?area=news_jobs&frame=4&idnewsjob=$idnewsjob").'">'.$sCaption.'</a>');
$tpl->next();
$sCaption = i18n("Details");
$sCaption = i18n("Details", "newsletter");
$tmp_area = "foo2";
# Set template data

Datei anzeigen

@ -56,7 +56,7 @@ $sId = 'img_newsletter';
$oTpl->set('s', 'INEWSLETTER', $sId);
if ($perm->have_perm_area_action('news')) {
$sButtonRow = '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.newsletter_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Newsletter").'" title="'.i18n("Newsletter").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_on.gif"/>';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'. i18n("Newsletter", "newsletter").'" title="'.i18n("Newsletter", "newsletter").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_on.gif"/>';
$sButtonRow .= '</a>';
}
@ -65,7 +65,7 @@ $sId = 'img_dispatch';
$oTpl->set('s', 'IDISPATCH', $sId);
if ($perm->have_perm_area_action('news_jobs')) {
$sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.dispatch_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Dispatch").'" title="'.i18n("Dispatch").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_dispatch_on.gif"/>';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Dispatch", "newsletter").'" title="'.i18n("Dispatch", "newsletter").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_dispatch_on.gif"/>';
$sButtonRow .= '</a>';
}
@ -74,7 +74,7 @@ $sId = 'img_recipient';
$oTpl->set('s', 'IRECIPIENTS', $sId);
if ($perm->have_perm_area_action('recipients')) {
$sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.recipients_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipients").'" title="'.i18n("Recipients").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipients_on.gif"/>';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipients", "newsletter").'" title="'.i18n("Recipients", "newsletter").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipients_on.gif"/>';
$sButtonRow .= '</a>';
}
@ -83,7 +83,7 @@ $sId = 'img_recipientgroup';
$oTpl->set('s', 'IRECIPIENTGROUP', $sId);
if ($perm->have_perm_area_action('recipientgroups')) {
$sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(groups_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipient groups").'" title="'.i18n("Recipient groups").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipientgroups_on.gif"/>';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipient groups", "newsletter").'" title="'.i18n("Recipient groups", "newsletter").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipientgroups_on.gif"/>';
$sButtonRow .= '</a>';
}
@ -98,7 +98,7 @@ unset($sButtonRow);
# 1.1 Newsletter: Actions folding row
######################################
$sLink = "actionlink"; // ID for HTML element
$oActionsRow = new cFoldingRow("28cf9b31-e6d7-4657-a9a7-db31478e7a5c",i18n("Actions"), $sLink);
$oActionsRow = new cFoldingRow("28cf9b31-e6d7-4657-a9a7-db31478e7a5c",i18n("Actions", "newsletter"), $sLink);
$oTpl->set('s', 'ACTIONLINK', $sLink);
if ($perm->have_perm_area_action("news", "news_create"))
@ -108,7 +108,7 @@ if ($perm->have_perm_area_action("news", "news_create"))
$oLink = new cHTMLLink;
$oLink->setMultiLink("news", "", "news", "news_create");
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create newsletter"));
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create newsletter", "newsletter"));
$sContent .= $oLink->render() . '</div>'."\n";
$oActionsRow->setContentData($sContent);
@ -120,7 +120,7 @@ if ($perm->have_perm_area_action("news", "news_create"))
# 1.2 Newsletter: Settings folding row
######################################
$sLink = "settingslink";
$oSettingsRow = new cFoldingRow("d64baf0a-aea9-47b3-8490-54a00fce02b5",i18n("Settings"), $sLink);
$oSettingsRow = new cFoldingRow("d64baf0a-aea9-47b3-8490-54a00fce02b5",i18n("Settings", "newsletter"), $sLink);
$oTpl->set('s', 'SETTINGSLINK', $sLink);
// HTML Newsletter: Template and newsletter category
@ -132,9 +132,9 @@ $oSelHTMLTemplateIDCat->setStyle("width: 220px;");
$oSelHTMLNewsletterIDCat = new cHTMLSelectElement("selHTMLNewsletterCat");
$oSelHTMLNewsletterIDCat->setStyle("width: 220px;");
$oOptionTemplate = new cHTMLOptionElement("--".i18n("Please select")."--", 0);
$oOptionTemplate = new cHTMLOptionElement("--".i18n("Please select", "newsletter")."--", 0);
$oSelHTMLTemplateIDCat->addOptionElement(0, $oOptionTemplate);
$oOptionNewsletter = new cHTMLOptionElement("--".i18n("Please select")."--", 0);
$oOptionNewsletter = new cHTMLOptionElement("--".i18n("Please select", "newsletter")."--", 0);
$oSelHTMLNewsletterIDCat->addOptionElement(0, $oOptionNewsletter);
$sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, tblCatTree.level AS level, ";
@ -200,7 +200,7 @@ if (!$perm->have_perm_area_action($area, "news_html_settings"))
$oSelTestDestination = new cHTMLSelectElement("selTestDestination");
$oSelTestDestination->setStyle("width: 220px;");
$oOption = new cHTMLOptionElement(i18n("My mail address"), 0);
$oOption = new cHTMLOptionElement(i18n("My mail address", "newsletter"), 0);
$oSelTestDestination->addOptionElement(0, $oOption);
$oRcpGroups = new RecipientGroupCollection;
@ -237,7 +237,7 @@ if (!$perm->have_perm_area_action($area, "news_send_test"))
}
$oSelTestDestination->setDefault($iTestDestination);
$oBtnSave = new cHTMLButton("submit", i18n("Save"));
$oBtnSave = new cHTMLButton("submit", i18n("Save", "newsletter"));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left:17px; background: '.$cfg['color']['table_dark'].';">'."\n";
$sContent .= ' <form target="left_bottom" onsubmit="append_registered_parameters(this);" id="htmlnewsletter" name="htmlnewsletter" method="get" action="main.php?1">'."\n";
@ -253,16 +253,16 @@ $sContent .= ' <input type="hidden" name="searchin" value="'.$_REQUEST["search
$sContent .= ' <input type="hidden" name="action_html" value="save_newsletter_properties">'."\n";
$sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.$oCkbHTMLNewsletter->toHTML(false).' '.i18n("Enable HTML Newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oCkbHTMLNewsletter->toHTML(false).' '.i18n("Enable HTML Newsletter", "newsletter").'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.i18n("HTML Template Category:").'<br />'.$oSelHTMLTemplateIDCat->render().'</td>'."\n";
$sContent .= ' <td>'.i18n("HTML Template Category:", "newsletter").'<br />'.$oSelHTMLTemplateIDCat->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.i18n("HTML Newsletter Category:").'<br />'.$oSelHTMLNewsletterIDCat->render().'</td>'."\n";
$sContent .= ' <td>'.i18n("HTML Newsletter Category:", "newsletter").'<br />'.$oSelHTMLNewsletterIDCat->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.i18n("Send test destination:").'<br />'.$oSelTestDestination->render().'</td>'."\n";
$sContent .= ' <td>'.i18n("Send test destination:", "newsletter").'<br />'.$oSelTestDestination->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td style="text-align: right;">'.$oBtnSave->render().'</td>'."\n";
@ -282,7 +282,7 @@ if ($iItemsPerPage == 0) {
}
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage);
// Sort By
$oSelSortBy = new cHTMLSelectElement("sortby");
@ -291,19 +291,19 @@ $oSelSortBy->addOptionElement($sKey, $oOption);
$oSelSortBy->setDefault("name");
// Sort Order
$oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending")));
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("ASC");
// Search For
$oTextboxFilter = new cHTMLTextbox("filter", "", 16);
// Search In
$oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--");
$oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption);
$oOption = new cHTMLOptionElement("Name", "name");
$oSelSearchIn->addOptionElement($sKey, $oOption);
$oSelSearchIn->setDefault("name");
// Apply button
$oBtnApply = new cHTMLButton("submit", i18n("Apply"));
$oBtnApply = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$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="newsletter_listoptionsform" name="newsletter_listoptionsform" method="get" action="">'."\n";
@ -312,23 +312,23 @@ $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").'</td>'."\n";
$sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTextboxFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
@ -341,7 +341,7 @@ $sContent .= '</div>'."\n";
// To template
$sLink = "listoption";
$oListOptionsRow = new cFoldingRow("9d0968be-601d-44f8-a666-99d51c9c777d",i18n("List options"), $sLink);
$oListOptionsRow = new cFoldingRow("9d0968be-601d-44f8-a666-99d51c9c777d",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINK', $sLink);
@ -400,10 +400,10 @@ $oTpl->set('s', 'ID_CNEWSLETTER', $sContainerId);
// sort: Element can be used to be sorted by
// search: Element can be used to search in
$aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["created"] = array("field" => "created", "caption" => i18n("Created"), "type" => "base,sort");
$aFields["status"] = array("field" => "status", "caption" => i18n("Status"), "type" => "base,sort");
$aFields["cronjob"] = array("field" => "use_cronjob", "caption" => i18n("Use cronjob"), "type" => "base");
$aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["created"] = array("field" => "created", "caption" => i18n("Created", "newsletter"), "type" => "base,sort");
$aFields["status"] = array("field" => "status", "caption" => i18n("Status", "newsletter"), "type" => "base,sort");
$aFields["cronjob"] = array("field" => "use_cronjob", "caption" => i18n("Use cronjob", "newsletter"), "type" => "base");
######################################
# 2.1 Job dispatch: List options folding row
@ -441,7 +441,7 @@ if ($iItemsPerPage == 0) {
}
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage);
// Sort by
@ -457,7 +457,7 @@ $oSelSortBy->setDefault("created");
// Sort order
$oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending")));
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("DESC");
// Filter
@ -465,7 +465,7 @@ $oTxtFilter = new cHTMLTextbox("filter", "", 16);
//Search in
$oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--");
$oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData)
@ -478,7 +478,7 @@ foreach ($aFields as $sKey => $aData)
}
$oSelSearchIn->setDefault("--all--");
$oBtnApply = new cHTMLButton("submit", i18n("Apply"));
$oBtnApply = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$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="dispatch_listoptionsform" name="dispatch_listoptionsform" method="get" action="">'."\n";
@ -487,27 +487,27 @@ $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("Author").'</td>'."\n";
$sContent .= ' <td>'. i18n("Author", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelAuthor->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Items / page").'</td>'."\n";
$sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
@ -520,7 +520,7 @@ $sContent .= '</div>'."\n";
// To template
$sLink = "listoptiondisp";
$oListOptionsRow = new cFoldingRow("dfa6cc00-0acf-11db-9cd8-0800200c9a66",i18n("List options"), $sLink);
$oListOptionsRow = new cFoldingRow("dfa6cc00-0acf-11db-9cd8-0800200c9a66",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINKDISP', $sLink);
@ -565,10 +565,10 @@ $oTpl->set('s', 'ID_CDISPATCH', $sContainerId);
######################################
// See comment at 2. Job dispatch
$aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail"), "type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated"), "type" => "base");
$aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"),"type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail", "newsletter"),"type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed", "newsletter"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated", "newsletter"), "type" => "base");
######################################
# 3.1 Recipients: Actions folding row
@ -580,7 +580,7 @@ if ($perm->have_perm_area_action("recipients", "recipients_create"))
{
$oLink = new cHTMLLink;
$oLink->setMultiLink("recipients","","recipients","recipients_create");
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create recipient").'</a>');
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create recipient", "newsletter").'</a>');
$sContent .= $oLink->render().'<br />'."\n";
}
@ -590,7 +590,7 @@ if ($perm->have_perm_area_action("recipients", "recipients_create"))
{
$oLink = new cHTMLLink;
$oLink->setMultiLink("recipients", "", "recipients_import", "recipients_import");
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'importieren.gif" align="middle">'.i18n("Import recipients").'</a>');
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'importieren.gif" align="middle">'.i18n("Import recipients", "newsletter").'</a>');
$sContent .= $oLink->render().'<br />'."\n";
}
@ -604,9 +604,9 @@ if ($iTimeframe <= 0) {
if ($perm->have_perm_area_action("recipients", "recipients_delete"))
{
$oLink = new cHTMLLink;
$oLink->setLink('javascript:showPurgeMsg("'.i18n('Purge recipients').'", "'.sprintf(i18n("Do you really want to remove recipients, that have not been confirmed since %s days and over?"), '"+purgetimeframe+"').'")');
$oLink->setLink('javascript:showPurgeMsg("'.i18n('Purge recipients', "newsletter").'", "'.sprintf(i18n("Do you really want to remove recipients, that have not been confirmed since %s days and over?", "newsletter"), '"+purgetimeframe+"').'")');
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'delete.gif" align="middle">'.i18n("Purge recipients").'</a>');
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'delete.gif" align="middle">'.i18n("Purge recipients", "newsletter").'</a>');
$sContent .= $oLink->render();
}
@ -615,7 +615,7 @@ $oTpl->set('s', 'VALUE_PURGETIMEFRAME', $iTimeframe);
// To template
$sLink = "actionrec";
$oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a66", i18n("Actions"), $sLink);
$oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a66", i18n("Actions", "newsletter"), $sLink);
$oListActionsRow->setContentData($sContent);
$oTpl->set('s', 'ACTIONLINKREC', $sLink);
@ -623,7 +623,7 @@ $oTpl->set('s', 'ACTIONLINKREC', $sLink);
# 3.2 Recipients: Settings folding row
######################################
$oTxtTimeframe = new cHTMLTextbox("txtPurgeTimeframe", $iTimeframe, 5);
$oBtnSave = new cHTMLButton("submit", i18n("Save"));
$oBtnSave = new cHTMLButton("submit", i18n("Save", "newsletter"));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n";
$sContent .= '<form target="left_bottom" onsubmit="purgetimeframe = document.options.txtPurgeTimeframe.value; append_registered_parameters(this);" id="options" name="options" method="get" action="main.php?1">'."\n";
@ -638,8 +638,8 @@ $sContent .= ' <input type="hidden" name="filter" value="'.$_REQUEST["filter"]
$sContent .= ' <input type="hidden" name="searchin" value="'.$_REQUEST["searchin"].'">'."\n";
$sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Purge timeframe").':</td>'."\n";
$sContent .= ' <td>'.$oTxtTimeframe->render().'&nbsp;'.i18n("days").'</td>'."\n";
$sContent .= ' <td>'. i18n("Purge timeframe", "newsletter").':</td>'."\n";
$sContent .= ' <td>'.$oTxtTimeframe->render().'&nbsp;'.i18n("days", "newsletter").'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>&nbsp;</td>'."\n";
@ -651,7 +651,7 @@ $sContent .= '</div>'."\n";
// To template
$sLink = "settingsrec";
$oSettingsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a69",i18n("Settings"), $sLink);
$oSettingsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a69",i18n("Settings", "newsletter"), $sLink);
$oSettingsRow->setContentData($sContent);
$oTpl->set('s', 'SETTINGSLINKREC', $sLink);
@ -664,7 +664,7 @@ if ($iItemsPerPage == 0) {
}
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage);
$oSelSortBy = new cHTMLSelectElement("sortby");
@ -678,11 +678,11 @@ foreach ($aFields as $sKey => $aData)
$oSelSortBy->setDefault("name");
$oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending")));
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("ASC");
$oSelRestrictGroup = new cHTMLSelectElement("restrictgroup");
$oOption = new cHTMLOptionElement(i18n("-- All groups --"), "--all--");
$oOption = new cHTMLOptionElement(i18n("-- All groups --", "newsletter"), "--all--");
$oSelRestrictGroup->addOptionElement("all", $oOption);
// Fetch recipient groups
@ -710,7 +710,7 @@ $oSelRestrictGroup->setDefault("--all--");
$oTxtFilter = new cHTMLTextbox("filter", "", 16);
$oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--");
$oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) {
@ -730,27 +730,27 @@ $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").'</td>'."\n";
$sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Show group").'</td>'."\n";
$sContent .= ' <td>'. i18n("Show group", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelRestrictGroup->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
@ -763,7 +763,7 @@ $sContent .= '</div>'."\n";
// To template
$sLink = "listoptionsrec";
$oListOptionsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a66",i18n("List options"), $sLink);
$oListOptionsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a66",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINKREC', $sLink);
@ -812,7 +812,7 @@ $oTpl->set('s', 'ID_CRECIPIENTS', $sContainerId);
######################################
// See comment at 2. Job dispatch
$aFields = array();
$aFields["name"] = array("field" => "groupname", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["name"] = array("field" => "groupname", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
######################################
# 4.1 Recipient groups: Actions
@ -824,14 +824,14 @@ 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").'</a>');
$oLnk->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create group", "newsletter").'</a>');
$sContent .= $oLnk->render().'<br />'."\n";
}
$sContent .= '</div>'."\n";
$sLink = "actiongroup";
$oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a67",i18n("Actions"), $sLink);
$oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a67",i18n("Actions", "newsletter"), $sLink);
$oListActionsRow->setContentData($sContent);
$oTpl->set('s', 'ACTIONLINKGROUP', $sLink);
@ -844,7 +844,7 @@ if ($iItemsPerPage == 0) {
}
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage);
$oSelSortBy = new cHTMLSelectElement("sortby");
@ -857,13 +857,13 @@ foreach ($aFields as $sKey => $aData) {
$oSelSortBy->setDefault("name");
$oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending")));
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("ASC");
$oTxtFilter = new cHTMLTextbox("filter", "", 16);
$oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--");
$oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) {
@ -874,7 +874,7 @@ foreach ($aFields as $sKey => $aData) {
}
$oSelSearchIn->setDefault("--all--");
$oBtnApply = new cHTMLButton("submit", i18n("Apply"));
$oBtnApply = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$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";
@ -883,23 +883,23 @@ $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").'</td>'."\n";
$sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n";
$sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n";
$sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n";
@ -912,7 +912,7 @@ $sContent .= '</div>'."\n";
// To template
$sLink = "listoptionsgroup";
$oListOptionsRow = new cFoldingRow("79efc1fc-111d-11dc-8314-0800200c9a66",i18n("List options"), $sLink);
$oListOptionsRow = new cFoldingRow("79efc1fc-111d-11dc-8314-0800200c9a66",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINKGROUP', $sLink);

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -52,7 +52,7 @@ $lIDCatArt = (int)$oClientLang->getProperty("newsletter", "idcatart");
// sort: Element can be used to be sorted by
// search: Element can be used to search in
$aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
##################################
# Store settings/Get basic data
@ -101,8 +101,7 @@ if ($_REQUEST["sortorder"] != "DESC") {
// Check sort by and search in criteria
$bSortByFound = false;
$bSearchInFound = false;
foreach ($aFields as $sKey => $aData)
{
foreach ($aFields as $sKey => $aData) {
if ($aData["field"] == $_REQUEST["sortby"] && strpos($aData["type"], "sort") !== false) {
$bSortByFound = true;
}
@ -129,12 +128,9 @@ $oNewsletters = new NewsletterCollection;
$oNewsletters->setWhere("idclient", $client);
$oNewsletters->setWhere("idlang", $lang);
if ($_REQUEST["filter"] != "")
{
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "")
{
foreach ($aFields as $sKey => $aData)
{
if ($_REQUEST["filter"] != "") {
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") {
foreach ($aFields as $sKey => $aData) {
if (strpos($aData["type"], "search") !== false) {
$oNewsletters->setWhereGroup("filter", $aData["field"], $_REQUEST["filter"], "LIKE");
}
@ -145,8 +141,7 @@ if ($_REQUEST["filter"] != "")
}
}
if ($_REQUEST["elemperpage"] > 0)
{
if ($_REQUEST["elemperpage"] > 0) {
// Getting item count without limit (for page function) - better idea anyone (performance)?
$oNewsletters->query();
$iItemCount = $oNewsletters->count();
@ -169,17 +164,16 @@ $iMenu = 0;
// Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array();
$aMsg["DelTitle"] = i18n("Delete newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter:<br>");
$aMsg["DelTitle"] = i18n("Delete newsletter", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter:<br>", "newsletter");
$aMsg["SendTestTitle"] = i18n("Send test newsletter");
$aMsg["SendTestTitleOff"] = i18n("Send test newsletter (disabled, check newsletter sender e-mail address and handler article selection)");
$aMsg["AddJobTitle"] = i18n("Add newsletter dispatch job");
$aMsg["AddJobTitleOff"] = i18n("Add newsletter dispatch job (disabled, check newsletter sender e-mail address and handler article selection)");
$aMsg["CopyTitle"] = i18n("Duplicate newsletter");
$aMsg["SendTestTitle"] = i18n("Send test newsletter", "newsletter");
$aMsg["SendTestTitleOff"] = i18n("Send test newsletter (disabled, check newsletter sender e-mail address and handler article selection)", "newsletter");
$aMsg["AddJobTitle"] = i18n("Add newsletter dispatch job", "newsletter");
$aMsg["AddJobTitleOff"] = i18n("Add newsletter dispatch job (disabled, check newsletter sender e-mail address and handler article selection)", "newsletter");
$aMsg["CopyTitle"] = i18n("Duplicate newsletter", "newsletter");
while ($oNewsletter = $oNewsletters->next())
{
while ($oNewsletter = $oNewsletters->next()) {
$idnewsletter = $oNewsletter->get("idnews");
$iMenu++;
@ -198,8 +192,7 @@ while ($oNewsletter = $oNewsletters->next())
if ($perm->have_perm_area_action($area, "news_add_job") ||
$perm->have_perm_area_action($area, "news_create") ||
$perm->have_perm_area_action($area, "news_save"))
{
$perm->have_perm_area_action($area, "news_save")) {
// Rights: If you are able to add a job, you should be able to test it
// If you are able to add or change a newsletter, you should be able to test it
// Usability: If no e-mail has been specified, you can't send a test newsletter
@ -211,10 +204,8 @@ while ($oNewsletter = $oNewsletters->next())
$oMenu->setActions($iMenu, 'test', $sLnkSendTest);
}
if ($perm->have_perm_area_action($area, "news_add_job"))
{
if (isValidMail($oNewsletter->get("newsfrom")) && $lIDCatArt > 0)
{
if ($perm->have_perm_area_action($area, "news_add_job")) {
if (isValidMail($oNewsletter->get("newsfrom")) && $lIDCatArt > 0) {
$oLnkAddJob = new Link;
$oLnkAddJob->setMultiLink("news", "", "news", "news_add_job");
$oLnkAddJob->setCustom("idnewsletter", $idnewsletter);
@ -229,8 +220,7 @@ while ($oNewsletter = $oNewsletters->next())
$oMenu->setActions($iMenu, 'dispatch', $sLnkAddJob);
}
if ($perm->have_perm_area_action($area, "news_create"))
{
if ($perm->have_perm_area_action($area, "news_create")) {
$oLnkCopy = new Link;
$oLnkCopy->setMultiLink("news", "", "news", "news_duplicate");
$oLnkCopy->setCustom("idnewsletter", $idnewsletter);
@ -240,16 +230,14 @@ while ($oNewsletter = $oNewsletters->next())
$oMenu->setActions($iMenu, 'copy', $oLnkCopy->render());
}
if ($perm->have_perm_area_action($area, "news_delete"))
{
if ($perm->have_perm_area_action($area, "news_delete")) {
$sDelete = '<a title="' . $aMsg["DelTitle"] . '" href="javascript://" onclick="showDelMsg(' . $idnewsletter . ',\'' . addslashes($sName) . '\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $aMsg["DelTitle"] . '" alt="' . $aMsg["DelTitle"] . '"></a>';
$oMenu->setActions($iMenu, 'delete', $sDelete);
}
}
// Check destination for sending test newsletter
if ($_REQUEST["selTestDestination"] > 0 && $perm->have_perm_area_action($area, "news_send_test"))
{
if ($_REQUEST["selTestDestination"] > 0 && $perm->have_perm_area_action($area, "news_send_test")) {
$oRcpGroups = new RecipientGroupCollection;
$oRcpGroups->setWhere("idclient", $client);
$oRcpGroups->setWhere("idlang", $lang);
@ -257,12 +245,12 @@ if ($_REQUEST["selTestDestination"] > 0 && $perm->have_perm_area_action($area, "
$oRcpGroups->query();
if ($oRcpGroup = $oRcpGroups->next()) {
$sSendTestTarget = sprintf(i18n("Recipient group: %s"), $oRcpGroup->get("groupname"));
$sSendTestTarget = sprintf(i18n("Recipient group: %s", "newsletter"), $oRcpGroup->get("groupname"));
}
unset($oRcpGroups);
}
$aMsg["SendTestDescr"] = sprintf(i18n("Do you really want to send the newsletter to:<br><strong>%s</strong>"), $sSendTestTarget);
$aMsg["SendTestDescr"] = sprintf(i18n("Do you really want to send the newsletter to:<br><strong>%s</strong>", "newsletter"), $sSendTestTarget);
$sExecScript = '
<script type="text/javascript">
@ -376,5 +364,4 @@ $oPage->addScript('refreshpager', $sRefreshPager);
$oPage->setContent($oMenu->render(false));
$oPage->render();
?>

Datei anzeigen

@ -37,7 +37,7 @@ if (!defined('CON_FRAMEWORK')) {
if (isset($_GET['idnewsletter']))
{
# Set template data
$sCaption = i18n("Edit");
$sCaption = i18n("Edit", "newsletter");
$tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt);
$tpl->set("d", "CLASS", '');
@ -46,7 +46,7 @@ if (isset($_GET['idnewsletter']))
$tpl->next();
# Set template data
$sCaption = i18n("Edit Message");
$sCaption = i18n("Edit Message", "newsletter");
$tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt);
$tpl->set("d", "CLASS", '');

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,15 +29,13 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
if (isset($_GET['idrecipientgroup']) && (int)$_GET['idrecipientgroup'] > 0)
{
$caption = i18n("Overview");
if (isset($_GET['idrecipientgroup']) && (int) $_GET['idrecipientgroup'] > 0) {
$caption = i18n("Overview", "newsletter");
$tmp_area = "foo2";
# Set template data
@ -70,5 +69,4 @@ if (isset($_GET['idrecipientgroup']) && (int)$_GET['idrecipientgroup'] > 0)
} else {
include ($cfg["path"]["contenido"] . $cfg["path"]["templates"] . $cfg["templates"]["right_top_blank"]);
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -40,14 +40,13 @@ $oRGroupMembers = new RecipientGroupMemberCollection;
$oRGroup = new RecipientGroup;
$aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail"), "type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated"), "type" => "base");
$aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail", "newsletter"), "type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed", "newsletter"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated", "newsletter"), "type" => "base");
if ($action == "recipientgroup_create" && $perm->have_perm_area_action($area, $action))
{
$oRGroup = $oRGroups->create(" ".i18n("-- new group --"));
if ($action == "recipientgroup_create" && $perm->have_perm_area_action($area, $action)) {
$oRGroup = $oRGroups->create(" " . i18n("-- new group --", "newsletter"));
$_REQUEST["idrecipientgroup"] = $oRGroup->get("idnewsgroup");
$oPage->setReload();
$sRefreshLeftTopScript = '<script type="text/javascript">top.content.left.left_top.refreshGroupOption(\'' . $_REQUEST["idrecipientgroup"] . '\', \'add\')</script>';
@ -64,17 +63,14 @@ if ($action == "recipientgroup_create" && $perm->have_perm_area_action($area, $a
$oRGroup->loadByPrimaryKey($_REQUEST["idrecipientgroup"]);
}
if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGroup->get("idlang") == $lang)
{
if ($action == "recipientgroup_save_group" && $perm->have_perm_area_action($area, $action))
{
if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGroup->get("idlang") == $lang) {
if ($action == "recipientgroup_save_group" && $perm->have_perm_area_action($area, $action)) {
// Saving changes
$aMessages = array();
$bReload = false;
$sGroupName = stripslashes($_REQUEST["groupname"]);
if ($oRGroup->get("groupname") != $sGroupName)
{
if ($oRGroup->get("groupname") != $sGroupName) {
$oRGroups->resetQuery();
$oRGroups->setWhere("groupname", $sGroupName);
$oRGroups->setWhere("idclient", $client);
@ -83,7 +79,7 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oRGroups->query();
if ($oRGroups->next()) {
$aMessages[] = i18n("Could not set new group name: Group already exists");
$aMessages[] = i18n("Could not set new group name: Group already exists", "newsletter");
} else {
$bReload = true;
@ -91,18 +87,15 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
}
}
if (count($_REQUEST["adduser"]) > 0)
{
foreach ($_REQUEST["adduser"] as $iRcpID)
{
if (count($_REQUEST["adduser"]) > 0) {
foreach ($_REQUEST["adduser"] as $iRcpID) {
if (is_numeric($iRcpID)) {
$oRGroupMembers->create($_REQUEST["idrecipientgroup"], $iRcpID);
}
}
}
if ($oRGroup->get("defaultgroup") != (int)$_REQUEST["defaultgroup"])
{
if ($oRGroup->get("defaultgroup") != (int) $_REQUEST["defaultgroup"]) {
$bReload = true;
$oRGroup->set("defaultgroup", $_REQUEST["defaultgroup"]);
}
@ -115,10 +108,8 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
// Removing users from group (if specified)
//print_r ($_REQUEST["deluser"]);
if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete") && is_array($_REQUEST["deluser"]))
{
foreach ($_REQUEST["deluser"] as $iRcpID)
{
if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete") && is_array($_REQUEST["deluser"])) {
foreach ($_REQUEST["deluser"] as $iRcpID) {
if (is_numeric($iRcpID)) {
echo "yo: " . $iRcpID;
$oRGroupMembers->remove($_REQUEST["idrecipientgroup"], $iRcpID);
@ -181,20 +172,20 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oForm->setVar("idrecipientgroup", $_REQUEST["idrecipientgroup"]);
$oForm->setSubmitJS("append_registered_parameters(this);");
$oForm->addHeader(i18n("Edit group"));
$oForm->addHeader(i18n("Edit group", "newsletter"));
$oTxtGroupName = new cHTMLTextbox("groupname", $oRGroup->get("groupname"), 40);
$oForm->add(i18n("Group name"), $oTxtGroupName->render());
$oForm->add(i18n("Group name", "newsletter"), $oTxtGroupName->render());
$oCkbDefault = new cHTMLCheckbox("defaultgroup", "1");
$oCkbDefault->setChecked($oRGroup->get("defaultgroup"));
$oForm->add(i18n("Default group"), $oCkbDefault->toHTML(false));
$oForm->add(i18n("Default group", "newsletter"), $oCkbDefault->toHTML(false));
// Member list options folding row
$oMemberListOptionRow = new cFoldingRow("a91f5540-52db-11db-b0de-0800200c9a66",i18n("Member list options"));
$oMemberListOptionRow = new cFoldingRow("a91f5540-52db-11db-b0de-0800200c9a66", i18n("Member list options", "newsletter"));
$oSelItemsPerPage = new cHTMLSelectElement("member_elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($_REQUEST["member_elemperpage"]);
$oSelSortBy = new cHTMLSelectElement("member_sortby");
@ -210,13 +201,13 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oSelSortBy->setDefault($_REQUEST["member_sortby"]);
$oSelSortOrder = new cHTMLSelectElement("member_sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending")));
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault($_REQUEST["member_sortorder"]);
$oTxtFilter = new cHTMLTextbox("member_filter", $_REQUEST["member_filter"], 16);
$oSelSearchIn = new cHTMLSelectElement("member_searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--");
$oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) {
@ -227,28 +218,28 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
}
$oSelSearchIn->setDefault($_REQUEST["member_searchin"]);
$oSubmit = new cHTMLButton("submit", i18n("Apply"));
$oSubmit = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$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").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Items / page", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelItemsPerPage->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort by").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Sort by", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelSortBy->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort order").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Sort order", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelSortOrder->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search for").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Search for", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oTxtFilter->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search in").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Search in", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelSearchIn->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
@ -264,9 +255,9 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oAddedRecipientList->setWidth("100%");
$oAddedRecipientList->setBorder(1);
$oAddedRecipientList->setCell(0, 1, "<strong>".i18n("Name")."</strong>");
$oAddedRecipientList->setCell(0, 1, "<strong>" . i18n("Name", "newsletter") . "</strong>");
$oImgDel = new cHTMLImage("images/but_invert_selection.gif");
$sLnkDelIcon = '<a title="'.i18n("Check all").'" href="javascript://" onclick="fncCheckDel(\'deluser[]\');">'.$oImgDel->render().'</a>';
$sLnkDelIcon = '<a title="' . i18n("Check all", "newsletter") . '" href="javascript://" onclick="fncCheckDel(\'deluser[]\');">' . $oImgDel->render() . '</a>';
$oAddedRecipientList->setCell(0, 2, $sLnkDelIcon);
$oAddedRecipientList->setCellAlignment(0, 2, "right");
@ -282,10 +273,8 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oInsiders->query();
$aInsiders = array();
if ($oInsiders->count() > 0)
{
while ($oInsider = $oInsiders->next())
{
if ($oInsiders->count() > 0) {
while ($oInsider = $oInsiders->next()) {
$aInsiders[] = $oInsider->get($oInsider->primaryKey);
}
}
@ -316,8 +305,7 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
// Get data
$sSortSQL = "recipientcollection." . $_REQUEST["member_sortby"] . " " . $_REQUEST["member_sortorder"];
if ($_REQUEST["member_sortby"] == "name")
{
if ($_REQUEST["member_sortby"] == "name") {
// Name field may be empty, add email as sort criteria
$sSortSQL .= ", email " . $_REQUEST["member_sortorder"];
}
@ -327,14 +315,13 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$iItems = $oInsiders->count();
if ($iItems == 0 && $_REQUEST["member_filter"] == "" && ($_REQUEST["member_elemperpage"] == 0 || $iMembers == 0)) {
$oAddedRecipientList->setCell(1, 1, i18n("No recipients are added to this group yet"));
$oAddedRecipientList->setCell(1, 1, i18n("No recipients are added to this group yet", "newsletter"));
$oAddedRecipientList->setCell(1, 2, '&nbsp;');
} else if ($iItems == 0) {
$oAddedRecipientList->setCell(1, 1, i18n("No recipients found"));
$oAddedRecipientList->setCell(1, 1, i18n("No recipients found", "newsletter"));
$oAddedRecipientList->setCell(1, 2, '&nbsp;');
} else {
while ($oRcp = $oInsiders->next())
{
while ($oRcp = $oInsiders->next()) {
$iID = $oRcp->get("idnewsrcp");
$sName = $oRcp->get("name");
@ -344,8 +331,7 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
}
$oAddedRecipientList->setCell($iID, 1, $sName . " (" . $sEMail . ")");
if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete"))
{
if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete")) {
$oCkbDel = new cHTMLCheckbox("deluser[]", $iID);
$oAddedRecipientList->setCell($iID, 2, $oCkbDel->toHTML(false));
} else {
@ -375,9 +361,9 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oPagerLink->setCustom("contenido", $sess->id);
$oMemberPager = new cObjectPager("d82a3ff0-52d9-11db-b0de-0800200c9a66", $iMembers, $_REQUEST["member_elemperpage"], $_REQUEST["member_page"], $oPagerLink, "member_page");
$oMemberPager->setCaption(i18n("Member navigation"));
$oMemberPager->setCaption(i18n("Member navigation", "newsletter"));
$oForm->add(i18n("Recipients in group"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
$oForm->add(i18n("Recipients in group", "newsletter"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">' .
$oMemberListOptionRow->render() .
$oMemberPager->render() .
'<tr><td>' . $oAddedRecipientList->render() . '</td></tr></table>');
@ -388,10 +374,10 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
// Outsiders
// Outsider list options folding row
$oOutsiderListOptionRow = new cFoldingRow("ca633b00-52e9-11db-b0de-0800200c9a66",i18n("Outsider list options"));
$oOutsiderListOptionRow = new cFoldingRow("ca633b00-52e9-11db-b0de-0800200c9a66", i18n("Outsider list options", "newsletter"));
$oSelItemsPerPage = new cHTMLSelectElement("outsider_elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($_REQUEST["outsider_elemperpage"]);
$oSelSortBy = new cHTMLSelectElement("outsider_sortby");
@ -407,13 +393,13 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oSelSortBy->setDefault($_REQUEST["outsider_sortby"]);
$oSelSortOrder = new cHTMLSelectElement("outsider_sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending")));
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$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 --"), "--all--");
$oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) {
@ -424,28 +410,28 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
}
$oSelSearchIn->setDefault($_REQUEST["outsider_searchin"]);
$oSubmit = new cHTMLButton("submit", i18n("Apply"));
$oSubmit = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$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").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Items / page", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelItemsPerPage->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort by").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Sort by", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelSortBy->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort order").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Sort order", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelSortOrder->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search for").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Search for", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oTxtFilter->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search in").'</td>'.chr(10);
$sContent .= ' <td>' . i18n("Search in", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>' . $oSelSearchIn->render() . '</td>' . chr(10);
$sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>' . chr(10);
@ -463,7 +449,6 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
# TODO: Add mySQL server version switch
#$sSQL = "idclient = '".$client."' AND idlang = '".$lang."' AND ".
# "idnewsrcp NOT IN (SELECT idnewsrcp FROM ".$cfg["tab"]["news_groupmembers"]." WHERE idnewsgroup = '".$_REQUEST["idrecipientgroup"]."')";
// TODO: This works with every mySQL version but may be problematic, if a group
// contains a lot of members (e.g. Oracle can't handle more than 1000 items in the brackets)
$sSQL = "idclient = '" . $client . "' AND idlang = '" . $lang . "' AND " .
@ -499,8 +484,7 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
// Get data
$sSQLSort = " ORDER BY " . urlencode($_REQUEST["outsider_sortby"]) . " " . $_REQUEST["outsider_sortorder"];
if ($_REQUEST["outsider_sortby"] == "name")
{
if ($_REQUEST["outsider_sortby"] == "name") {
// Name field may be empty, add email as sort criteria
$sSQLSort .= ", email " . $_REQUEST["outsider_sortorder"];
}
@ -509,8 +493,7 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oOutsiders->flexSelect("", "", $sSQL, "");
$aItems = array();
while ($oRecipient = $oOutsiders->next())
{
while ($oRecipient = $oOutsiders->next()) {
$sName = $oRecipient->get("name");
$sEMail = $oRecipient->get("email");
@ -546,12 +529,12 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oPagerLink->setCustom("contenido", $sess->id);
$oOutsiderPager = new cObjectPager("4d3a7330-52eb-11db-b0de-0800200c9a66", $iOutsiders, $_REQUEST["outsider_elemperpage"], $_REQUEST["outsider_page"], $oPagerLink, "outsider_page");
$oOutsiderPager->setCaption(i18n("Outsider navigation"));
$oOutsiderPager->setCaption(i18n("Outsider navigation", "newsletter"));
$oForm->add(i18n("Add recipients"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
$oForm->add(i18n("Add recipients", "newsletter"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">' .
$oOutsiderListOptionRow->render() .
$oOutsiderPager->render() .
'<tr><td>'.$oSelUser->render().'<br />'.i18n("Note: Hold &lt;Ctrl&gt; to<br>select multiple items.").'</td></tr></table>');
'<tr><td>' . $oSelUser->render() . '<br />' . i18n("Note: Hold &lt;Ctrl&gt; to<br>select multiple items.", "newsletter") . '</td></tr></table>');
unset($oOutsiders);
unset($oOutsiderListOptionRow);
unset($oOutsiderPager);
@ -582,5 +565,4 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oPage->setContent($sNotis . "");
}
$oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -49,7 +49,7 @@ $oUser = new cApiUser($auth->auth["uid"]);
// sort: Element can be used to be sorted by
// search: Element can be used to search in
$aFields = array();
$aFields["name"] = array("field" => "groupname", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["name"] = array("field" => "groupname", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
##################################
# Check external input
@ -90,12 +90,9 @@ $oRcpGroups = new RecipientGroupCollection;
$oRcpGroups->setWhere("idclient", $client);
$oRcpGroups->setWhere("idlang", $lang);
if ($_REQUEST["filter"] != "")
{
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "")
{
foreach ($aFields as $sKey => $aData)
{
if ($_REQUEST["filter"] != "") {
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") {
foreach ($aFields as $sKey => $aData) {
if (strpos($aData["type"], "search") !== false) {
$oRcpGroups->setWhereGroup("filter", $aData["field"], $_REQUEST["filter"], "LIKE");
}
@ -106,8 +103,7 @@ if ($_REQUEST["filter"] != "")
}
}
if ($_REQUEST["elemperpage"] > 0)
{
if ($_REQUEST["elemperpage"] > 0) {
// Getting item count without limit (for page function) - better idea anyone (performance)?
$oRcpGroups->query();
$iItemCount = $oRcpGroups->count();
@ -130,11 +126,10 @@ $iMenu = 0;
// Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array();
$aMsg["DelTitle"] = i18n("Delete recipient group");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter recipient group:<br>");
$aMsg["DelTitle"] = i18n("Delete recipient group", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter recipient group:<br>", "newsletter");
while ($oRcpGroup = $oRcpGroups->next())
{
while ($oRcpGroup = $oRcpGroups->next()) {
$iMenu++;
$iIDGroup = $oRcpGroup->get("idnewsgroup");
@ -236,5 +231,4 @@ $oPage->addScript('refreshpager', $sRefreshPager);
//$oPage->setContent(array('<table border="0" cellspacing="0" cellpadding="0" width="100%">', '</table>', $oMenu->render(false)));
$oPage->setContent($oMenu->render(false));
$oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -44,7 +44,7 @@ if (is_array($cfg['plugins']['recipients'])) {
// Note, that the object name has to be $recipient for plugins
if ($action == "recipients_create" && $perm->have_perm_area_action($area, $action)) {
$recipient = $oRecipients->create("mail@domain.tld"," ".i18n("-- new recipient --"));
$recipient = $oRecipients->create("mail@domain.tld", " " . i18n("-- new recipient --", "newsletter"));
$oPage->setReload();
} elseif ($action == "recipients_delete" && $perm->have_perm_area_action($area, $action)) {
$oRecipients->delete($idrecipient);
@ -59,9 +59,9 @@ if ($action == "recipients_create" && $perm->have_perm_area_action($area, $actio
$purgedrecipients = $oRecipients->purge($timeframe);
/* backslashdollar: There is a problem translating \$ - it is either not recognized or translated correctly (using poEdit) */
if ($purgedrecipients > 0) {
$sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("%1backslashdollard recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.")),$purgedrecipients,$timeframe),0);
$sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("%1backslashdollard recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.", "newsletter")), $purgedrecipients, $timeframe), 0);
} else {
$sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("There are no recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.")), 0, $timeframe),0);
$sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("There are no recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.", "newsletter")), 0, $timeframe), 0);
}
$recipient = new Recipient;
@ -83,9 +83,8 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$recipient->set("name", $name);
if (!isValidMail($email))
{
$aMessages[] = i18n("Please specify a valid e-mail address");
if (!isValidMail($email)) {
$aMessages[] = i18n("Please specify a valid e-mail address", "newsletter");
} else {
$email = strtolower($email); // e-mail always in lower case
if ($recipient->get("email") != $email) {
@ -97,7 +96,7 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oRecipients->query();
if ($oRecipients->next()) {
$aMessages[] = i18n("Could not set new e-mail adress: Other recipient with same e-mail address already exists");
$aMessages[] = i18n("Could not set new e-mail adress: Other recipient with same e-mail address already exists", "newsletter");
} else {
$recipient->set("email", $email);
}
@ -155,7 +154,7 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oForm->setVar("action", "recipients_save");
$oForm->setVar("idrecipient", $recipient->get("idnewsrcp"));
$oForm->addHeader(i18n("Edit recipient"));
$oForm->addHeader(i18n("Edit recipient", "newsletter"));
$oTxtName = new cHTMLTextbox("name", $recipient->get("name"), 40);
$oTxtEMail = new cHTMLTextbox("email", $recipient->get("email"), 40);
@ -165,17 +164,17 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oCkbDeactivated->setChecked($recipient->get("deactivated"));
$oSelNewsType = new cHTMLSelectElement("newstype");
$oOption = new cHTMLOptionElement(i18n("Text only"), "0");
$oOption = new cHTMLOptionElement(i18n("Text only", "newsletter"), "0");
$oSelNewsType->addOptionElement(0, $oOption);
$oOption = new cHTMLOptionElement(i18n("HTML and text"), "1");
$oOption = new cHTMLOptionElement(i18n("HTML and text", "newsletter"), "1");
$oSelNewsType->addOptionElement(1, $oOption);
$oSelNewsType->setDefault($recipient->get("news_type"));
$oForm->add(i18n("Name"), $oTxtName->render());
$oForm->add(i18n("E-Mail"), $oTxtEMail->render());
$oForm->add(i18n("Confirmed"), $oCkbConfirmed->toHTML(false) . " (" . $recipient->get("confirmeddate") . ")");
$oForm->add(i18n("Deactivated"), $oCkbDeactivated->toHTML(false));
$oForm->add(i18n("Message type"), $oSelNewsType->render());
$oForm->add(i18n("Name", "newsletter"), $oTxtName->render());
$oForm->add(i18n("E-Mail", "newsletter"), $oTxtEMail->render());
$oForm->add(i18n("Confirmed", "newsletter"), $oCkbConfirmed->toHTML(false) . " (" . $recipient->get("confirmeddate") . ")");
$oForm->add(i18n("Deactivated", "newsletter"), $oCkbDeactivated->toHTML(false));
$oForm->add(i18n("Message type", "newsletter"), $oSelNewsType->render());
$aPluginOrder = trim_array(explode(",", getSystemProperty("plugin", "recipients-pluginorder")));
@ -193,7 +192,7 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
}
} else {
if (is_array($aPluginTitle) || is_array($aPluginDisplay)) {
$oForm->add(i18n("WARNING"), sprintf(i18n("The plugin %s delivered an array for the displayed titles, but did not return an array for the contents."), $sPlugin));
$oForm->add(i18n("WARNING", "newsletter"), sprintf(i18n("The plugin %s delivered an array for the displayed titles, but did not return an array for the contents.", "newsletter"), $sPlugin));
} else {
$oForm->add($aPluginTitle, $aPluginDisplay);
}
@ -212,19 +211,17 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oAssocGroups->setOrder("recipientgroupcollection.groupname");
$oAssocGroups->query();
if ($oAssocGroups->count() == 0)
{
$oGroupList->setCell(0, 1, i18n("Recipient is not member of any group"));
if ($oAssocGroups->count() == 0) {
$oGroupList->setCell(0, 1, i18n("Recipient is not member of any group", "newsletter"));
} else {
// Headline
$oGroupList->setCell(0, 1, "<strong>".i18n("Groupname")."</strong>");
$oGroupList->setCell(0, 1, "<strong>" . i18n("Groupname", "newsletter") . "</strong>");
$oImgDel = new cHTMLImage("images/delete.gif");
$oGroupList->setCell(0, 2, $oImgDel->render());
$oGroupList->setCellAlignment(0, 2, "right");
// Data
while ($oAssocGroup = $oAssocGroups->next())
{
while ($oAssocGroup = $oAssocGroups->next()) {
$oGroup = $oAssocGroups->fetchObject("RecipientGroupCollection");
$oCkbRemove = new cHTMLCheckbox("ckbRemove[]", $oAssocGroup->get("idnewsgroupmember"));
@ -235,10 +232,10 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
}
}
$oForm->add(i18n("Associated Groups"), $oGroupList->render());
$oForm->add(i18n("Associated Groups", "newsletter"), $oGroupList->render());
$oForm->add(i18n("Author"), $classuser->getUserName($recipient->get("author")) . " (". $recipient->get("created").")" );
$oForm->add(i18n("Last modified by"), $classuser->getUserName($recipient->get("modifiedby")). " (". $recipient->get("lastmodified").")" );
$oForm->add(i18n("Author", "newsletter"), $classuser->getUserName($recipient->get("author")) . " (" . $recipient->get("created") . ")");
$oForm->add(i18n("Last modified by", "newsletter"), $classuser->getUserName($recipient->get("modifiedby")) . " (" . $recipient->get("lastmodified") . ")");
$oPage->setContent($sNotis . $oForm->render(true));
} else {
@ -246,5 +243,4 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
}
$oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -49,37 +49,37 @@ if ($_REQUEST["selDelimiter"] == "") {
$aFields = array();
$aFieldDetails = array();
$aFields["name"] = strtolower(i18n("Name"));
$aFields["name"] = strtolower(i18n("Name", "newsletter"));
$aFieldDetails["name"]["fieldtype"] = "field"; // field, plugin or group
$aFieldDetails["name"]["mandatory"] = false; // true or false
$aFieldDetails["name"]["type"] = "string"; // string, boolean or date
$aFieldDetails["name"]["link"] = false; // plugin name for plugins, recipient group id for groups
$aFieldDetails["name"]["col"] = -1; // Stores column index where this field has been found
$aFields["email"] = strtolower(i18n("Mail"));
$aFields["email"] = strtolower(i18n("Mail", "newsletter"));
$aFieldDetails["email"]["fieldtype"] = "field";
$aFieldDetails["email"]["mandatory"] = true;
$aFieldDetails["email"]["type"] = "string";
$aFieldDetails["email"]["link"] = false;
$aFieldDetails["email"]["col"] = -1;
$aFields["deactivated"] = strtolower(i18n("Deactivated"));
$aFields["deactivated"] = strtolower(i18n("Deactivated", "newsletter"));
$aFieldDetails["deactivated"]["fieldtype"] = "field";
$aFieldDetails["deactivated"]["mandatory"] = false;
$aFieldDetails["deactivated"]["type"] = "boolean";
$aFieldDetails["deactivated"]["link"] = false;
$aFieldDetails["deactivated"]["col"] = -1;
$aFields["confirmed"] = strtolower(i18n("Confirmed"));
$aFields["confirmed"] = strtolower(i18n("Confirmed", "newsletter"));
$aFieldDetails["confirmed"]["fieldtype"] = "field";
$aFieldDetails["confirmed"]["mandatory"] = false;
$aFieldDetails["confirmed"]["type"] = "boolean";
$aFieldDetails["confirmed"]["link"] = false;
$aFieldDetails["confirmed"]["col"] = -1;
$aFields["confirmeddate"] = strtolower(i18n("Confirmed Date"));
$aFields["confirmeddate"] = strtolower(i18n("Confirmed Date", "newsletter"));
$aFieldDetails["confirmeddate"]["fieldtype"] = "field";
$aFieldDetails["confirmeddate"]["mandatory"] = false;
$aFieldDetails["confirmeddate"]["type"] = "date";
$aFieldDetails["confirmeddate"]["link"] = false;
$aFieldDetails["confirmeddate"]["col"] = -1;
$aFields["news_type"] = strtolower(i18n("Message type"));
$aFields["news_type"] = strtolower(i18n("Message type", "newsletter"));
$aFieldDetails["news_type"]["fieldtype"] = "field";
$aFieldDetails["news_type"]["mandatory"] = false;
$aFieldDetails["news_type"]["type"] = "boolean";
@ -87,16 +87,12 @@ $aFieldDetails["news_type"]["link"] = false;
$aFieldDetails["news_type"]["col"] = -1;
// Check out if there are any plugins
if (is_array($cfg['plugins']['recipients']))
{
foreach ($cfg['plugins']['recipients'] as $sPlugin)
{
if (function_exists("recipients_".$sPlugin."_wantedVariables") && function_exists("recipients_".$sPlugin."_canonicalVariables"))
{
if (is_array($cfg['plugins']['recipients'])) {
foreach ($cfg['plugins']['recipients'] as $sPlugin) {
if (function_exists("recipients_" . $sPlugin . "_wantedVariables") && function_exists("recipients_" . $sPlugin . "_canonicalVariables")) {
$aPluginTitles = call_user_func("recipients_" . $sPlugin . "_canonicalVariables");
$aPluginFields = call_user_func("recipients_" . $sPlugin . "_wantedVariables");
foreach ($aPluginFields as $sField)
{
foreach ($aPluginFields as $sField) {
//if ($_REQUEST["ckb".$sField]) {
$aFields[$sField] = strtolower(str_replace(" ", "", $aPluginTitles[$sField]));
$aFieldDetails[$sField]["fieldtype"] = "plugin";
@ -117,8 +113,7 @@ $oRcpGroups->setWhere("idlang", $lang);
$oRcpGroups->setOrder("groupname");
$oRcpGroups->query();
while ($oRcpGroup = $oRcpGroups->next())
{
while ($oRcpGroup = $oRcpGroups->next()) {
$sField = "g" . $oRcpGroup->get($oRcpGroup->primaryKey);
$sGroupName = $oRcpGroup->get("groupname");
@ -132,7 +127,7 @@ while ($oRcpGroup = $oRcpGroups->next())
// Only PHP5!
//$sGroupName = str_replace(str_split(" \t\n\r\0\x0B;"), "", $oRcpGroup->get("groupname"));
$aFields[$sField] = strtolower(clHtmlEntities(trim(i18n("Group") . "_" . $sGroupName)));
$aFields[$sField] = strtolower(clHtmlEntities(trim(i18n("Group", "newsletter") . "_" . $sGroupName)));
$aFieldDetails[$sField]["fieldtype"] = "group";
$aFieldDetails[$sField]["mandatory"] = false;
$aFieldDetails[$sField]["type"] = "string";
@ -144,8 +139,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
$_REQUEST["txtData"] = trim(stripslashes($_REQUEST["txtData"]));
if ($_REQUEST["txtData"]) {
switch ($_REQUEST["selDelimiter"])
{
switch ($_REQUEST["selDelimiter"]) {
case "semicolon":
$sDelimiter = ";";
break;
@ -177,7 +171,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
foreach ($aParts as $sHeader) {
$sKey = array_search(strtolower(clHtmlEntities(trim($sHeader))), $aFields);
if ($sKey === false) {
$aMessage[] = sprintf(i18n("Given column header '%s' unknown, column ignored"), $sHeader);
$aMessage[] = sprintf(i18n("Given column header '%s' unknown, column ignored", "newsletter"), $sHeader);
} else {
$aFieldDetails[$sKey]["col"] = $iCol;
$iCol++;
@ -185,7 +179,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
}
foreach ($aFieldDetails as $sKey => $aDetails) {
if ($aDetails["mandatory"] && $aDetails["col"] == -1) {
$aMessage[] = sprintf(i18n("Mandatory column '%s' wasn't found, import stopped"), $aDetails[$sKey]);
$aMessage[] = sprintf(i18n("Mandatory column '%s' wasn't found, import stopped", "newsletter"), $aDetails[$sKey]);
$bStop = true;
}
}
@ -205,47 +199,41 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
$sName = $sEMail;
}
if ($sEMail == "") {
$aMessage[] = sprintf(i18n("Item with empty mail address found, item ignored (name: %s, row: %s)"), $sName, $iRow);
$aMessage[] = sprintf(i18n("Item with empty mail address found, item ignored (name: %s, row: %s)", "newsletter"), $sName, $iRow);
$aInvalidLines[] = $sLine;
$iInvalid++;
} else if (!isValidMail($sEMail)) {
$aMessage[] = sprintf(i18n("Mail address '%s' is invalid, item ignored (row: %s)"), $sEMail, $iRow);
$aMessage[] = sprintf(i18n("Mail address '%s' is invalid, item ignored (row: %s)", "newsletter"), $sEMail, $iRow);
$aInvalidLines[] = $sLine;
$iInvalid++;
} else if ($oRecipients->emailExists($sEMail)) {
$aMessage[] = sprintf(i18n("Recipient with mail address '%s' already exists, item skipped (row: %s)"), $sEMail, $iRow);
$aMessage[] = sprintf(i18n("Recipient with mail address '%s' already exists, item skipped (row: %s)", "newsletter"), $sEMail, $iRow);
$aInvalidLines[] = $sLine;
$iDublettes++;
} else {
unset($sLine);
// Must be $recipient for plugins
if ($recipient = $oRecipients->create($sEMail, $sName))
{
if ($recipient = $oRecipients->create($sEMail, $sName)) {
$iID = $recipient->get($recipient->primaryKey);
$iAdded++;
unset($aPluginValue);
$aPluginValue = array();
foreach ($aFieldDetails as $sKey => $aDetails)
{
if ($aDetails["col"] > -1)
{
switch ($aDetails["fieldtype"])
{
foreach ($aFieldDetails as $sKey => $aDetails) {
if ($aDetails["col"] > -1) {
switch ($aDetails["fieldtype"]) {
case "field":
switch ($aDetails["type"])
{
switch ($aDetails["type"]) {
case "boolean":
$sValue = strtolower(trim($aParts[$aDetails["col"]]));
// html is only treated as "true", to get html messages for recipients
// - quick and dirty...
if ($sValue == "yes" || $sValue == i18n("yes") || $sValue == "true" ||
if ($sValue == "yes" || $sValue == i18n("yes", "newsletter") || $sValue == "true" ||
(is_numeric($sValue) && $sValue > 0) ||
$sValue == "html")
{
$sValue == "html") {
$recipient->set($sKey, 1);
if ($sKey == "confirmed") {
@ -271,7 +259,6 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
case "plugin":
// type may be mentioned here, also, but as plugins currently can't
// specify the type, just treat everything as string
// There may be plugins which store more than one value per plugin_store-
// function. As the plugin_store parameter is an array of values, collect
// all values in an array for later storing... unfortunately, that means,
@ -282,9 +269,8 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
// Add recipient to group
$sValue = strtolower(trim($aParts[$aDetails["col"]]));
if ($sValue == "yes" || $sValue == i18n("yes") ||
$sValue == "true" || (is_numeric($sValue) && $sValue > 0))
{
if ($sValue == "yes" || $sValue == i18n("yes", "newsletter") ||
$sValue == "true" || (is_numeric($sValue) && $sValue > 0)) {
$oGroupMembers->create($aDetails["link"], $iID);
}
break;
@ -297,12 +283,10 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
// Store plugin data (to store plugin data, only, where the column has been found in the data
// should be faster than going through all plugins and store mostly empty arrays)
$sCurrentPlugin = "";
foreach ($aFieldDetails as $sKey => $aDetails)
{
foreach ($aFieldDetails as $sKey => $aDetails) {
if ($aDetails["col"] > -1 &&
$aDetails["fieldtype"] == "plugin" &&
$aDetails["link"] !== $sCurrentPlugin)
{
$aDetails["link"] !== $sCurrentPlugin) {
$sCurrentPlugin = $aDetails["link"];
call_user_func("recipients_" . $sCurrentPlugin . "_store", $aPluginValue[$sCurrentPlugin]);
@ -318,7 +302,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
if (count($aMessage) > 0) {
$sMessage = $notification->returnNotification("warning", implode("<br />", $aMessage)) . "<br />";
}
$sMessage .= $notification->returnNotification("info", sprintf(i18n("%d recipients added, %d recipients skipped (email already exists) and %d invalid recipients/e-mail adresses ignored. Invalid recipients are shown (if any)."), $iAdded, $iDublettes, $iInvalid));
$sMessage .= $notification->returnNotification("info", sprintf(i18n("%d recipients added, %d recipients skipped (email already exists) and %d invalid recipients/e-mail adresses ignored. Invalid recipients are shown (if any).", "newsletter"), $iAdded, $iDublettes, $iInvalid));
if ($iAdded > 0) {
$oPage->setReload();
}
@ -330,30 +314,30 @@ $oForm->setVar("frame", $frame);
$oForm->setVar("area", $area);
$oForm->setVar("action", "recipients_import_exec");
$oForm->addHeader(i18n("Import recipients"));
$oForm->addHeader(i18n("Import recipients", "newsletter"));
$oSelDelimiter = new cHTMLSelectElement("selDelimiter");
$aItems = array();
$aItems[] = array("tab", i18n("Tab"));
$aItems[] = array("semicolon", i18n("Semicolon"));
$aItems[] = array("tab", i18n("Tab", "newsletter"));
$aItems[] = array("semicolon", i18n("Semicolon", "newsletter"));
$oSelDelimiter->autoFill($aItems);
$oSelDelimiter->setDefault($_REQUEST["selDelimiter"]);
$oForm->add(i18n("Delimiter"), $oSelDelimiter->render());
$oForm->add(i18n("Delimiter", "newsletter"), $oSelDelimiter->render());
$oAreaData = new cHTMLTextarea("txtData", $_REQUEST["txtData"], 80, 20);
$sInfo = '<a href="javascript:fncShowHide(\'idInfoText\');"><strong>'.i18n("Import information").'</strong></a>'.
$sInfo = '<a href="javascript:fncShowHide(\'idInfoText\');"><strong>' . i18n("Import information", "newsletter") . '</strong></a>' .
'<div id="idInfoText" style="display: none">' .
'<br /><br /><strong>'.i18n("Specify colum types:").'</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;...").
'<br /><br /><strong>'.i18n("Data structure:").'</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.").
'<br /><br /><strong>'.i18n("Example:").'</strong>'.
i18n("<br />name;mail;confirmed<br />Smith;jon.smith@example.org;1").
'<br /><br /><strong>'.i18n("The following column names will be recognized:").'</strong><br />'.
'<br /><br /><strong>' . i18n("Specify colum types:", "newsletter") . '</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;...", "newsletter") .
'<br /><br /><strong>' . i18n("Data structure:", "newsletter") . '</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.", "newsletter") .
'<br /><br /><strong>' . i18n("Example:", "newsletter") . '</strong>' .
i18n("<br />name;mail;confirmed<br />Smith;jon.smith@example.org;1", "newsletter") .
'<br /><br /><strong>' . i18n("The following column names will be recognized:", "newsletter") . '</strong><br />' .
implode("<br />\n", $aFields);
$oForm->add(i18n("Recipients"), $oAreaData->render()."<br />".$sInfo);
$oForm->add(i18n("Recipients", "newsletter"), $oAreaData->render() . "<br />" . $sInfo);
unset($sInfo);
$sExecScript = '
@ -373,5 +357,4 @@ $sExecScript = '
$oPage->addScript('execscript', $sExecScript);
$oPage->setContent($sMessage . $oForm->render(true));
$oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -41,7 +41,6 @@ $oMenu = new UI_Menu;
$oClient = new cApiClient($client);
$oUser = new cApiUser($auth->auth["uid"]);
//$sLocation = $sess->url("main.php?area=$area&frame=$frame");
// Specify fields for search, sort and validation. Design makes enhancements
// using plugins possible (currently not implemented). If you are changing things here,
// remember to update include.newsletter_left_top.php, also.
@ -51,10 +50,10 @@ $oUser = new cApiUser($auth->auth["uid"]);
// sort: Element can be used to be sorted by
// search: Element can be used to search in
$aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail"), "type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated"), "type" => "base");
$aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail", "newsletter"), "type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed", "newsletter"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated", "newsletter"), "type" => "base");
##################################
# Store settings
@ -62,9 +61,7 @@ $aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Dea
//Update purgetimeframe if submitted
//$sRefreshTop = '';
$iTimeframe = $oClient->getProperty("newsletter", "purgetimeframe");
if (isset($_REQUEST["txtPurgeTimeframe"]) && $_REQUEST["txtPurgeTimeframe"] > 0
&& $_REQUEST["txtPurgeTimeframe"] != $iTimeframe && $perm->have_perm_area_action($area, "recipients_delete"))
{
if (isset($_REQUEST["txtPurgeTimeframe"]) && $_REQUEST["txtPurgeTimeframe"] > 0 && $_REQUEST["txtPurgeTimeframe"] != $iTimeframe && $perm->have_perm_area_action($area, "recipients_delete")) {
$oClient->setProperty("newsletter", "purgetimeframe", $_REQUEST["txtPurgeTimeframe"]);
//$sRefreshTop = '<script language="JavaScript">parent.left_top.purgetimeframe = '.$_REQUEST["txtPurgeTimeframe"].'</script>';
}
@ -101,8 +98,7 @@ if ($_REQUEST["sortorder"] != "DESC") {
// Check sort by and search in criteria
$bSortByFound = false;
$bSearchInFound = false;
foreach ($aFields as $sKey => $aData)
{
foreach ($aFields as $sKey => $aData) {
if ($aData["field"] == $_REQUEST["sortby"] && strpos($aData["type"], "sort") !== false) {
$bSortByFound = true;
}
@ -129,10 +125,9 @@ $oRecipients = new RecipientCollection;
// Updating keys, if activated; all recipients of all clients!
$sMsg = "";
if (getSystemProperty("newsletter", "updatekeys"))
{
if (getSystemProperty("newsletter", "updatekeys")) {
$iUpdatedRecipients = $oRecipients->updateKeys();
$sMsg = $notification->returnNotification("info", sprintf(i18n("%d recipients, with no or incompatible key has been updated. Deactivate update function."), $iUpdatedRecipients));
$sMsg = $notification->returnNotification("info", sprintf(i18n("%d recipients, with no or incompatible key has been updated. Deactivate update function.", "newsletter"), $iUpdatedRecipients));
}
$oRecipients->setWhere("recipientcollection.idclient", $client);
@ -142,18 +137,14 @@ $oRecipients->setWhere("recipientcollection.idlang", $lang);
$oRecipients->setOrder("recipientcollection." . $_REQUEST["sortby"] . " " . $_REQUEST["sortorder"]);
// Show group
if ($_REQUEST["restrictgroup"] != "--all--")
{
if ($_REQUEST["restrictgroup"] != "--all--") {
$oRecipients->link("RecipientGroupMemberCollection");
$oRecipients->setWhere("RecipientGroupMemberCollection.idnewsgroup", $_REQUEST["restrictgroup"]);
}
// Search for
if ($_REQUEST["filter"] != "")
{
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "")
{
foreach ($aFields as $sKey => $aData)
{
if ($_REQUEST["filter"] != "") {
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") {
foreach ($aFields as $sKey => $aData) {
if (strpos($aData["type"], "search") !== false) {
$oRecipients->setWhereGroup("filter", "recipientcollection." . $aData["field"], $_REQUEST["filter"], "LIKE");
}
@ -165,8 +156,7 @@ if ($_REQUEST["filter"] != "")
}
// Items / page
if ($_REQUEST["elemperpage"] > 0)
{
if ($_REQUEST["elemperpage"] > 0) {
// Getting item count without limit (for page function) - better idea anyone (performance)?
$oRecipients->query();
$iItemCount = $oRecipients->count();
@ -188,11 +178,10 @@ $iMenu = 0;
// Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array();
$aMsg["DelTitle"] = i18n("Delete recipient");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following recipient:<br>");
$aMsg["DelTitle"] = i18n("Delete recipient", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following recipient:<br>", "newsletter");
while ($oRecipient = $oRecipients->next())
{
while ($oRecipient = $oRecipients->next()) {
$iMenu++;
$idnewsrcp = $oRecipient->get("idnewsrcp");
@ -255,7 +244,6 @@ $oPage->addScript('exec', $sExecScript);
//$oPage->addScript('cfoldingrow.js', '<script language="JavaScript" src="scripts/cfoldingrow.js"></script>');
$oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>');
//$oPage->addScript('refreshTop', $sRefreshTop);
//generate current content for Object Pager<65>
$sPagerId = '0ed6d632-6adf-4f09-a0c6-1e38ab60e304';
$oPagerLink = new cHTMLLink;
@ -297,5 +285,4 @@ $oPage->addScript('refreshpager', $sRefreshPager);
//$oPage->setContent(array('<table border="0" cellspacing="0" cellpadding="0" width="100%">', '</table>', $sMsg . $oMenu->render(false)));
$oPage->setContent($sMsg . $oMenu->render(false));
$oPage->render();
?>

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,21 @@
./includes/include.newsletter_jobs_menu.php
./includes/include.newsletter_edit.php
./includes/include.recipients_menu.php
./includes/include.newsletter_left_top.php
./includes/include.newsletter_subnav.php
./includes/config.autoloader.php
./includes/include.newsletter_jobs_details.php
./includes/include.recipients.group_menu.php
./includes/include.recipients.group.subnav.php
./includes/include.newsletter_jobs_subnav.php
./includes/include.recipients.group_edit.php
./includes/include.newsletter_menu.php
./includes/include.recipients_edit.php
./includes/include.newsletter_edit_message.php
./includes/include.recipients_import.php
./includes/config.plugin.php
./classes/class.newsletter.php
./classes/class.newsletter.groups.php
./classes/class.newsletter.recipients.php
./classes/class.newsletter.logs.php
./classes/class.newsletter.jobs.php