1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 20:51:53 +02:00

Admin -> Mail : upgraded GUI to v2 standards. Template still requires attention.

This commit is contained in:
Cameron 2014-10-10 20:16:11 -07:00
parent 31411dc264
commit e378c16971
8 changed files with 1124 additions and 137 deletions

File diff suppressed because it is too large Load Diff

View File

@ -297,6 +297,7 @@ $MONTHLYUPDATE_TEMPLATE = array(
/** Standardized v2 template rewrite
*
* Format for individual emails sent by e107 (not bulk emails for now) - a work in progress - bulk could be ported later.
* @see e107Email::sendEmail();
* Aim: to make email templates follow the same spec. as other templates while remaining as intuitive as other v2 templates in e107.
@ -396,22 +397,35 @@ $EMAIL_TEMPLATE['quickadduser']['footer'] = $EMAIL_TEMPLATE['default']['footer'
// ---------------------------------
// ------- Notify (@see admin-> notify)
// Notify (@see admin-> notify)
$EMAIL_TEMPLATE['notify']['subject'] = '{SITENAME}: {SUBJECT} ';
$EMAIL_TEMPLATE['notify']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
$EMAIL_TEMPLATE['notify']['body'] = $EMAIL_TEMPLATE['default']['body']; // will use default header above.
$EMAIL_TEMPLATE['notify']['footer'] = $EMAIL_TEMPLATE['default']['footer']; // will use default header above.
// ---------------------------------
// ------ User-Mailout Templates
$EMAIL_TEMPLATE['user-monthly']['name'] = 'Monthly Update';
$EMAIL_TEMPLATE['user-monthly']['subject'] = '{SITENAME}: {SUBJECT} ';
$EMAIL_TEMPLATE['user-monthly']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
$EMAIL_TEMPLATE['user-monthly']['body'] = "Just to keep you up to date, here's a reminder of what's changed in the past month.<br />{BODY}<br />To find out more, simply click on the links!";
$EMAIL_TEMPLATE['user-monthly']['footer'] = $EMAIL_TEMPLATE['default']['footer'];
$EMAIL_TEMPLATE['user-whatsnew']['name'] = "What's New";
$EMAIL_TEMPLATE['user-whatsnew']['subject'] = '{SITENAME}: {SUBJECT} ';
$EMAIL_TEMPLATE['user-whatsnew']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
$EMAIL_TEMPLATE['user-whatsnew']['body'] = "All the latest news and updates.<br />{BODY}<br />To find out more, simply click on the links!";
$EMAIL_TEMPLATE['user-whatsnew']['footer'] = $EMAIL_TEMPLATE['default']['footer'];
// A Dummy Example for theme developers.
// ------ A Dummy Example for theme developers.
$EMAIL_TEMPLATE['example']['subject'] = '{SITENAME}: {SUBJECT} ';
$EMAIL_TEMPLATE['example']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
$EMAIL_TEMPLATE['example']['body'] = $EMAIL_TEMPLATE['default']['body']; // will use default header above.
@ -422,4 +436,7 @@ $EMAIL_TEMPLATE['example']['footer'] = "<br /><br />
</body>
</html>";
?>

View File

@ -3984,12 +3984,21 @@ class e_form
}
}
if(!is_array($att['writeParms']))
{
parse_str(varset($att['writeParms']), $writeParms);
}
else
{
$writeParms = $att['writeParms'];
}
if('hidden' === $att['type'])
{
if(!is_array($att['writeParms'])) parse_str(varset($att['writeParms']), $tmp);
else $tmp = $att['writeParms'];
if(!vartrue($tmp['show']))
if(!vartrue($writeParms['show']))
{
continue;
}
@ -4039,12 +4048,13 @@ class e_form
$leftCell = $required."<span{$required_class}>".defset(vartrue($att['title']), vartrue($att['title']))."</span>".$label;
$rightCell = $this->renderElement($keyName, $model->getIfPosted($valPath), $att, varset($model_required[$key], array()), $model->getId())." {$help}";
if(vartrue($att['type']) == 'bbarea')
if(vartrue($att['type']) == 'bbarea' || $writeParms['nolabel'] == true)
{
$text .= "
<tr><td colspan='2'>
<div style='padding-bottom:8px'>".$leftCell."</div>".
$rightCell."
<tr><td colspan='2'>";
$text .= "<div style='padding-bottom:8px'>".$leftCell."</div>";
$text .= $rightCell."
</td>
</tr>

View File

@ -262,8 +262,8 @@ class e107MailManager
$res[$f] = '';
}
}
$array = new ArrayData;
$res['mail_other'] = $array->WriteArray($res1, TRUE); // Ready to write to DB
// $array = new ArrayData;
$res['mail_other'] = e107::serialize($res1, TRUE); // Ready to write to DB
return $res;
}
@ -296,8 +296,8 @@ class e107MailManager
}
if (isset($data['mail_other']))
{
$array = new ArrayData;
$tmp = $array->ReadArray(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
$tmp = e107::unserialize(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
if (is_array($tmp))
{
$res = array_merge($res,$tmp);

View File

@ -473,7 +473,6 @@ class mailoutAdminClass extends e107MailManager
$ret = '';
$tab = '';
$tabc = '';
foreach ($this->mailHandlers as $key => $m)
{
@ -489,7 +488,7 @@ class mailoutAdminClass extends e107MailManager
if(is_array($content))
{
$tabc .= "<table class='table adminform' style='width:100%;margin-left:0px'>
$tabc .= "<table class='table ' style='width:100%;margin-left:0px'>
<colgroup span='2'>
<col class='col-label' />
<col class='col-control' />
@ -498,7 +497,7 @@ class mailoutAdminClass extends e107MailManager
foreach($content as $var)
{
$tabc .= "<tr><td>".$var['caption']."</td><td>".$var['html']."</td></tr>";
$tabc .= "<tr><td style='padding-left:0px'>".$var['caption']."</td><td class='form-inline'>".$var['html']."</td></tr>";
}
$tabc .= "</table>";
}
@ -552,7 +551,7 @@ class mailoutAdminClass extends e107MailManager
*/
public function userClassesTotals($name, $curSel)
{
$fixedClasses = array('all' => LAN_MAILOUT_12,'unverified' => LAN_MAILOUT_13, 'admin' => LAN_MAILOUT_53, 'self' => LAN_MAILOUT_54);
$fixedClasses = array('self' => LAN_MAILOUT_54, 'all' => LAN_MAILOUT_12,'unverified' => LAN_MAILOUT_13, 'admin' => LAN_MAILOUT_53 );
$ret = '';
$this->checkDB(2); // Make sure DB object created
@ -793,7 +792,7 @@ class mailoutAdminClass extends e107MailManager
'texttheme' => LAN_MAILOUT_127
);
$text = "<select class='tbox' name='{$name}'>\n";
$text = "<select class='tbox' name='{$name}' required>\n";
foreach ($emFormat as $key=>$val)
{
@ -856,9 +855,12 @@ class mailoutAdminClass extends e107MailManager
$text .= "<div>
<form method='post' action='".e_SELF."?mode=makemail' id='mailout_form'>
".$this->emailSelector('all', varset($mailSource['mail_selectors'], FALSE))."
<table class='table adminform'>
<form method='post' action='".e_SELF."?mode=makemail' id='mailout_form'>";
$text .= $this->emailSelector('all', varset($mailSource['mail_selectors'], FALSE));
$text .= "<table class='table'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
@ -901,7 +903,7 @@ class mailoutAdminClass extends e107MailManager
<tr>
<td>".LAN_MAILOUT_51.": </td>
<td>".$frm->text('email_subject',varset($email_subject,''))."</td>
<td>".$frm->text('email_subject',varset($email_subject,''),255,'required=1&size=xxlarge')."</td>
</tr>";
@ -999,7 +1001,9 @@ class mailoutAdminClass extends e107MailManager
</form>
</div>";
$ns->tablerender(ADLAN_136.SEP.LAN_MAILOUT_15, $mes->render(). $text); // Render the complete form
return $text;
// $ns->tablerender(ADLAN_136.SEP.LAN_MAILOUT_15, $mes->render(). $text); // Render the complete form
}
@ -1784,6 +1788,22 @@ class mailoutAdminClass extends e107MailManager
public function getEmailTemplateNames($sel = 'all')
{
$ret = array();
$templates = e107::getCoreTemplate('email');
foreach($templates as $key=>$layout)
{
if(substr($key,0,5)== 'user-' || $key == 'default')
{
$ret[$key] = $layout['name'];
}
}
return $ret;
/*
foreach (array(e_CORE.'templates/email_template.php', THEME.'templates/email_template.php') as $templateFileName ) // Override file then defaults
if (is_readable($templateFileName))
{
@ -1805,7 +1825,14 @@ class mailoutAdminClass extends e107MailManager
}
}
}
print_a($ret);
return $ret;
*/
}
}

View File

@ -268,7 +268,7 @@ class core_mailout
$var = array();
$var[0]['caption'] = LAN_MAILOUT_03; // User class select
$var[0]['caption'] = LAN_MAILOUT_260; // LAN_MAILOUT_03; // User class select
if ($allow_edit)
{

View File

@ -37,6 +37,7 @@ $action = e107::getParser()->toDB(varset($_GET['mode'],'makemail'));
break;
case 'savedmail' :
case 'makemail' :
case 'main' :
$text = 'Create an email, give it a meaningful title, and select the list of recipients. You can save everything as a template for later, or send immediately.<br />';
$text .= 'Email addresses may be contributed by plugins (such as newsletter), and duplicates are removed when the mail is sent<br />';
$text .= 'Any attachment is selected from the list of valid downloads.<br />';

View File

@ -22,8 +22,8 @@ define("LAN_MAILOUT_08", "Send Email");
define("LAN_MAILOUT_09", "Send format");
define("LAN_MAILOUT_10", "User Subscribed");
define("LAN_MAILOUT_11", "Insert Variables");
define("LAN_MAILOUT_12", "All Members");
define("LAN_MAILOUT_13", "All Unverified Members ");
define("LAN_MAILOUT_12", "All Users");
define("LAN_MAILOUT_13", "All Unverified Users ");
define("LAN_MAILOUT_14", "Display Name");
define("LAN_MAILOUT_15", "Mailout");
define("LAN_MAILOUT_16", "Username");
@ -279,6 +279,8 @@ define("LAN_MAILOUT_259", "");
define("LAN_SEND", "Send");
define("LAN_HOLD", "Hold");
define("LAN_MAILOUT_260", "User-Type");
//define("LAN_SUBMIT", "Do it!"); LAN_RUN
?>