[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [ENH] Use HTML content of the email for events created through Cypht
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <690b7007de385_2ce266c29240@gitlab-sidekiq-low-urgency-cpu-bound-v2-675f7f6dbf-krnpd.mail> |
Victor Emanouilov pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki
Commits:
234c438f by Merci Jacob at 2025-11-05T15:31:55+00:00
[ENH] Use HTML content of the email for events created through Cypht
---
* spare the utilities of the description overriding
* [ENH] Use HTML content of the email for events created through Cypht
See merge request tikiwiki/tiki!8620
- - - - -
1 changed file:
- lib/cypht/modules/tiki/calendar_modules.php
Changes:
=====================================
lib/cypht/modules/tiki/calendar_modules.php
=====================================
@@ -29,6 +29,9 @@ class Hm_Handler_check_calendar_invitations_imap extends Hm_Handler_Module
}
if ($this->get('calendar_event_raw')) {
$event = Tiki\SabreDav\Utilities::getDenormalizedData($this->get('calendar_event_raw'));
+ if ($this->get('formatted_calendar_event_description')) {
+ $event['description'] = $this->get('formatted_calendar_event_description');
+ }
$this->out('calendar_event', $event);
} else {
$event = null;
@@ -534,14 +537,18 @@ class Hm_Output_add_rsvp_actions extends Hm_Output_Module
if (! hm_exists('get_calendar_part_imap')) {
function get_calendar_part_imap($struct, $mod)
{
- $event = $method = null;
+ $event = $method = $html = null;
$part = false;
+ $htmlPart = false;
foreach ($struct as $id => $vals) {
if (is_array($vals) && isset($vals['type'])) {
if ($vals['type'] . '/' . $vals['subtype'] == 'text/calendar') {
$part = $id;
$method = $vals['attributes']['method'];
}
+ if ($vals['type'] . '/' . $vals['subtype'] == 'text/html') {
+ $htmlPart = $id;
+ }
if (isset($vals['subs'])) {
return get_calendar_part_imap($vals['subs'], $mod);
}
@@ -559,9 +566,15 @@ if (! hm_exists('get_calendar_part_imap')) {
$mailbox = Hm_IMAP_List::get_connected_mailbox($form['imap_server_id'], $mod->cache);
if ($mailbox->authed()) {
$event = $mailbox->get_structured_message(hex2bin($form['folder']), $form['imap_msg_uid'], $part, true)[2];
+ if ($htmlPart) {
+ $html = $mailbox->get_structured_message(hex2bin($form['folder']), $form['imap_msg_uid'], $htmlPart, true)[2];
+ $html = sanitize_email_html($html);
+ $html = format_msg_html($html);
+ }
}
}
$mod->out('calendar_method', $method);
$mod->out('calendar_event_raw', $event);
+ $mod->out('formatted_calendar_event_description', $html);
}
}
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/234c438f352bd54f0f7b583b188888f092b5a340
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/234c438f352bd54f0f7b583b188888f092b5a340
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs