*/
public function formatStatusMsg($data)
{
- if (empty($data)) {
- return '';
- }
+ $out = '';
- $class = 'mimeStatusMessage';
+ foreach ($data as $val) {
+ if (empty($val)) {
+ continue;
+ }
- $out = array('<div><table ' . (isset($data['id']) ? ('id="' . $data['id'] . '" ') : '') . 'class="' . $class . '">');
+ $out .= '<div><table ' . (isset($val['id']) ? ('id="' . $val['id'] . '" ') : '') . 'class="mimeStatusMessage">';
- /* If no image, simply print out the message. */
- if (empty($data['icon'])) {
- foreach ($data['text'] as $val) {
- $out[] = '<tr><td>' . $val . '</td></tr>';
- }
- } else {
- $out[] = '<tr><td class="mimeStatusIcon">' . $data['icon'] . '</td><td><table>';
- foreach ($data['text'] as $val) {
- $out[] = '<tr><td>' . $val . '</td></tr>';
+ /* If no image, simply print out the message. */
+ if (empty($val['icon'])) {
+ foreach ($val['text'] as $val) {
+ $out .= '<tr><td>' . $val . '</td></tr>';
+ }
+ } else {
+ $out .= '<tr><td class="mimeStatusIcon">' . $val['icon'] . '</td><td><table>';
+ foreach ($val['text'] as $val) {
+ $out .= '<tr><td>' . $val . '</td></tr>';
+ }
+ $out .= '</table></td></tr>';
}
- $out[] = '</table></td></tr>';
+
+ $out .= '</table></div>';
}
- return implode("\n", $out) . "\n</table></div>\n";
+ return $out;
}
/**
/* Do MDN processing now. */
if ($imp_ui->MDNCheck($mailbox, $uid, $mime_headers)) {
- $result['msgtext'] .= $imp_ui->formatStatusMsg(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link('', '', '', '', 'DimpCore.doAction(\'SendMDN\',{folder:\'' . $mailbox . '\',uid:' . $uid . '}); return false;', '', '') . _("HERE") . '</a>'))));
+ $result['msgtext'] .= $imp_ui->formatStatusMsg(array(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link('', '', '', '', 'DimpCore.doAction(\'SendMDN\',{folder:\'' . $mailbox . '\',uid:' . $uid . '}); return false;', '', '') . _("HERE") . '</a>')))));
}
/* Build body text. This needs to be done before we build the
continue;
}
- $tmp_status = array();
-
- foreach ($info['status'] as $val) {
- $tmp_status[] = $imp_ui->formatStatusMsg($val);
- }
-
- $result['msgtext'] .= $imp_ui->formatSummary($imp_contents->getSummary($id, $contents_mask), $part_info_display) . implode("\n", $tmp_status) . $info['data'];
+ $result['msgtext'] .= $imp_ui->formatSummary($imp_contents->getSummary($id, $contents_mask), $part_info_display) .
+ $imp_ui->formatStatusMsg($info['status']) .
+ $info['data'];
if (isset($info['js'])) {
$result['js'] = array_merge($result['js'], $info['js']);
}
if (!strlen($result['msgtext'])) {
- $result['msgtext'] = $imp_ui->formatStatusMsg(array('text' => array(_("There are no parts that can be shown inline."))));
+ $result['msgtext'] = $imp_ui->formatStatusMsg(array(array('text' => array(_("There are no parts that can be shown inline.")))));
}
if (count($atc_parts) ||
/* Do MDN processing now. */
if ($imp_ui->MDNCheck($imp_mbox['mailbox'], $uid, $mime_headers, Horde_Util::getFormData('mdn_confirm'))) {
- $msgtext .= $imp_ui->formatStatusMsg(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link(htmlspecialchars(Horde_Util::addParameter($selfURL, 'mdn_confirm', 1))) . _("HERE") . '</a>'))));
+ $msgtext .= $imp_ui->formatStatusMsg(array(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link(htmlspecialchars(Horde_Util::addParameter($selfURL, 'mdn_confirm', 1))) . _("HERE") . '</a>')))));
}
$show_parts = Horde_Util::getFormData('show_parts', $prefs->getValue('parts_display'));
continue;
}
- $tmp_status = array();
- foreach ($info['status'] as $val) {
- $tmp_status[] = $imp_ui->formatStatusMsg($val);
- }
-
$msgtext .= $imp_ui->formatSummary($imp_contents->getSummary($id, $contents_mask), $part_info_display) .
- implode("\n", $tmp_status) .
+ $imp_ui->formatStatusMsg($info['status']) .
$info['data'];
if (isset($info['js'])) {
}
if (!strlen($msgtext)) {
- $msgtext = $imp_ui->formatStatusMsg(array('text' => array(_("There are no parts that can be shown inline."))));
+ $msgtext = $imp_ui->formatStatusMsg(array(array('text' => array(_("There are no parts that can be shown inline.")))));
}
/* Build the Attachments menu. */