cl_nl: recodings for new pluginmanager
Dieser Commit ist enthalten in:
Ursprung
3490184008
Commit
3bf883e336
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<plugin>
|
||||
<general active="1">
|
||||
<plugin_name>ConLite Newsletter</plugin_name>
|
||||
<plugin_foldername>cl_newsletter</plugin_foldername>
|
||||
<uuid>45D7F1F3-41E9-57BC-8987-C0550B3B07B8</uuid>
|
||||
<description>ConLite Newsletter System</description>
|
||||
<author>ConLite Team</author>
|
||||
<copyright>ConLite Team</copyright>
|
||||
<mail>cl_newsletter@conlite.org</mail>
|
||||
<website>https://conlite.org</website>
|
||||
<version>1.0.0</version>
|
||||
</general>
|
||||
<requirements php="5.6">
|
||||
<conlite minversion="2.1.0" />
|
||||
</requirements>
|
||||
<conlite>
|
||||
<areas>
|
||||
<area menuless="0">news</area>
|
||||
<area parent="news" menuless="0">news_edit</area>
|
||||
<area parent="news" menuless="0">news_edittpl</area>
|
||||
<area parent="news" menuless="0">news_editcontent</area>
|
||||
<area parent="news" menuless="0">news_jobs</area>
|
||||
<area menuless="0">recipients</area>
|
||||
<area parent="recipients" menuless="0">recipients_import</area>
|
||||
<area menuless="0">recipientgroups</area>
|
||||
</areas>
|
||||
<actions>
|
||||
<action area="news">news_save</action>
|
||||
<action area="news">news_create</action>
|
||||
<action area="news">news_delete</action>
|
||||
<action area="news">news_duplicate</action>
|
||||
<action area="news">news_add_job</action>
|
||||
<action area="news">news_send_test</action>
|
||||
<action area="news_jobs">news_job_delete</action>
|
||||
<action area="news_jobs">news_job_details</action>
|
||||
<action area="news_jobs">news_job_detail_delete</action>
|
||||
<action area="news">news_html_settings</action>
|
||||
<action area="news_jobs">news_job_run</action>
|
||||
<action area="recipients">recipients_save</action>
|
||||
<action area="recipients">recipients_create</action>
|
||||
<action area="recipients">recipients_delete</action>
|
||||
<action area="recipientgroups">recipientgroup_delete</action>
|
||||
<action area="recipientgroups">recipientgroup_create</action>
|
||||
<action area="recipientgroups">recipientgroup_recipient_delete</action>
|
||||
<action area="recipientgroups">recipientgroup_save_group</action>
|
||||
<action area="recipients">recipients_purge</action>
|
||||
<action area="recipients_import">recipients_import</action>
|
||||
<action area="recipients_import">recipients_import_exec</action>
|
||||
</actions>
|
||||
<frames>
|
||||
<frame area="news" filetype="main" name="cl_newsletter/includes/include.newsletter_edit.php" frameId="4" />
|
||||
<frame area="news" filetype="main" name="cl_newsletter/includes/include.newsletter_left_top.php" frameId="1" />
|
||||
<frame area="news" filetype="main" name="cl_newsletter/includes/include.newsletter_menu.php" frameId="2" />
|
||||
<frame area="news" filetype="main" name="cl_newsletter/includes/include.newsletter_subnav.php" frameId="3" />
|
||||
<frame area="news" filetype="inc" name="functions.forms.php" frameId="4" />
|
||||
|
||||
<frame area="news_edit" filetype="main" name="cl_newsletter/includes/include.newsletter_edit_message.php" frameId="4" />
|
||||
|
||||
<frame area="recipients" filetype="main" name="cl_newsletter/includes/include.recipients_edit.php" frameId="4" />
|
||||
<frame area="recipients" filetype="main" name="cl_newsletter/includes/include.recipients_menu.php" frameId="2" />
|
||||
<frame area="recipients" filetype="main" name="cl_newsletter/includes/include.recipients_left_top.php" frameId="1" />
|
||||
<frame area="recipients" filetype="inc" name="functions.forms.php" frameId="4" />
|
||||
<frame area="recipients" filetype="main" name="include.subnav_blank.php" frameId="3" />
|
||||
|
||||
<frame area="recipientgroups" filetype="main" name="cl_newsletter/includes/include.recipients.group.subnav.php" frameId="3" />
|
||||
<frame area="recipientgroups" filetype="main" name="cl_newsletter/includes/include.recipients.group_edit.php" frameId="4" />
|
||||
<frame area="recipientgroups" filetype="main" name="cl_newsletter/includes/include.recipients.group_menu.php" frameId="2" />
|
||||
|
||||
<frame area="news_jobs" filetype="main" name="cl_newsletter/includes/include.newsletter_jobs_details.php" frameId="4" />
|
||||
<frame area="news_jobs" filetype="main" name="cl_newsletter/includes/include.newsletter_jobs_menu.php" frameId="2" />
|
||||
<frame area="news_jobs" filetype="main" name="cl_newsletter/includes/include.newsletter_jobs_subnav.php" frameId="3" />
|
||||
|
||||
<frame area="recipients_import" filetype="main" name="cl_newsletter/includes/include.recipients_import.php" frameId="4" />
|
||||
</frames>
|
||||
<nav_sub>
|
||||
<nav area="news" level="0" navm="extra">newsletter/xml/;navigation/extra/newsletter</nav>
|
||||
<nav area="recipients" level="1" navm="extra">newsletter/xml/;navigation/extra/recipients</nav>
|
||||
<nav area="recipientgroups" level="1" navm="extra">newsletter/xml/;navigation/extra/recipientgroups</nav>
|
||||
</nav_sub>
|
||||
</conlite>
|
||||
</plugin>
|
|
@ -48,12 +48,6 @@ class RecipientGroupCollection extends ItemCollection {
|
|||
$this->_setItemClass("RecipientGroup");
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function RecipientGroupCollection() {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new group
|
||||
* @param $groupname string Specifies the groupname
|
||||
|
@ -126,12 +120,6 @@ class RecipientGroup extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function RecipientGroup($mId = false) {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct($mId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overriden store() method to ensure, that there is only one default group
|
||||
* */
|
||||
|
@ -176,12 +164,6 @@ class RecipientGroupMemberCollection extends ItemCollection {
|
|||
$this->_setItemClass("RecipientGroupMember");
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function RecipientGroupMemberCollection() {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new association
|
||||
* @param $idrecipientgroup int specifies the newsletter group
|
||||
|
@ -303,12 +285,4 @@ class RecipientGroupMember extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function RecipientGroupMember($mId = false) {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct($mId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -48,12 +48,6 @@ class cNewsletterJobCollection extends ItemCollection {
|
|||
$this->_setItemClass("cNewsletterJob");
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function cNewsletterJobCollection() {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a newsletter job
|
||||
* @param $name string Specifies the name of the newsletter, the same name may be used more than once
|
||||
|
@ -252,12 +246,6 @@ class cNewsletterJob extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function cNewsletterJob($mId = false) {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct($mId);
|
||||
}
|
||||
|
||||
public function runJob() {
|
||||
global $cfg, $recipient;
|
||||
|
|
@ -48,12 +48,6 @@ class cNewsletterLogCollection extends ItemCollection {
|
|||
$this->_setItemClass("cNewsletterLog");
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function cNewsletterLogCollection() {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single new log item
|
||||
* @param $idnewsjob integer ID of corresponding newsletter send job
|
||||
|
@ -246,12 +240,4 @@ class cNewsletterLog extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function cNewsletterLog($mId = false) {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct($mId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
|
@ -28,41 +29,30 @@
|
|||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Newsletter management class
|
||||
*/
|
||||
class NewsletterCollection extends ItemCollection
|
||||
{
|
||||
class NewsletterCollection extends ItemCollection {
|
||||
|
||||
/**
|
||||
* Constructor Function
|
||||
* @param none
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["news"], "idnews");
|
||||
$this->_setItemClass("Newsletter");
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function NewsletterCollection()
|
||||
{
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new newsletter
|
||||
* @param $name string specifies the newsletter name
|
||||
*/
|
||||
public function create($sName)
|
||||
{
|
||||
public function create($sName) {
|
||||
global $client, $lang, $auth;
|
||||
|
||||
$sName = Contenido_Security::escapeDB($sName, null);
|
||||
|
@ -77,7 +67,7 @@ class NewsletterCollection extends ItemCollection
|
|||
$this->query();
|
||||
|
||||
if ($this->next()) {
|
||||
return $this->create($sName."_".substr(md5(rand()), 0, 10));
|
||||
return $this->create($sName . "_" . substr(md5(rand()), 0, 10));
|
||||
}
|
||||
|
||||
$oItem = parent::createNewItem();
|
||||
|
@ -96,8 +86,7 @@ class NewsletterCollection extends ItemCollection
|
|||
* Duplicates the newsletter specified by $itemID
|
||||
* @param $itemID integer specifies the newsletter id
|
||||
*/
|
||||
public function duplicate($iItemID)
|
||||
{
|
||||
public function duplicate($iItemID) {
|
||||
global $client, $lang, $auth;
|
||||
|
||||
$client = Contenido_Security::toInteger($client);
|
||||
|
@ -109,7 +98,7 @@ class NewsletterCollection extends ItemCollection
|
|||
$oBaseItem->loadByPrimaryKey($iItemID);
|
||||
|
||||
$oItem = parent::createNewItem();
|
||||
$oItem->set("name", $oBaseItem->get("name")."_".substr(md5(rand()), 0, 10));
|
||||
$oItem->set("name", $oBaseItem->get("name") . "_" . substr(md5(rand()), 0, 10));
|
||||
|
||||
$iIDArt = 0;
|
||||
if ($oBaseItem->get("type") == "html" && $oBaseItem->get("idart") > 0 && $oBaseItem->get("template_idart") > 0) {
|
||||
|
@ -121,7 +110,7 @@ class NewsletterCollection extends ItemCollection
|
|||
sprintf(i18n("Newsletter: %s", "newsletter"), $oItem->get("name")));
|
||||
conMakeOnline($iIDArt, $lang); // Article has to be online for sending...
|
||||
}
|
||||
unset ($oClientLang);
|
||||
unset($oClientLang);
|
||||
}
|
||||
$oItem->set("idart", $iIDArt);
|
||||
$oItem->set("template_idart", $oBaseItem->get("template_idart"));
|
||||
|
@ -160,13 +149,14 @@ class NewsletterCollection extends ItemCollection
|
|||
|
||||
return $oItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Single Newsletter Item
|
||||
*/
|
||||
class Newsletter extends Item
|
||||
{
|
||||
class Newsletter extends Item {
|
||||
|
||||
/**
|
||||
* @var string Error storage
|
||||
* @access private
|
||||
|
@ -177,8 +167,7 @@ class Newsletter 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"], "idnews");
|
||||
$this->_sError = "";
|
||||
|
@ -187,19 +176,11 @@ class Newsletter extends Item
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function Newsletter($mId = false)
|
||||
{
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct($mId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overriden store()-Method to set modified and modifiedby data and
|
||||
* to ensure, that there is only one welcome newsletter
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
public function store() {
|
||||
global $client, $lang, $auth;
|
||||
|
||||
$client = Contenido_Security::toInteger($client);
|
||||
|
@ -220,8 +201,8 @@ class Newsletter extends Item
|
|||
$oItem->set("welcome", 0);
|
||||
$oItem->store();
|
||||
}
|
||||
unset ($oItem);
|
||||
unset ($oItems);
|
||||
unset($oItem);
|
||||
unset($oItems);
|
||||
}
|
||||
|
||||
parent::store();
|
||||
|
@ -236,15 +217,14 @@ class Newsletter extends Item
|
|||
* @param string sData Data
|
||||
* @access private
|
||||
*/
|
||||
public function _replaceTag(&$sCode, $bIsHTML, $sField, $sData)
|
||||
{
|
||||
public function _replaceTag(&$sCode, $bIsHTML, $sField, $sData) {
|
||||
if ($sCode && !$bIsHTML) {
|
||||
$sCode = str_replace("MAIL_".strtoupper($sField), $sData, $sCode);
|
||||
$sCode = str_replace("MAIL_" . strtoupper($sField), $sData, $sCode);
|
||||
} else if ($sCode) {
|
||||
// Extract certain tag
|
||||
$sRegExp = '/\[mail\s*([^]]+)\s*name=(?:"|")'.$sField.'(?:"|")\s*(.*?)\s*\]((?:.|\s)+?)\[\/mail\]/i';
|
||||
$sRegExp = '/\[mail\s*([^]]+)\s*name=(?:"|")' . $sField . '(?:"|")\s*(.*?)\s*\]((?:.|\s)+?)\[\/mail\]/i';
|
||||
$aMatch = array();
|
||||
$iMatches = preg_match($sRegExp, $sCode, $aMatch) ;
|
||||
$iMatches = preg_match($sRegExp, $sCode, $aMatch);
|
||||
|
||||
if ($iMatches > 0) {
|
||||
// $aMatch contains parameter info from left [1] or right [2] to name="field"
|
||||
|
@ -256,7 +236,7 @@ class Newsletter extends Item
|
|||
if (preg_match_all($sRegExp, $sParameter, $aMatch) > 0) {
|
||||
// Store parameter data as assoziative array
|
||||
$aParameter = array_combine($aMatch[1], $aMatch[2]);
|
||||
unset ($aMatch); // $aMatch not needed anymore
|
||||
unset($aMatch); // $aMatch not needed anymore
|
||||
|
||||
if (!array_key_exists("type", $aParameter)) {
|
||||
$aParameter["type"] = "text";
|
||||
|
@ -283,27 +263,27 @@ class Newsletter extends Item
|
|||
|
||||
// Remove not needed parameters from the parameters list
|
||||
// everything else goes into the link as parameters
|
||||
unset ($aParameter["type"]);
|
||||
unset ($aParameter["text"]);
|
||||
unset($aParameter["type"]);
|
||||
unset($aParameter["text"]);
|
||||
|
||||
$sParameter = "";
|
||||
if (count($aParameter) > 0) {
|
||||
foreach ($aParameter as $sKey => $sValue) {
|
||||
$sParameter .= ' '.$sKey . '="' . $sValue . '"';
|
||||
$sParameter .= ' ' . $sKey . '="' . $sValue . '"';
|
||||
}
|
||||
}
|
||||
$sMessage = str_replace("MAIL_".strtoupper($sField), '<a href="'.clHtmlEntities($sData).'"'.$sParameter.'>'.$sText.'</a>', $sMessage);
|
||||
$sMessage = str_replace("MAIL_" . strtoupper($sField), '<a href="' . clHtmlEntities($sData) . '"' . $sParameter . '>' . $sText . '</a>', $sMessage);
|
||||
#$sMessage = '<a href="'.clHtmlEntities($sData).'"'.$sParameter.'>'.$sMessage.'</a>';
|
||||
break;
|
||||
default:
|
||||
$sMessage = str_replace("MAIL_".strtoupper($sField), $sData, $sMessage);
|
||||
$sMessage = str_replace("MAIL_" . strtoupper($sField), $sData, $sMessage);
|
||||
#$sMessage = $sData;
|
||||
}
|
||||
|
||||
$sRegExp = '/\[mail[^]]+name=(?:"|")'.$sField.'(?:"|").*?\].*?\[\/mail\]/is';
|
||||
$sRegExp = '/\[mail[^]]+name=(?:"|")' . $sField . '(?:"|").*?\].*?\[\/mail\]/is';
|
||||
$sCode = preg_replace($sRegExp, $sMessage, $sCode, -1);
|
||||
// Just to replace "text"-tags in HTML message also, just in case...
|
||||
$sCode = str_replace("MAIL_".strtoupper($sField), $sData, $sCode);
|
||||
$sCode = str_replace("MAIL_" . strtoupper($sField), $sData, $sCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -324,19 +304,19 @@ class Newsletter extends Item
|
|||
global $client, $cfgClient;
|
||||
$returnUrl = '';
|
||||
print_r($sUrl);
|
||||
if($sUrl[1] == "url") {
|
||||
if(empty($sUrl[3])) {
|
||||
$returnUrl = $sUrl[1]."(".$sUrl[2];
|
||||
if ($sUrl[1] == "url") {
|
||||
if (empty($sUrl[3])) {
|
||||
$returnUrl = $sUrl[1] . "(" . $sUrl[2];
|
||||
$returnUrl .= $cfgClient[$client]['path']['htmlpath'];
|
||||
$returnUrl .= ltrim(ltrim($sUrl[4], "."), "/");
|
||||
$returnUrl .= $sUrl[2].")";
|
||||
$returnUrl .= $sUrl[2] . ")";
|
||||
} else {
|
||||
$returnUrl = $sUrl[0];
|
||||
}
|
||||
} else if(empty($sUrl[2])) {
|
||||
$returnUrl = $sUrl[1].'="';
|
||||
} else if (empty($sUrl[2])) {
|
||||
$returnUrl = $sUrl[1] . '="';
|
||||
$returnUrl .= $cfgClient[$client]['path']['htmlpath'];
|
||||
$returnUrl .= ltrim(ltrim($sUrl[3], "."), "/").'"';
|
||||
$returnUrl .= ltrim(ltrim($sUrl[3], "."), "/") . '"';
|
||||
} else {
|
||||
$returnUrl = $sUrl[0];
|
||||
}
|
||||
|
@ -345,8 +325,8 @@ class Newsletter extends Item
|
|||
}
|
||||
|
||||
/* TODO: HerrB: Remove or insert some functionality */
|
||||
protected function _getNewsletterTagData($sHTML, $sTag)
|
||||
{
|
||||
|
||||
protected function _getNewsletterTagData($sHTML, $sTag) {
|
||||
//$sRegExp = "/<newsletter[^>](.*?)>.*?<\/newsletter>/i";
|
||||
//$sRegExp = "/\[mail[^\]](.*?)>.*?\[\/mail\]/i";
|
||||
#\[mail[^\]]((name="(?P<name>.*?)")|(type="(?P<type>.*?)"))\](?P<content>.*?)\[\/mail\]
|
||||
|
@ -371,7 +351,7 @@ class Newsletter extends Item
|
|||
* Match the characters "/mail" literally <EFBFBD>/mail<EFBFBD>
|
||||
* Match the character "]" literally <EFBFBD>\]<EFBFBD>
|
||||
* Ignore case (i), . includes new lines (s)
|
||||
**/
|
||||
* */
|
||||
|
||||
/*
|
||||
$sRegExp = '/\[mail\s*([^]]+)\]((?:.|\s)+?)\[\/mail\]/is';
|
||||
|
@ -392,19 +372,17 @@ class Newsletter extends Item
|
|||
#print_r ($aMatch);
|
||||
}
|
||||
|
||||
protected function _deChunkHTTPBody($sHeader, $sBody, $sEOL = "\r\n")
|
||||
{
|
||||
protected function _deChunkHTTPBody($sHeader, $sBody, $sEOL = "\r\n") {
|
||||
// Based on code from jbr at ya-right dot com, posted on http://www.php.net
|
||||
// as user comment on fsockopen documentation (2007-05-01)
|
||||
|
||||
// Analyze header
|
||||
$aParts = preg_split("/\r?\n/", $sHeader, -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
$aHeader = array();
|
||||
for ($i = 0;$i < sizeof ($aParts); $i++) {
|
||||
for ($i = 0; $i < sizeof($aParts); $i++) {
|
||||
if ($i != 0) {
|
||||
$iPos = strpos($aParts[$i], ':');
|
||||
$sParameter = strtolower (str_replace(' ', '', substr ($aParts[$i], 0, $iPos)));
|
||||
$sParameter = strtolower(str_replace(' ', '', substr($aParts[$i], 0, $iPos)));
|
||||
$sValue = trim(substr($aParts[$i], ($iPos + 1)));
|
||||
} else {
|
||||
$sField = 'status';
|
||||
|
@ -431,9 +409,9 @@ class Newsletter extends Item
|
|||
$sBuffer = '';
|
||||
if (isset($aHeader['transfer-encoding']) && $aHeader['transfer-encoding'] == 'chunked') {
|
||||
do {
|
||||
$sBody = ltrim ($sBody);
|
||||
$sBody = ltrim($sBody);
|
||||
$iPos = strpos($sBody, $sEOL);
|
||||
$iDataLen = hexdec (substr($sBody, 0, $iPos));
|
||||
$iDataLen = hexdec(substr($sBody, 0, $iPos));
|
||||
|
||||
if (isset($aHeader['content-encoding'])) {
|
||||
$sBuffer .= gzinflate(substr($sBody, ($iPos + $iEOLLen + 10), $iDataLen));
|
||||
|
@ -441,9 +419,8 @@ class Newsletter extends Item
|
|||
$sBuffer .= substr($sBody, ($iPos + $iEOLLen), $iDataLen);
|
||||
}
|
||||
|
||||
$sBody = substr ($sBody, ($iPos + $iDataLen + $iEOLLen));
|
||||
$sRemaining = trim ($sBody);
|
||||
|
||||
$sBody = substr($sBody, ($iPos + $iDataLen + $iEOLLen));
|
||||
$sRemaining = trim($sBody);
|
||||
} while (!empty($sRemaining));
|
||||
} else if (isset($aHeader['content-encoding'])) {
|
||||
$sBuffer = gzinflate(substr($sBody, 10));
|
||||
|
@ -470,13 +447,13 @@ class Newsletter extends Item
|
|||
// Category ID
|
||||
$oClientLang = new cApiClientLanguage(false, $client, $lang);
|
||||
$iIDCat = $oClientLang->getProperty("newsletter", "html_newsletter_idcat");
|
||||
unset ($oClientLang);
|
||||
unset($oClientLang);
|
||||
|
||||
// Get http username and password, if frontend is protected
|
||||
$oClient = new cApiClient($client);
|
||||
$sHTTPUserName = $oClient->getProperty("newsletter", "html_username");
|
||||
$sHTTPPassword = $oClient->getProperty("newsletter", "html_password");
|
||||
unset ($oClient);
|
||||
unset($oClient);
|
||||
|
||||
// Get HTML
|
||||
if ($iIDArt > 0 && $iIDCat > 0) {
|
||||
|
@ -493,9 +470,9 @@ class Newsletter extends Item
|
|||
$oArticle->set("online", 1);
|
||||
$oArticle->store();
|
||||
}
|
||||
unset ($oArticle);
|
||||
unset($oArticle);
|
||||
}
|
||||
unset ($oArticles);
|
||||
unset($oArticles);
|
||||
|
||||
$sFile = "front_content.php?client=$client&lang=$lang&idcat=$iIDCat&idart=$iIDArt&noex=1&send=1";
|
||||
$aURL = parse_url($cfgClient[$client]['path']['htmlpath']);
|
||||
|
@ -503,7 +480,7 @@ class Newsletter extends Item
|
|||
// TODO: Other schemes than http should be tested before use!
|
||||
if ($aURL["scheme"] == "https") {
|
||||
$iPort = 443;
|
||||
$sTarget = "ssl://".$aURL["host"];
|
||||
$sTarget = "ssl://" . $aURL["host"];
|
||||
} else {
|
||||
$iPort = 80;
|
||||
$sTarget = $aURL["host"];
|
||||
|
@ -518,15 +495,15 @@ class Newsletter extends Item
|
|||
// If you use HTTP 1.1 you may get chunked data... you could solve
|
||||
// this easily by using HTTP 1.0, but then you get a problem with
|
||||
// virtual servers, as HTTP 1.0 doesn't use the host information...
|
||||
fputs($iHandler, "GET ".$aURL["path"].$sFile." HTTP/1.1\r\n");
|
||||
fputs($iHandler, "Host: ".$aURL["host"]."\r\n");
|
||||
fputs($iHandler, "GET " . $aURL["path"] . $sFile . " HTTP/1.1\r\n");
|
||||
fputs($iHandler, "Host: " . $aURL["host"] . "\r\n");
|
||||
|
||||
// Maybe the website has been protected using .htaccess, then login
|
||||
if ($sHTTPUserName != "" && $sHTTPPassword != "") {
|
||||
fputs($iHandler, "Authorization: Basic " . base64_encode("$sHTTPUserName:$sHTTPPassword") . "\r\n");
|
||||
}
|
||||
|
||||
fputs($iHandler, "Referer: http://".$aURL["host"]."\r\n");
|
||||
fputs($iHandler, "Referer: http://" . $aURL["host"] . "\r\n");
|
||||
fputs($iHandler, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n");
|
||||
fputs($iHandler, "Connection: close\r\n\r\n");
|
||||
|
||||
|
@ -545,7 +522,7 @@ class Newsletter extends Item
|
|||
$sHeader .= $sLine;
|
||||
}
|
||||
}
|
||||
fclose ($iHandler);
|
||||
fclose($iHandler);
|
||||
|
||||
$sHTML = $this->_deChunkHTTPBody($sHeader, $sHTML);
|
||||
|
||||
|
@ -558,7 +535,7 @@ class Newsletter extends Item
|
|||
$sHTML = preg_replace_callback('/(url)\((\'|\")?(http:\/\/|https:\/\/|ftp:\/\/)?([A-Za-z0-9#\.?\-=_&\/]*)[\'|\"]?\)/', array($this, "_callbackReplaceUrl"), $sHTML);
|
||||
$sHTML = preg_replace_callback('/\b(src|href|ftp)[ ]*=[ ]*"(http:\/\/|https:\/\/|ftp:\/\/)?([A-Za-z0-9#\.?\-=_&\/]*)"/', array($this, "_callbackReplaceUrl"), $sHTML);
|
||||
// Now replace anchor tags to the newsletter article itself just by the anchor
|
||||
$sHTML = str_replace($cfgClient[$client]['path']['htmlpath']."front_content.php?idart=".$iIDArt."#", "#", $sHTML);
|
||||
$sHTML = str_replace($cfgClient[$client]['path']['htmlpath'] . "front_content.php?idart=" . $iIDArt . "#", "#", $sHTML);
|
||||
}
|
||||
|
||||
$sReturn = $sHTML;
|
||||
|
@ -584,8 +561,8 @@ class Newsletter extends Item
|
|||
$oArticle->set("online", 0);
|
||||
$oArticle->store();
|
||||
}
|
||||
unset ($oArticle);
|
||||
unset ($oArticles);
|
||||
unset($oArticle);
|
||||
unset($oArticles);
|
||||
}
|
||||
|
||||
return $sReturn;
|
||||
|
@ -601,8 +578,7 @@ class Newsletter extends Item
|
|||
* Checks, if html newsletter article still exists
|
||||
* @return bool
|
||||
*/
|
||||
public function htmlArticleExists()
|
||||
{
|
||||
public function htmlArticleExists() {
|
||||
if ($this->get("idart") > 0) {
|
||||
$oArticles = new cApiArticleLanguageCollection();
|
||||
$oArticles->setWhere("idlang", $this->get("idlang"));
|
||||
|
@ -615,7 +591,7 @@ class Newsletter extends Item
|
|||
$bReturn = false;
|
||||
}
|
||||
|
||||
unset ($oArticles);
|
||||
unset($oArticles);
|
||||
} else {
|
||||
$bReturn = false;
|
||||
}
|
||||
|
@ -632,8 +608,7 @@ class Newsletter extends Item
|
|||
* and simulate values from plugins
|
||||
* @param string $sEncoding Message (and header) encoding, e.g. iso-8859-1
|
||||
*/
|
||||
public function sendEMail($iIDCatArt, $sEMail, $sName = "", $bSimulatePlugins = true, $sEncoding = "iso-8859-1")
|
||||
{
|
||||
public function sendEMail($iIDCatArt, $sEMail, $sName = "", $bSimulatePlugins = true, $sEncoding = "iso-8859-1") {
|
||||
global $lang, $client, $cfg, $cfgClient, $contenido;
|
||||
|
||||
// Initialization
|
||||
|
@ -644,7 +619,7 @@ class Newsletter extends Item
|
|||
$oLanguage = new cApiLanguage($lang);
|
||||
$sFormatDate = $oLanguage->getProperty("dateformat", "date");
|
||||
$sFormatTime = $oLanguage->getProperty("dateformat", "time");
|
||||
unset ($oLanguage);
|
||||
unset($oLanguage);
|
||||
|
||||
if ($sFormatDate == "") {
|
||||
$sFormatDate = "%d.%m.%Y";
|
||||
|
@ -675,7 +650,7 @@ class Newsletter extends Item
|
|||
} else {
|
||||
$sError = "Newsletter to %s could not be sent: No html message available";
|
||||
}
|
||||
$this->_sError = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
|
||||
$this->_sError = $sName . " (" . $sEMail . "): " . sprintf($sError, $sEMail);
|
||||
return false;
|
||||
} else {
|
||||
$bIsHTML = true;
|
||||
|
@ -689,17 +664,17 @@ class Newsletter extends Item
|
|||
|
||||
// Simulate key, an alphanumeric string of 30 characters
|
||||
$sKey = str_repeat("key", 10);
|
||||
$sPath = $cfgClient[$client]["path"]["htmlpath"]."front_content.php?changelang=".$lang."&idcatart=".$iIDCatArt."&";
|
||||
$sPath = $cfgClient[$client]["path"]["htmlpath"] . "front_content.php?changelang=" . $lang . "&idcatart=" . $iIDCatArt . "&";
|
||||
|
||||
// Replace message tags (text message)
|
||||
$this->_replaceTag($sMessageText, false, "name", $sName);
|
||||
$this->_replaceTag($sMessageText, false, "number", 1);
|
||||
$this->_replaceTag($sMessageText, false, "date", strftime($sFormatDate));
|
||||
$this->_replaceTag($sMessageText, false, "time", strftime($sFormatTime));
|
||||
$this->_replaceTag($sMessageText, false, "unsubscribe", $sPath."unsubscribe=".$sKey);
|
||||
$this->_replaceTag($sMessageText, false, "change", $sPath."change=".$sKey);
|
||||
$this->_replaceTag($sMessageText, false, "stop", $sPath."stop=".$sKey);
|
||||
$this->_replaceTag($sMessageText, false, "goon", $sPath."goon=".$sKey);
|
||||
$this->_replaceTag($sMessageText, false, "unsubscribe", $sPath . "unsubscribe=" . $sKey);
|
||||
$this->_replaceTag($sMessageText, false, "change", $sPath . "change=" . $sKey);
|
||||
$this->_replaceTag($sMessageText, false, "stop", $sPath . "stop=" . $sKey);
|
||||
$this->_replaceTag($sMessageText, false, "goon", $sPath . "goon=" . $sKey);
|
||||
|
||||
// Replace message tags (html message)
|
||||
if ($bIsHTML) {
|
||||
|
@ -707,10 +682,10 @@ class Newsletter extends Item
|
|||
$this->_replaceTag($sMessageHTML, true, "number", 1);
|
||||
$this->_replaceTag($sMessageHTML, true, "date", strftime($sFormatDate));
|
||||
$this->_replaceTag($sMessageHTML, true, "time", strftime($sFormatTime));
|
||||
$this->_replaceTag($sMessageHTML, true, "unsubscribe", $sPath."unsubscribe=".$sKey);
|
||||
$this->_replaceTag($sMessageHTML, true, "change", $sPath."change=".$sKey);
|
||||
$this->_replaceTag($sMessageHTML, true, "stop", $sPath."stop=".$sKey);
|
||||
$this->_replaceTag($sMessageHTML, true, "goon", $sPath."goon=".$sKey);
|
||||
$this->_replaceTag($sMessageHTML, true, "unsubscribe", $sPath . "unsubscribe=" . $sKey);
|
||||
$this->_replaceTag($sMessageHTML, true, "change", $sPath . "change=" . $sKey);
|
||||
$this->_replaceTag($sMessageHTML, true, "stop", $sPath . "stop=" . $sKey);
|
||||
$this->_replaceTag($sMessageHTML, true, "goon", $sPath . "goon=" . $sKey);
|
||||
}
|
||||
|
||||
if ($bSimulatePlugins) {
|
||||
|
@ -718,17 +693,17 @@ class Newsletter extends Item
|
|||
if (getSystemProperty("newsletter", "newsletter-recipients-plugin") == "true") {
|
||||
if (is_array($cfg['plugins']['recipients'])) {
|
||||
foreach ($cfg['plugins']['recipients'] as $sPlugin) {
|
||||
plugin_include("recipients", $sPlugin."/".$sPlugin.".php");
|
||||
if (function_exists("recipients_".$sPlugin."_wantedVariables")) {
|
||||
plugin_include("recipients", $sPlugin . "/" . $sPlugin . ".php");
|
||||
if (function_exists("recipients_" . $sPlugin . "_wantedVariables")) {
|
||||
$aPluginVars = array();
|
||||
$aPluginVars = call_user_func("recipients_".$sPlugin."_wantedVariables");
|
||||
$aPluginVars = call_user_func("recipients_" . $sPlugin . "_wantedVariables");
|
||||
|
||||
foreach ($aPluginVars as $sPluginVar) {
|
||||
// Replace tags in text message
|
||||
$this->_replaceTag($sMessageText, false, $sPluginVar, ":: ".$sPlugin.": ".$sPluginVar." ::");
|
||||
$this->_replaceTag($sMessageText, false, $sPluginVar, ":: " . $sPlugin . ": " . $sPluginVar . " ::");
|
||||
// Replace tags in html message
|
||||
if ($bIsHTML) {
|
||||
$this->_replaceTag($sMessageHTML, true, $sPluginVar, ":: ".$sPlugin.": ".$sPluginVar." ::");
|
||||
$this->_replaceTag($sMessageHTML, true, $sPluginVar, ":: " . $sPlugin . ": " . $sPluginVar . " ::");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -746,7 +721,7 @@ class Newsletter extends Item
|
|||
} else {
|
||||
$sError = "Newsletter to %s could not be sent: No valid e-mail address";
|
||||
}
|
||||
$this->_sError = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
|
||||
$this->_sError = $sName . " (" . $sEMail . "): " . sprintf($sError, $sEMail);
|
||||
return false;
|
||||
} else {
|
||||
$oMail = new PHPMailer();
|
||||
|
@ -760,9 +735,9 @@ class Newsletter extends Item
|
|||
|
||||
if ($bIsHTML) {
|
||||
$oMail->Body = $sMessageHTML;
|
||||
$oMail->AltBody = $sMessageText."\n\n";
|
||||
$oMail->AltBody = $sMessageText . "\n\n";
|
||||
} else {
|
||||
$oMail->Body = $sMessageText."\n\n";
|
||||
$oMail->Body = $sMessageText . "\n\n";
|
||||
}
|
||||
|
||||
if (!$oMail->Send()) {
|
||||
|
@ -771,7 +746,7 @@ class Newsletter extends Item
|
|||
} else {
|
||||
$sError = "Newsletter to %s could not be sent";
|
||||
}
|
||||
$this->_sError = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
|
||||
$this->_sError = $sName . " (" . $sEMail . "): " . sprintf($sError, $sEMail);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
@ -791,8 +766,7 @@ class Newsletter extends Item
|
|||
* @param array $aSendRcps As reference: Filled with a list of succesfull recipients
|
||||
* @param string $sEncoding Message (and header) encoding, e.g. iso-8859-1
|
||||
*/
|
||||
public function sendDirect($iIDCatArt, $iIDNewsRcp = false, $iIDNewsGroup = false, &$aSendRcps, $sEncoding = "iso-8859-1")
|
||||
{
|
||||
public function sendDirect($iIDCatArt, $iIDNewsRcp = false, $iIDNewsGroup = false, &$aSendRcps, $sEncoding = "iso-8859-1") {
|
||||
global $lang, $client, $cfg, $cfgClient, $contenido, $recipient;
|
||||
|
||||
// Initialization
|
||||
|
@ -801,7 +775,7 @@ class Newsletter extends Item
|
|||
$oLanguage = new cApiLanguage($lang);
|
||||
$sFormatDate = $oLanguage->getProperty("dateformat", "date");
|
||||
$sFormatTime = $oLanguage->getProperty("dateformat", "time");
|
||||
unset ($oLanguage);
|
||||
unset($oLanguage);
|
||||
|
||||
if ($sFormatDate == "") {
|
||||
$sFormatDate = "%d.%m.%Y";
|
||||
|
@ -810,7 +784,7 @@ class Newsletter extends Item
|
|||
$sFormatTime = "%H:%M";
|
||||
}
|
||||
|
||||
$sPath = $cfgClient[$client]["path"]["htmlpath"]."front_content.php?changelang=".$lang."&idcatart=".$iIDCatArt."&";
|
||||
$sPath = $cfgClient[$client]["path"]["htmlpath"] . "front_content.php?changelang=" . $lang . "&idcatart=" . $iIDCatArt . "&";
|
||||
|
||||
// Get newsletter data
|
||||
$sFrom = $this->get("newsfrom");
|
||||
|
@ -864,9 +838,9 @@ class Newsletter extends Item
|
|||
|
||||
if (is_array($cfg['plugins']['recipients'])) {
|
||||
foreach ($cfg['plugins']['recipients'] as $sPlugin) {
|
||||
plugin_include("recipients", $sPlugin."/".$sPlugin.".php");
|
||||
if (function_exists("recipients_".$sPlugin."_wantedVariables")) {
|
||||
$aPlugins[$sPlugin] = call_user_func("recipients_".$sPlugin."_wantedVariables");
|
||||
plugin_include("recipients", $sPlugin . "/" . $sPlugin . ".php");
|
||||
if (function_exists("recipients_" . $sPlugin . "_wantedVariables")) {
|
||||
$aPlugins[$sPlugin] = call_user_func("recipients_" . $sPlugin . "_wantedVariables");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -878,7 +852,7 @@ class Newsletter extends Item
|
|||
$aRecipients = array();
|
||||
if ($iIDNewsGroup !== false) {
|
||||
$oGroupMembers = new RecipientGroupMemberCollection;
|
||||
$aRecipients = $oGroupMembers->getRecipientsInGroup ($iIDNewsGroup, false);
|
||||
$aRecipients = $oGroupMembers->getRecipientsInGroup($iIDNewsGroup, false);
|
||||
} else if ($iIDNewsRcp !== false) {
|
||||
$aRecipients[] = $iIDNewsRcp;
|
||||
}
|
||||
|
@ -902,7 +876,7 @@ class Newsletter extends Item
|
|||
|
||||
$sEMail = $recipient->get("email");
|
||||
$sName = $recipient->get("name");
|
||||
if (empty ($sName)) {
|
||||
if (empty($sName)) {
|
||||
$sName = $sEMail;
|
||||
}
|
||||
$sKey = $recipient->get("hash");
|
||||
|
@ -913,28 +887,28 @@ class Newsletter extends Item
|
|||
}
|
||||
|
||||
$this->_replaceTag($sRcpMsgText, false, "name", $sName);
|
||||
$this->_replaceTag($sRcpMsgText, false, "unsubscribe", $sPath."unsubscribe=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgText, false, "change", $sPath."change=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgText, false, "stop", $sPath."stop=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgText, false, "goon", $sPath."goon=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgText, false, "unsubscribe", $sPath . "unsubscribe=" . $sKey);
|
||||
$this->_replaceTag($sRcpMsgText, false, "change", $sPath . "change=" . $sKey);
|
||||
$this->_replaceTag($sRcpMsgText, false, "stop", $sPath . "stop=" . $sKey);
|
||||
$this->_replaceTag($sRcpMsgText, false, "goon", $sPath . "goon=" . $sKey);
|
||||
|
||||
// Replace message tags (html message)
|
||||
if ($bIsHTML && $bSendHTML) {
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "name", $sName);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "unsubscribe", $sPath."unsubscribe=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "change", $sPath."change=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "stop", $sPath."stop=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "goon", $sPath."goon=".$sKey);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "unsubscribe", $sPath . "unsubscribe=" . $sKey);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "change", $sPath . "change=" . $sKey);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "stop", $sPath . "stop=" . $sKey);
|
||||
$this->_replaceTag($sRcpMsgHTML, true, "goon", $sPath . "goon=" . $sKey);
|
||||
}
|
||||
|
||||
if ($bPluginEnabled) {
|
||||
foreach ($aPlugins as $sPlugin => $aPluginVar) {
|
||||
foreach ($aPluginVar as $sPluginVar) {
|
||||
// Replace tags in text message
|
||||
$this->_replaceTag($sRcpMsgText, false, $sPluginVar, call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar));
|
||||
$this->_replaceTag($sRcpMsgText, false, $sPluginVar, call_user_func("recipients_" . $sPlugin . "_getvalue", $sPluginVar));
|
||||
// Replace tags in html message
|
||||
if ($bIsHTML && $bSendHTML) {
|
||||
$this->_replaceTag($sRcpMsgHTML, true, $sPluginVar, call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar));
|
||||
$this->_replaceTag($sRcpMsgHTML, true, $sPluginVar, call_user_func("recipients_" . $sPlugin . "_getvalue", $sPluginVar));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -946,14 +920,14 @@ class Newsletter extends Item
|
|||
} else {
|
||||
$sError = "Newsletter to %s could not be sent: Recipient has an incompatible or empty key";
|
||||
}
|
||||
$aMessages[] = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
|
||||
$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", "newsletter");
|
||||
} else {
|
||||
$sError = "Newsletter to %s could not be sent: No valid e-mail address specified";
|
||||
}
|
||||
$aMessages[] = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
|
||||
$aMessages[] = $sName . " (" . $sEMail . "): " . sprintf($sError, $sEMail);
|
||||
} else {
|
||||
$oMail = new PHPMailer();
|
||||
$oMail->CharSet = $sEncoding;
|
||||
|
@ -966,20 +940,20 @@ class Newsletter extends Item
|
|||
|
||||
if ($bIsHTML && $bSendHTML) {
|
||||
$oMail->Body = $sRcpMsgHTML;
|
||||
$oMail->AltBody = $sRcpMsgText."\n\n";
|
||||
$oMail->AltBody = $sRcpMsgText . "\n\n";
|
||||
} else {
|
||||
$oMail->Body = $sRcpMsgText."\n\n";
|
||||
$oMail->Body = $sRcpMsgText . "\n\n";
|
||||
}
|
||||
|
||||
if ($oMail->Send()) {
|
||||
$aSendRcps[] = $sName." (".$sEMail.")";
|
||||
$aSendRcps[] = $sName . " (" . $sEMail . ")";
|
||||
} else {
|
||||
if ($contenido) { // Use i18n only in backend
|
||||
$sError = i18n("Newsletter to %s could not be sent", "newsletter");
|
||||
} else {
|
||||
$sError = "Newsletter to %s could not be sent";
|
||||
}
|
||||
$aMessages[] = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
|
||||
$aMessages[] = $sName . " (" . $sEMail . "): " . sprintf($sError, $sEMail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1013,14 +987,12 @@ class Newsletter extends Item
|
|||
* @param $iChunk integer specifies current chunk number when sending in chunks
|
||||
* result array array of recipient names/e-mails
|
||||
*/
|
||||
public function send($idcatart, $destination = "other", $to = "", $iChunkSize = 0, $iChunk = 0, $sEncoding = "iso-8859-1")
|
||||
{
|
||||
public function send($idcatart, $destination = "other", $to = "", $iChunkSize = 0, $iChunk = 0, $sEncoding = "iso-8859-1") {
|
||||
// What should we do with this deprecated method?
|
||||
$aResult = array();
|
||||
$aResult[] = 0;
|
||||
$aResult[] = "Newsletter->send() not supported anymore (class.newsletter.php)";
|
||||
return $aResult;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
|
@ -48,12 +48,6 @@ class RecipientCollection extends ItemCollection {
|
|||
$this->_setItemClass("Recipient");
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function RecipientCollection() {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new recipient
|
||||
* @param string $sEMail Specifies the e-mail adress
|
||||
|
@ -223,26 +217,6 @@ class Recipient extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
|
||||
public function Recipient($mId = false) {
|
||||
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
|
||||
$this->__construct($mId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given md5 matches the md5(email) in the database
|
||||
* @param $md5email string md5 of E-Mail to check
|
||||
* @return boolean True if the hash matches, false otherwise
|
||||
* @deprecated 4.6.15 - 10.08.2006
|
||||
*/
|
||||
public function checkMD5Email($md5email) {
|
||||
if ($md5email == md5($this->get("email"))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function store() {
|
||||
global $auth;
|
||||
|
||||
|
@ -272,5 +246,3 @@ class Recipient extends Item {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,20 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
* File:
|
||||
* config.autoloader.php
|
||||
*
|
||||
* @package Plugins
|
||||
* @subpackage Newsletter
|
||||
* @version $Rev: 283 $
|
||||
* @since 2.0
|
||||
* @author Ortwin Pinke <o.pinke@conlite.org>
|
||||
* @copyright 2012 CL-Team
|
||||
* @link http://www.conlite.org
|
||||
*
|
||||
* $Id: config.autoloader.php 283 2014-01-09 14:48:38Z oldperl $
|
||||
*/
|
||||
|
||||
$sAutoloadClassPath = 'conlite/plugins/newsletter/classes/';
|
||||
$sAutoloadClassPath = strstr(dirname(dirname(__FILE__)), "conlite/plugins")."/classes/";
|
||||
return array(
|
||||
'RecipientGroupCollection' => $sAutoloadClassPath.'class.newsletter.groups.php',
|
||||
'RecipientGroup' => $sAutoloadClassPath.'class.newsletter.groups.php',
|
||||
|
@ -27,6 +12,6 @@ return array(
|
|||
'NewsletterCollection' => $sAutoloadClassPath.'class.newsletter.php',
|
||||
'Newsletter' => $sAutoloadClassPath.'class.newsletter.php',
|
||||
'RecipientCollection' => $sAutoloadClassPath.'class.newsletter.recipients.php',
|
||||
'Recipient' => $sAutoloadClassPath.'class.newsletter.recipients.php',
|
||||
'Recipient' => $sAutoloadClassPath.'class.newsletter.recipients.php'
|
||||
);
|
||||
?>
|
|
@ -17,4 +17,11 @@
|
|||
// security check
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
?>
|
||||
class nlHandler extends pluginHandlerAbstract {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
plugin_include(nlHandler::getName(), "includes/functions/demo1.php");
|
||||
plugin_include(nlHandler::getName(), "includes/functions/demo2.php");
|
||||
*/
|
|
@ -35,10 +35,10 @@ if (!defined('CON_FRAMEWORK')) {
|
|||
|
||||
|
||||
// Initialization
|
||||
$oPage = new cPage;
|
||||
$oRcpGroups = new RecipientGroupCollection;
|
||||
$oPage = new cPage();
|
||||
$oRcpGroups = new RecipientGroupCollection();
|
||||
$oClientLang = new cApiClientLanguage(false, $client, $lang);
|
||||
$oNewsletters = new NewsletterCollection;
|
||||
$oNewsletters = new NewsletterCollection();
|
||||
|
||||
// Include plugins
|
||||
if (is_array($cfg['plugins']['newsletters'])) {
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<language>
|
||||
<navigation>
|
||||
<extra>
|
||||
<newsletter>Newsletter</newsletter>
|
||||
<recipients>Empfänger</recipients>
|
||||
<recipientgroups>Empfängergruppe</recipientgroups>
|
||||
</extra>
|
||||
</navigation>
|
||||
</language>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<language>
|
||||
<navigation>
|
||||
<extra>
|
||||
<newsletter>Newsletter</newsletter>
|
||||
<recipients>Empfänger</recipients>
|
||||
<recipientgroups>Empfängergruppe</recipientgroups>
|
||||
</extra>
|
||||
</navigation>
|
||||
</language>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<language>
|
||||
<navigation>
|
||||
<extra>
|
||||
<newsletter>Newsletter</newsletter>
|
||||
<recipients>Empfänger</recipients>
|
||||
<recipientgroups>Empfängergruppe</recipientgroups>
|
||||
</extra>
|
||||
</navigation>
|
||||
</language>
|
|
@ -1,73 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<plugin>
|
||||
<general active="1">
|
||||
<plugin_name>Newsletter</plugin_name>
|
||||
<plugin_foldername>newsletter</plugin_foldername>
|
||||
<uuid>88783B7D-9C64-A284-9A70-721F09BF7FE4</uuid>
|
||||
<description>Newsletter System for CONTENIDO</description>
|
||||
<author>Bjoern Behrens</author>
|
||||
<copyright>four for business AG</copyright>
|
||||
<mail>info@4fb.de</mail>
|
||||
<website>http://www.4fb.de</website>
|
||||
<version>0.1.0</version>
|
||||
</general>
|
||||
<requirements php="5.2.3">
|
||||
<conlite minversion="2.0.0" />
|
||||
</requirements>
|
||||
<contenido>
|
||||
<areas>
|
||||
<area menuless="0">news</area>
|
||||
<area parent="news" menuless="0">news_edit</area>
|
||||
<area menuless="0">recipients</area>
|
||||
<area menuless="0">recipientgroups</area>
|
||||
<area parent="news" menuless="0">news_jobs</area>
|
||||
<area parent="recipients" menuless="0">recipients_import</area>
|
||||
</areas>
|
||||
<actions>
|
||||
<action area="news">news_save</action>
|
||||
<action area="news">news_create</action>
|
||||
<action area="news">news_delete</action>
|
||||
<action area="news">news_duplicate</action>
|
||||
<action area="news">news_add_job</action>
|
||||
<action area="news">news_send_test</action>
|
||||
<action area="news_jobs">news_job_delete</action>
|
||||
<action area="news_jobs">news_job_details</action>
|
||||
<action area="news_jobs">news_job_detail_delete</action>
|
||||
<action area="news">news_html_settings</action>
|
||||
<action area="news_jobs">news_job_run</action>
|
||||
<action area="recipients">recipients_save</action>
|
||||
<action area="recipients">recipients_create</action>
|
||||
<action area="recipients">recipients_delete</action>
|
||||
<action area="recipientgroups">recipientgroup_delete</action>
|
||||
<action area="recipientgroups">recipientgroup_create</action>
|
||||
<action area="recipientgroups">recipientgroup_recipient_delete</action>
|
||||
<action area="recipientgroups">recipientgroup_save_group</action>
|
||||
<action area="recipients">recipients_purge</action>
|
||||
<action area="recipients_import">recipients_import</action>
|
||||
<action area="recipients_import">recipients_import_exec</action>
|
||||
</actions>
|
||||
<frames>
|
||||
<frame area="news" filetype="main" name="newsletter/includes/include.newsletter_left_top.php" frameId="1" />
|
||||
<frame area="news" filetype="main" name="newsletter/includes/include.newsletter_menu.php" frameId="2" />
|
||||
<frame area="news" filetype="main" name="newsletter/includes/include.newsletter_edit.php" frameId="4" />
|
||||
<frame area="recipients" filetype="main" name="newsletter/includes/include.recipients_left_top.php" frameId="1" />
|
||||
<frame area="recipients" filetype="main" name="newsletter/includes/include.recipients_menu.php" frameId="2" />
|
||||
<frame area="recipients" filetype="main" name="include.subnav_blank.php" frameId="3" />
|
||||
<frame area="recipients" filetype="main" name="newsletter/includes/include.recipients_edit.php" frameId="4" />
|
||||
<frame area="news" filetype="main" name="newsletter/includes/include.newsletter_subnav.php" frameId="3" />
|
||||
<frame area="recipientgroups" filetype="main" name="newsletter/includes/include.recipients.group_menu.php" frameId="2" />
|
||||
<frame area="recipientgroups" filetype="main" name="newsletter/includes/include.recipients.group.subnav.php" frameId="3" />
|
||||
<frame area="recipientgroups" filetype="main" name="newsletter/includes/include.recipients.group_edit.php" frameId="4" />
|
||||
<frame area="news_jobs" filetype="main" name="newsletter/includes/include.newsletter_jobs_menu.php" frameId="2" />
|
||||
<frame area="news_jobs" filetype="main" name="newsletter/includes/include.newsletter_jobs_details.php" frameId="4" />
|
||||
<frame area="news_jobs" filetype="main" name="newsletter/includes/include.newsletter_jobs_subnav.php" frameId="3" />
|
||||
<frame area="news_edit" filetype="main" name="newsletter/includes/include.newsletter_edit_message.php" frameId="4" />
|
||||
<frame area="recipients_import" filetype="main" name="newsletter/includes/include.recipients_import.php" frameId="4" />
|
||||
</frames>
|
||||
<nav_sub>
|
||||
<nav area="news" level="0" navm="3">newsletter/xml/;navigation/extra/newsletter</nav>
|
||||
<nav area="recipients" level="1" navm="3">newsletter/xml/;navigation/extra/recipients</nav>
|
||||
<nav area="recipientgroups" level="1" navm="3">newsletter/xml/;navigation/extra/recipientgroups</nav>
|
||||
</nav_sub>
|
||||
</contenido>
|
||||
</plugin>
|
Laden…
In neuem Issue referenzieren