mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Slight simplification of e_mailout handlers; improve documentation, a few fixes to recent fixes
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
* Administration - Mailout
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/mailout.php,v $
|
||||
* $Revision: 1.35 $
|
||||
* $Date: 2010-01-10 11:01:27 $
|
||||
* $Revision: 1.36 $
|
||||
* $Date: 2010-01-11 21:08:38 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage admin
|
||||
* @version $Id: mailout.php,v 1.35 2010-01-10 11:01:27 e107steved Exp $;
|
||||
* @version $Id: mailout.php,v 1.36 2010-01-11 21:08:38 e107steved Exp $;
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -43,14 +43,6 @@ Extra mailout address handlers - these provide email addresses
|
||||
4. Interface is implemented as a class, which must be called 'plugin_path_mailout'
|
||||
5. see mailout_class.php in the handlers directory for an example (also simpler examples in newsletter and event calendar plugins)
|
||||
|
||||
|
||||
Each mailout task class, must include a number of mandatory entry points:
|
||||
show_select($allow_edit = FALSE) - in edit mode, returns text which facilitates address selection. Otherwise shows the current selection criteria
|
||||
- the display is assigned to a single table cell
|
||||
function returnSelectors() - returns storable representation of user-entered selection criteria
|
||||
select_init() - initialise the selection mechanism
|
||||
select_add() - routine pulls out email addresses etc, for caller to add to the list of addressees
|
||||
select_close() - selection complete
|
||||
*/
|
||||
|
||||
|
||||
@@ -345,8 +337,6 @@ switch ($action)
|
||||
break;
|
||||
|
||||
case 'mailsendnow' : // Send mail previously on 'held' list. Need to give opportunity to change time/date etc
|
||||
// $midAction = 'midMoveToSend';
|
||||
// $action = 'pending';
|
||||
$action = 'marksend'; // This shows the email details for confirmation
|
||||
$fromHold = TRUE;
|
||||
$mailData['mail_source_id'] = $mailId;
|
||||
@@ -542,7 +532,7 @@ switch ($action)
|
||||
|
||||
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
||||
require_once(e_ADMIN.'footer.php');
|
||||
|
||||
|
||||
|
||||
@@ -662,7 +652,7 @@ function show_prefs($mailAdmin)
|
||||
$mailers = array('php','smtp','sendmail');
|
||||
foreach($mailers as $opt)
|
||||
{
|
||||
$sel = ($pref['mailer'] == $opt) ? "selected='selected'" : "";
|
||||
$sel = ($pref['mailer'] == $opt) ? "selected='selected'" : '';
|
||||
$text .= "<option value='{$opt}' {$sel}>{$opt}</option>\n";
|
||||
}
|
||||
$text .="</select> <span class='field-help'>".LAN_MAILOUT_116."</span><br />";
|
||||
@@ -716,7 +706,7 @@ function show_prefs($mailAdmin)
|
||||
$text .= "<tr>
|
||||
<td>".LAN_MAILOUT_57."</td><td>
|
||||
";
|
||||
$checked = (varsettrue($pref['smtp_keepalive']) ) ? "checked='checked'" : "";
|
||||
$checked = (varsettrue($pref['smtp_keepalive']) ) ? "checked='checked'" : '';
|
||||
$text .= "<input type='checkbox' name='smtp_keepalive' value='1' {$checked} />
|
||||
</td>
|
||||
</tr>";
|
||||
@@ -731,10 +721,9 @@ function show_prefs($mailAdmin)
|
||||
|
||||
|
||||
// Sendmail. -------------->
|
||||
$senddisp = ($pref['mailer'] != 'sendmail') ? "style='display:none;'" : "";
|
||||
$senddisp = ($pref['mailer'] != 'sendmail') ? "style='display:none;'" : '';
|
||||
$text .= "<div id='sendmail' {$senddisp}><table style='margin-right:0px;margin-left:auto;border:0px'>";
|
||||
$text .= "
|
||||
|
||||
<tr>
|
||||
<td>".LAN_MAILOUT_20.": </td>
|
||||
<td>
|
||||
@@ -795,10 +784,10 @@ function show_prefs($mailAdmin)
|
||||
<td>".LAN_MAILOUT_72."</td>
|
||||
<td>
|
||||
<select class='tbox' name='mail_log_option'>\n
|
||||
<option value='0'".(($mail_log_option==0) ? " selected='selected'" : "").">".LAN_MAILOUT_73."</option>\n
|
||||
<option value='1'".(($mail_log_option==1) ? " selected='selected'" : "").">".LAN_MAILOUT_74."</option>\n
|
||||
<option value='2'".(($mail_log_option==2) ? " selected='selected'" : "").">".LAN_MAILOUT_75."</option>\n
|
||||
<option value='3'".(($mail_log_option==3) ? " selected='selected'" : "").">".LAN_MAILOUT_119."</option>\n
|
||||
<option value='0'".(($mail_log_option==0) ? " selected='selected'" : '').">".LAN_MAILOUT_73."</option>\n
|
||||
<option value='1'".(($mail_log_option==1) ? " selected='selected'" : '').">".LAN_MAILOUT_74."</option>\n
|
||||
<option value='2'".(($mail_log_option==2) ? " selected='selected'" : '').">".LAN_MAILOUT_75."</option>\n
|
||||
<option value='3'".(($mail_log_option==3) ? " selected='selected'" : '').">".LAN_MAILOUT_119."</option>\n
|
||||
</select>\n
|
||||
<input type='checkbox' name='mail_log_email' value='1' {$check} />".LAN_MAILOUT_76.
|
||||
"</td>
|
||||
@@ -817,8 +806,8 @@ function show_prefs($mailAdmin)
|
||||
<td>".LAN_MAILOUT_231."</td><td>";
|
||||
|
||||
// bounce divs = mail_bounce_none, mail_bounce_auto, mail_bounce_mail
|
||||
$autoDisp = ($pref['mail_bounce'] != 'auto') ? "style='display:none;'" : "";
|
||||
$autoMail = ($pref['mail_bounce'] != 'mail') ? "style='display:none;'" : "";
|
||||
$autoDisp = ($pref['mail_bounce'] != 'auto') ? "style='display:none;'" : '';
|
||||
$autoMail = ($pref['mail_bounce'] != 'mail') ? "style='display:none;'" : '';
|
||||
$bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
|
||||
$text .= "<select name='mail_bounce' class='tbox' onchange='bouncedisp(this.value)'>\n<option value=''> </option>\n";
|
||||
foreach ($bounceOpts as $k => $v)
|
||||
@@ -843,11 +832,11 @@ function show_prefs($mailAdmin)
|
||||
|
||||
if(!is_readable(e_HANDLER.'bounce_handler.php'))
|
||||
{
|
||||
$text .= "<br /><span class='required'>".LAN_MAILOUT_161."</span>";
|
||||
$text .= "<br /><span class='required'>".LAN_MAILOUT_161.'</span>';
|
||||
}
|
||||
elseif(!is_executable(e_HANDLER.'bounce_handler.php')) // Seems to give wrong answers on Windoze
|
||||
{
|
||||
$text .= "<br /><span class='required'>".LAN_MAILOUT_162."</span>";
|
||||
$text .= "<br /><span class='required'>".LAN_MAILOUT_162.'</span>';
|
||||
}
|
||||
$text .= "<br /><span class='field-help'>".LAN_MAILOUT_235."</span></td></tr>
|
||||
<tr><td>".LAN_MAILOUT_236."</td><td>".$lastBounceText."</td></tr>
|
||||
@@ -887,7 +876,7 @@ function show_prefs($mailAdmin)
|
||||
|
||||
</div></form>";
|
||||
|
||||
$caption = ADLAN_136." :: ".LAN_PREFS;
|
||||
$caption = ADLAN_136.' :: '.LAN_PREFS;
|
||||
$e107->ns->tablerender($caption,$mes->render(). $text);
|
||||
}
|
||||
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* e107 Mailout - mail database API and utility routines
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mail_manager_class.php,v $
|
||||
* $Revision: 1.12 $
|
||||
* $Date: 2010-01-04 21:35:38 $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2010-01-11 21:09:15 $
|
||||
* $Author: e107steved $
|
||||
*/
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage e107_handlers
|
||||
* @version $Revision: 1.12 $
|
||||
* @author $Author: e107steved $
|
||||
|
||||
* @version $Id: mail_manager_class.php,v 1.13 2010-01-11 21:09:15 e107steved Exp $;
|
||||
*
|
||||
* @todo - consider whether to extract links in text-only emails
|
||||
|
||||
This class isolates the caller from the underlying database used to buffer and send emails.
|
||||
Also includes a number of useful routines
|
||||
@@ -36,10 +36,6 @@ theme-related information. Create file 'emailstyle.css' in the current theme dir
|
||||
will be included in preference to the current theme style.
|
||||
|
||||
|
||||
TODO:
|
||||
- Consider whether to extract links in text-only emails
|
||||
- makeEmailBody - could use regex to modify links
|
||||
|
||||
|
||||
Event Triggers generated
|
||||
------------------------
|
||||
|
@@ -6,11 +6,11 @@
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Site Maintenance
|
||||
* Mailout - admin-related functions
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mailout_admin_class.php,v $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2010-01-10 11:01:28 $
|
||||
* $Revision: 1.14 $
|
||||
* $Date: 2010-01-11 21:09:21 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage e107_handlers
|
||||
* @version $Id: mailout_admin_class.php,v 1.13 2010-01-10 11:01:28 e107steved Exp $;
|
||||
* @version $Id: mailout_admin_class.php,v 1.14 2010-01-11 21:09:21 e107steved Exp $;
|
||||
*/
|
||||
|
||||
|
||||
@@ -319,6 +319,15 @@ class mailoutAdminClass extends e107MailManager
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the user name associated with a user ID.
|
||||
* The result is cached in case required again
|
||||
*
|
||||
* @param int $uid - User ID
|
||||
*
|
||||
* @return string with user name and user login name (UID if user not found)
|
||||
*/
|
||||
protected function getUserName($uid)
|
||||
{
|
||||
if (!isset($this->userCache[$uid]))
|
||||
@@ -412,7 +421,7 @@ class mailoutAdminClass extends e107MailManager
|
||||
if (in_array('core', $toLoad) || ($options == 'all'))
|
||||
{
|
||||
require_once(e_HANDLER.'mailout_class.php');
|
||||
$this->mailHandlers[] = new core_mailout; // Start by loading the core mailout class
|
||||
$this->mailHandlers['core'] = new core_mailout; // Start by loading the core mailout class
|
||||
$ret++;
|
||||
}
|
||||
|
||||
@@ -421,7 +430,7 @@ class mailoutAdminClass extends e107MailManager
|
||||
// Load additional configured handlers
|
||||
foreach ($pref['e_mailout_list'] as $mailer => $v)
|
||||
{
|
||||
if (isset($pref['plug_installed'][$mailer]) && in_array($mailer,$active_mailers) && (($options == 'all') || in_array('core', $toLoad)))
|
||||
if (isset($pref['plug_installed'][$mailer]) && in_array($mailer,$active_mailers) && (($options == 'all') || in_array($mailer, $toLoad)))
|
||||
{ // Could potentially use this handler - its installed and enabled
|
||||
if (!is_readable(e_PLUGIN.$mailer.'/e_mailout.php'))
|
||||
{
|
||||
@@ -435,11 +444,11 @@ class mailoutAdminClass extends e107MailManager
|
||||
$temp = new $mailClass;
|
||||
if ($temp->mailerEnabled)
|
||||
{
|
||||
$this->mailHandlers[] = $temp;
|
||||
$this->mailHandlers[$mailer] = $temp;
|
||||
$ret++;
|
||||
if (varset($mailerExcludeDefault,FALSE) && isset($this->mailHandlers[0]) && ($this->mailHandlers[0]->mailerSource == 'core'))
|
||||
if (varset($mailerExcludeDefault,FALSE) && isset($this->mailHandlers['core']))
|
||||
{
|
||||
$this->mailHandlers[0]->mailerEnabled = FALSE; // Don't need default (core) handler
|
||||
$this->mailHandlers['core']->mailerEnabled = FALSE; // Don't need default (core) handler
|
||||
$ret--;
|
||||
}
|
||||
}
|
||||
@@ -458,7 +467,7 @@ class mailoutAdminClass extends e107MailManager
|
||||
/**
|
||||
* Generate the HTML for displaying email selection fields
|
||||
*
|
||||
* @param $options - comma-separate string of areas to display:
|
||||
* @param $options - comma-separated string of areas to display:
|
||||
* plugins - selectors from any available plugins
|
||||
* cc - field for 'cc' options
|
||||
* bcc - field for 'bcc' options
|
||||
@@ -474,16 +483,14 @@ class mailoutAdminClass extends e107MailManager
|
||||
|
||||
$ret .= "<div class='admintabs' id='tab-container'>\n";
|
||||
|
||||
foreach ($this->mailHandlers as $m)
|
||||
foreach ($this->mailHandlers as $key => $m)
|
||||
{
|
||||
$key = $m->mailerSource;
|
||||
|
||||
if ($m->mailerEnabled)
|
||||
{
|
||||
$tab .= "<li id='tab-main_".$key."'><a href='#main-mail-".$key."'>".$m->mailerName."</a></li>";
|
||||
$tabc .= "<div id='main-mail-".$key."'>";
|
||||
|
||||
$content = $m->showSelect(TRUE, varset($selectorInfo[$m->mailerSource], FALSE));
|
||||
$content = $m->showSelect(TRUE, varset($selectorInfo[$key], FALSE));
|
||||
|
||||
if(is_array($content))
|
||||
{
|
||||
@@ -525,11 +532,11 @@ class mailoutAdminClass extends e107MailManager
|
||||
public function getAllSelectors()
|
||||
{
|
||||
$ret = array();
|
||||
foreach ($this->mailHandlers as $m)
|
||||
foreach ($this->mailHandlers as $key => $m)
|
||||
{
|
||||
if ($m->mailerEnabled)
|
||||
{
|
||||
$ret[$m->mailerSource] = $m->returnSelectors();
|
||||
$ret[$key] = $m->returnSelectors();
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
@@ -1195,12 +1202,12 @@ class mailoutAdminClass extends e107MailManager
|
||||
|
||||
$this->mailInitCounters($mailMainID); // Initialise counters for emails added
|
||||
|
||||
foreach ($this->mailHandlers as $m)
|
||||
foreach ($this->mailHandlers as $key => $m)
|
||||
{ // Get email addresses from each handler in turn. Do them one at a time, so that all can use the $sql data object
|
||||
if ($m->mailerEnabled && isset($mailData['mail_selectors'][$m->mailerSource]))
|
||||
if ($m->mailerEnabled && isset($mailData['mail_selectors'][$key]))
|
||||
{
|
||||
// Initialise
|
||||
$mailerCount = $m->selectInit($mailData['mail_selectors'][$m->mailerSource]);
|
||||
$mailerCount = $m->selectInit($mailData['mail_selectors'][$key]);
|
||||
if ($mailerCount > 0)
|
||||
{
|
||||
// Get email addresses - add to list, strip duplicates
|
||||
@@ -1242,10 +1249,10 @@ class mailoutAdminClass extends e107MailManager
|
||||
|
||||
|
||||
// Add in core and any plugin selectors here
|
||||
foreach ($this->mailHandlers as $m)
|
||||
foreach ($this->mailHandlers as $key => $m)
|
||||
{
|
||||
|
||||
if ($m->mailerEnabled && ($contentArray = $m->showSelect(FALSE,$mailData['mail_selectors'][$m->mailerSource])))
|
||||
if ($m->mailerEnabled && ($contentArray = $m->showSelect(FALSE,$mailData['mail_selectors'][$key])))
|
||||
{
|
||||
$text .= '<tr><td>'.LAN_MAILOUT_180.'<br />'.$m->mailerName.'</td>';
|
||||
$text .= '<td><ul>';
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Mailout handling - selector for 'core' users
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mailout_class.php,v $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2010-01-10 11:01:29 $
|
||||
* $Revision: 1.10 $
|
||||
* $Date: 2010-01-11 21:09:28 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
@@ -20,7 +20,9 @@
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage e107_handlers
|
||||
* @version $Id: mailout_class.php,v 1.9 2010-01-10 11:01:29 e107steved Exp $;
|
||||
* @version $Id: mailout_class.php,v 1.10 2010-01-11 21:09:28 e107steved Exp $;
|
||||
*
|
||||
* @todo last visit date needs XHTML calendar on display, and needs to accept varying input formats
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@@ -39,10 +41,6 @@ In general each class object must be self-contained, and use internal variables
|
||||
The class may use the global $e107->sql object for database access - it will effectively have exclusive use of this during the email address search phase
|
||||
|
||||
It is the responsibility of each class to manager permission restrictions where required.
|
||||
|
||||
TODO:
|
||||
1. accept varying date formats for last visit
|
||||
2. Use XHTML calendar for last visit
|
||||
*/
|
||||
|
||||
// These variables determine the circumstances under which this class is loaded (only used during loading, and may be overwritten later)
|
||||
@@ -54,10 +52,9 @@ class core_mailout
|
||||
protected $mailCount = 0;
|
||||
protected $mailRead = 0;
|
||||
// protected $e107;
|
||||
public $mailerSource = 'core'; // Plugin name (core mailer is special case) Must be directory for this file
|
||||
//public $mailerSource = 'core'; // Plugin name (core mailer is special case) Must be directory for this file
|
||||
public $mailerName = LAN_MAILOUT_68; // Text to identify the source of selector (displayed on left of admin page)
|
||||
public $mailerEnabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
|
||||
// protected $adminHandler = NULL; // Filled in with the name of the admin handler on creation
|
||||
|
||||
// List of fields used by selectors
|
||||
private $selectFields = array('email_to',
|
||||
@@ -79,16 +76,18 @@ class core_mailout
|
||||
/**
|
||||
* Return data representing the user's selection criteria as entered in the $_POST array.
|
||||
*
|
||||
* This is stored in the DB with a saved email. (Just return an empty string or array if this is undesirable)
|
||||
* The value returned can be as simple as an array of chosen fields from the $_POST array, or it may be processed to make it more
|
||||
* convenient to use later. (In general, at least basic sanitising should be performed)
|
||||
* Conflicting selection criteria can also be resolved here.
|
||||
* The returned data is stored in the DB with a saved email. (Just return an empty string or array if this is undesirable)
|
||||
* The returned value is passed back to selectInit() and showSelect when needed.
|
||||
*
|
||||
* @return Selection data - may be string, array or whatever suits
|
||||
* @return mixed Selection data - may be string, array or whatever suits
|
||||
*/
|
||||
public function returnSelectors()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
$res = array();
|
||||
foreach ($this->selectFields as $k)
|
||||
{
|
||||
@@ -106,15 +105,14 @@ class core_mailout
|
||||
* Needs to save any queries or other information into internal variables, do initial DB queries as appropriate.
|
||||
* Could in principle read all addresses and buffer them for later routines, if this is more convenient
|
||||
*
|
||||
* @param $selectVals - array of selection criteria as returned by returnSelectors()
|
||||
* @param mixed $selectVals - selection criteria as returned by returnSelectors() (so format is whatever is chosen by the coder)
|
||||
*
|
||||
* @return Return number of records available (or 1 if unknown) on success, FALSE on failure
|
||||
* @return int|boolean number of records available (or 1 if unknown) on success, FALSE on failure
|
||||
*/
|
||||
public function selectInit($selectVals = FALSE)
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
|
||||
|
||||
$where = array();
|
||||
$incExtended = array();
|
||||
if ($selectVals === FALSE)
|
||||
@@ -215,9 +213,9 @@ class core_mailout
|
||||
|
||||
|
||||
/**
|
||||
* Return an email address to add to the recipients list. Return FALSE if no more addresses to add
|
||||
* Return one email address to add to the recipients list. Return FALSE if no more addresses to add
|
||||
*
|
||||
* @return FALSE if no more addresses available; else an array:
|
||||
* @return boolean|array FALSE if no more addresses available; else an array:
|
||||
* 'mail_recipient_id' - non-zero if a registered user, zero if a non-registered user. (Always non-zero from this class)
|
||||
* 'mail_recipient_name' - user name
|
||||
* 'mail_recipient_email' - email address to use
|
||||
@@ -245,16 +243,17 @@ class core_mailout
|
||||
}
|
||||
|
||||
|
||||
// Called once all email addresses read, to do any housekeeping needed
|
||||
/**
|
||||
* Called once all email addresses read, to do any housekeeping needed
|
||||
*
|
||||
* @return none
|
||||
*/
|
||||
public function select_close()
|
||||
{
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
|
||||
// Called to show current selection criteria, and optionally allow edit
|
||||
//
|
||||
//
|
||||
/**
|
||||
* Called to show current selection criteria, and optionally allow edit
|
||||
*
|
||||
@@ -272,10 +271,6 @@ class core_mailout
|
||||
$var = array();
|
||||
|
||||
$var[0]['caption'] = LAN_MAILOUT_03; // User class select
|
||||
$var[1]['caption'] = LAN_MAILOUT_46; // User Search Field.
|
||||
$var[2]['caption'] = LAN_MAILOUT_56; // User last visit
|
||||
$var[3]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||
$var[4]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||
|
||||
if ($allow_edit)
|
||||
{
|
||||
@@ -283,40 +278,58 @@ class core_mailout
|
||||
|
||||
$var[0]['html'] = $admin->userClassesTotals('email_to', varset($selectVals['email_to'], ''));
|
||||
$var[1]['html'] = $frm->selectbox('user_search_name', $u_array, varset($selectVals['user_search_name'], ''),'',TRUE)." ".LAN_MAILOUT_47." ".$frm->text('user_search_value', varset($selectVals['user_search_value'], ''));
|
||||
$var[2]['html'] = $admin->comparisonSelect('last_visit_match', varset($selectVals['last_visit_match'], ''))." ".$frm->text('last_visit_date', varset($selectVals['last_visit_date'], 0));
|
||||
$var[2]['html'] = $admin->comparisonSelect('last_visit_match', varset($selectVals['last_visit_match'], ''))." ".$frm->text('last_visit_date', varset($selectVals['last_visit_date'], 0)); // FIXME: Should include date selector
|
||||
$var[3]['html'] = $admin->ret_extended_field_list('extended_1_name', varset($selectVals['extended_1_name'], ''), TRUE).LAN_MAILOUT_48." ".$frm->text('extended_1_value',varset($selectVals['extended_1_value'], ''));
|
||||
$var[4]['html'] = $admin->ret_extended_field_list('extended_2_name', varset($selectVals['extended_2_name'], ''), TRUE).LAN_MAILOUT_48." ".$frm->text('extended_2_value',varset($selectVals['extended_2_value'],''));
|
||||
|
||||
$var[1]['caption'] = LAN_MAILOUT_46; // User Search Field.
|
||||
$var[2]['caption'] = LAN_MAILOUT_56; // User last visit
|
||||
$var[3]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||
$var[4]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||
}
|
||||
else // Display existing values
|
||||
{
|
||||
if(!vartrue($selectVals['email_to']))
|
||||
if (!vartrue($selectVals['email_to']))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(is_numeric($selectVals['email_to']))
|
||||
if (is_numeric($selectVals['email_to']))
|
||||
{
|
||||
$sql->db_Select('userclass_classes', 'userclass_name', "userclass_id = ".intval($selectVals['email_to']));
|
||||
$row = $sql->db_Fetch();
|
||||
$_to = LAN_MAILOUT_23.$row['userclass_name'];
|
||||
$_to = LAN_MAILOUT_23.e107::getUserClass()->uc_get_classname(intval($selectVals['email_to']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$_to = $selectVals['email_to'];
|
||||
}
|
||||
|
||||
$var_0 = $_to." ";
|
||||
if($selectVals['email_to'] == "self")
|
||||
$var_0 = $_to.' ';
|
||||
if ($selectVals['email_to'] == 'self')
|
||||
{
|
||||
$var_0 .= "<".USEREMAIL.">";
|
||||
$var_0 .= '<'.USEREMAIL.'>';
|
||||
}
|
||||
|
||||
$var[0]['html'] = $var_0;
|
||||
$var[1]['html'] = vartrue($selectVals['user_search_name'])." ". vartrue($selectVals['user_search_value']);
|
||||
$var[2]['html'] = vartrue($selectVals['last_visit_match']).' '.gmstrftime("%D-%M-%Y",vartrue($selectVals['last_visit_date'])); //FIXME use e107 date function.
|
||||
$var[3]['html'] = vartrue($selectVals['extended_1_name']).' '.vartrue($selectVals['extended_1_value']);
|
||||
$var[4]['html'] = vartrue($selectVals['extended_2_name']).' '.vartrue($selectVals['extended_2_value']);
|
||||
if (vartrue($selectVals['user_search_name']) && vartrue($selectVals['user_search_value']))
|
||||
{
|
||||
$var[1]['html'] = $selectVals['user_search_name'].' '.$selectVals['user_search_value'];
|
||||
$var[1]['caption'] = LAN_MAILOUT_46; // User Search Field.
|
||||
}
|
||||
if (vartrue($selectVals['last_visit_match']) && vartrue($selectVals['last_visit_date']))
|
||||
{
|
||||
$var[2]['html'] = $selectVals['last_visit_match'].' '.gmstrftime("%D-%M-%Y",$selectVals['last_visit_date']); //FIXME use e107 date function.
|
||||
$var[2]['caption'] = LAN_MAILOUT_56; // User last visit
|
||||
}
|
||||
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
|
||||
{
|
||||
$var[3]['html'] = $selectVals['extended_1_name'].' '.$selectVals['extended_1_value'];
|
||||
$var[3]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||
}
|
||||
if (vartrue($selectVals['extended_2_name']) && vartrue($selectVals['extended_2_value']))
|
||||
{
|
||||
$var[4]['html'] = $selectVals['extended_2_name'].' '.$selectVals['extended_2_value'];
|
||||
$var[4]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -2,21 +2,26 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
* User class functions
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $
|
||||
* $Revision: 1.47 $
|
||||
* $Date: 2009-12-07 20:43:37 $
|
||||
* $Revision: 1.48 $
|
||||
* $Date: 2010-01-11 21:09:31 $
|
||||
* $Author: e107steved $
|
||||
*/
|
||||
|
||||
/*
|
||||
This class handles everything a user needs. Admin functions inherit from it.
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage e107_handlers
|
||||
* @version $Id: userclass_class.php,v 1.48 2010-01-11 21:09:31 e107steved Exp $;
|
||||
*
|
||||
* This class handles all user-related user class functions. Admin functions inherit from it.
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
@@ -90,11 +95,12 @@ class user_class
|
||||
|
||||
|
||||
/**
|
||||
Ensure the tree of userclass data is stored in our object ($this->class_tree).
|
||||
Only read if its either not present, or the $force flag is set.
|
||||
Data is cached if enabled
|
||||
@param boolean $force - set to TRUE to force a re-read of the info regardless.
|
||||
@return none
|
||||
* Ensure the tree of userclass data is stored in our object ($this->class_tree).
|
||||
* Only read if its either not present, or the $force flag is set.
|
||||
* Data is cached if enabled
|
||||
*
|
||||
* @param boolean $force - set to TRUE to force a re-read of the info regardless.
|
||||
* @return none
|
||||
*/
|
||||
protected function readTree($force = FALSE)
|
||||
{
|
||||
@@ -232,7 +238,8 @@ class user_class
|
||||
|
||||
|
||||
|
||||
/** Combines the selected editable classes into the main class list for a user.
|
||||
/**
|
||||
* Combines the selected editable classes into the main class list for a user.
|
||||
* @param array|string $combined - the complete list of current class memberships
|
||||
* @param array|string $possible - the classes which are being edited
|
||||
* @param array|string $actual - the actual membership of the editable classes
|
||||
@@ -399,7 +406,9 @@ class user_class
|
||||
|
||||
|
||||
|
||||
/** Generate an ordered array classid=>classname - used for dropdown and check box lists
|
||||
/**
|
||||
* Generate an ordered array classid=>classname - used for dropdown and check box lists
|
||||
*
|
||||
* @param string $optlist - comma-separated list of classes/class types to include (see uc_dropdown for details)
|
||||
* @param boolean $just_ids - if TRUE, each returned array value is '1'; otherwise it is the class name
|
||||
* @return array of user classes; ky is numeric class id, value is '1' or class name according to $just_ids
|
||||
@@ -483,11 +492,13 @@ class user_class
|
||||
|
||||
/**
|
||||
* Very similar to self::uc_dropdown, but returns a list of check boxes. Doesn't encapsulate it.
|
||||
*
|
||||
* @param string $fieldname is the name for the array of checkboxes
|
||||
* @param string $curval is a comma separated list of class IDs for boxes which are checked.
|
||||
* @param string $optlist as for uc_dropdown
|
||||
* @param boolean $showdescription - if TRUE, appends the class description in brackets
|
||||
* @param boolean $asArray - if TRUE, result returned as array; otherwise result returned as string
|
||||
*
|
||||
* return string|array according to $asArray
|
||||
*/
|
||||
public function uc_checkboxes($fieldname, $curval='', $optlist = '', $showdescription = FALSE, $asArray = FALSE)
|
||||
@@ -513,7 +524,7 @@ class user_class
|
||||
|
||||
|
||||
/**
|
||||
* Used by @see vetted_tree() to generate lower levels of tree
|
||||
* Used by @see{vetted_tree()} to generate lower levels of tree
|
||||
*/
|
||||
protected function vetted_sub_tree($treename, $callback,$listnum,$nest_level,$current_value, $perms, $opt_options)
|
||||
{
|
||||
|
@@ -2,16 +2,16 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Site Maintenance
|
||||
* Event calendar - mailout function
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_mailout.php,v $
|
||||
* $Revision: 1.10 $
|
||||
* $Date: 2010-01-10 06:20:43 $
|
||||
* $Author: e107coders $
|
||||
* $Revision: 1.11 $
|
||||
* $Date: 2010-01-11 21:09:35 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* @package e107_plugins
|
||||
* @subpackage event_calendar
|
||||
* @version $Id: e_mailout.php,v 1.10 2010-01-10 06:20:43 e107coders Exp $;
|
||||
* @version $Id: e_mailout.php,v 1.11 2010-01-11 21:09:35 e107steved Exp $;
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit(); }
|
||||
@@ -41,7 +41,7 @@ class calendar_menu_mailout
|
||||
{
|
||||
protected $mailCount = 0;
|
||||
protected $mailRead = 0;
|
||||
public $mailerSource = 'calendar_menu'; //FIXME should be auto-detected // Plugin name (core mailer is special case) Must be directory for this file
|
||||
//public $mailerSource = 'calendar_menu'; //FIXME should be auto-detected // Plugin name (core mailer is special case) Must be directory for this file
|
||||
public $mailerName = LAN_EC_MAIL_01; // Text to identify the source of selector (displayed on left of admin page)
|
||||
public $mailerEnabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
|
||||
private $selectorActive = FALSE; // Set TRUE if we've got a valid selector to start returning entries
|
||||
@@ -139,16 +139,19 @@ class calendar_menu_mailout
|
||||
}
|
||||
|
||||
|
||||
// Called once all email addresses read, to do any housekeeping needed
|
||||
|
||||
/**
|
||||
* Called once all email addresses read, to do any housekeeping needed
|
||||
*
|
||||
* @return none
|
||||
*/
|
||||
public function select_close()
|
||||
{
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
|
||||
// Called to show current selection criteria, and optionally allow edit
|
||||
//
|
||||
//
|
||||
|
||||
/**
|
||||
* Called to show current selection criteria, and optionally allow edit
|
||||
*
|
||||
@@ -181,8 +184,8 @@ class calendar_menu_mailout
|
||||
}
|
||||
elseif($checked)
|
||||
{
|
||||
$var[$c]['caption'] = $row['event_cat_name'];
|
||||
$var[$c]['html'] = LAN_EC_MAIL_03;
|
||||
$var[$c]['html'] = $row['event_cat_name'];
|
||||
$var[$c]['caption'] = LAN_EC_MAIL_03;
|
||||
|
||||
/*$ret .= "<tr><td>".LAN_EC_MAIL_03."</td><td>
|
||||
".$row['event_cat_name']."</td></tr>";*/
|
||||
|
@@ -2,29 +2,37 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Site Maintenance
|
||||
* Newsletter plugin - mailout function
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/newsletter/e_mailout.php,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2010-01-10 06:20:46 $
|
||||
* $Author: e107coders $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2010-01-11 21:09:52 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* e107 Newsletter plugin
|
||||
*
|
||||
* @package e107_plugins
|
||||
* @subpackage event_calendar
|
||||
* @version $Id: e_mailout.php,v 1.5 2010-01-11 21:09:52 e107steved Exp $;
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
|
||||
include_lan(e_PLUGIN.'/newsletter/languages/English_admin_newsletter.php');
|
||||
|
||||
/*
|
||||
Class for event calendar mailout function
|
||||
Class for newsletter mailout function
|
||||
|
||||
Allows admins to send mail to those subscribed to calendar events
|
||||
Allows admins to send mail to those subscribed to one or more newsletters
|
||||
*/
|
||||
// These variables determine the circumstances under which this class is loaded (only used during loading, and may be overwritten later)
|
||||
$mailerIncludeWithDefault = TRUE; // Mandatory - if false, show only when mailout for this specific plugin is enabled
|
||||
@@ -34,7 +42,7 @@ class newsletter_mailout
|
||||
{
|
||||
protected $mailCount = 0;
|
||||
protected $mailRead = 0;
|
||||
public $mailerSource = 'newsletter'; // Plugin name (core mailer is special case) Must be directory for this file
|
||||
//public $mailerSource = 'newsletter'; // Plugin name (core mailer is special case) Must be directory for this file
|
||||
public $mailerName = NLLAN_48; // Text to identify the source of selector (displayed on left of admin page)
|
||||
public $mailerEnabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
|
||||
private $selectorActive = FALSE; // Set TRUE if we've got a valid selector to start returning entries
|
||||
|
Reference in New Issue
Block a user