enhance formatting of studygroup-summary token
This commit is contained in:
@@ -1612,44 +1612,56 @@ function _booking_studygroup_email_summary($node) {
|
|||||||
$rows = array();
|
$rows = array();
|
||||||
|
|
||||||
//display study session data if enabled
|
//display study session data if enabled
|
||||||
if (variable_get('booking_enable_studygroups', 0) == 1)
|
if (variable_get('booking_enable_studygroups', 0) == 0) {
|
||||||
{
|
return implode("\n", $rows);
|
||||||
//look up the titles of the study groups
|
}
|
||||||
$studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid",
|
|
||||||
array(':eid' => $event->eid));
|
|
||||||
$studygroups = $studygroups_query->fetchAllAssoc('sid');
|
|
||||||
|
|
||||||
//for ($i = 1; $i <= variable_get('booking_studygroup_count','0'); $i++)
|
//look up the titles of the study groups
|
||||||
foreach ($studygroups as $studygroup) {
|
$studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid",
|
||||||
//calculate the session references
|
array(':eid' => $event->eid));
|
||||||
$sessionid = "session" . $studygroup->sid;
|
$studygroups = $studygroups_query->fetchAllAssoc('sid');
|
||||||
$roleid = $sessionid . "_role";
|
|
||||||
|
foreach ($studygroups as $studygroup) {
|
||||||
//check that this study group session has been defined for this attendee
|
//calculate the session references
|
||||||
if (!empty($node->$sessionid)) {
|
$sessionid = "session" . $studygroup->sid;
|
||||||
//$rows[] = t($studygroup->booking_studygroup_descrip . ": Group " . $node->$sessionid . ", " . _booking_studygroup_role_lookup($node->$roleid));
|
$roleid = $sessionid . "_role";
|
||||||
|
|
||||||
|
//check that this study group session has been defined for this attendee
|
||||||
|
if (!empty($node->$sessionid)) {
|
||||||
|
//$rows[] = t($studygroup->booking_studygroup_descrip . ": Group " . $node->$sessionid . ", " . _booking_studygroup_role_lookup($node->$roleid));
|
||||||
|
|
||||||
|
// Add some boldness if we're using html email
|
||||||
|
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||||
|
$rows[] = t('<b>!role</b> for group <b>!descrip</b>, which will occur on <b>!weekday</b>. <b>!explan</b>', array(
|
||||||
|
'!descrip' => $studygroup->booking_studygroup_descrip, '!weekday' => $studygroup->booking_studygroup_weekday,
|
||||||
|
'!explan' => $studygroup->booking_studygroup_explanation, '!role' => _booking_studygroup_role_lookup($node->$roleid),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
// Otherwise just leave things plain
|
||||||
|
else {
|
||||||
$rows[] = t('!role for group !descrip, which will occur on !weekday. !explan', array(
|
$rows[] = t('!role for group !descrip, which will occur on !weekday. !explan', array(
|
||||||
'!descrip' => $studygroup->booking_studygroup_descrip, '!weekday' => $studygroup->booking_studygroup_weekday,
|
'!descrip' => $studygroup->booking_studygroup_descrip, '!weekday' => $studygroup->booking_studygroup_weekday,
|
||||||
'!explan' => $studygroup->booking_studygroup_explanation, '!role' => _booking_studygroup_role_lookup($node->$roleid),
|
'!explan' => $studygroup->booking_studygroup_explanation, '!role' => _booking_studygroup_role_lookup($node->$roleid),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
} // End checking for empty studygroup session
|
||||||
}
|
} // End foreach loop
|
||||||
|
|
||||||
foreach ($rows as $key => $value) {
|
foreach ($rows as $key => $value) {
|
||||||
$rows[$key] = wordwrap($value);
|
$rows[$key] = wordwrap($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||||
|
// Turn the rows into an unordered list
|
||||||
$output = "\n<ul>\n";
|
$output = "\n<ul>\n";
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$output .= "\t<li>$row</li>\n";
|
$output .= "\t<li>$row</li>\n";
|
||||||
}
|
}
|
||||||
$output .= "</ul>\n";
|
$output .= "</ul>\n";
|
||||||
//return implode("\n<br />", $rows);
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// Plain text so just separate by newline
|
||||||
return implode("\n", $rows);
|
return implode("\n", $rows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user