From be83855acf2db7f4f55d4cb30878c67d53ca69b6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 17 Jan 2016 16:50:37 -0800 Subject: generalise the site icon --- boot.php | 15 +++++++++++++ include/enotify.php | 1 + include/network.php | 49 +++++++++++++++++++++--------------------- view/tpl/email_notify_html.tpl | 2 +- view/tpl/oexchange_xrd.tpl | 12 +++++------ 5 files changed, 48 insertions(+), 31 deletions(-) diff --git a/boot.php b/boot.php index f6e35cf4e..143d7de46 100755 --- a/boot.php +++ b/boot.php @@ -2361,3 +2361,18 @@ function get_update_version() { return DB_UPDATE_VERSION; } + +function get_notify_icon() { + $a = get_app(); + if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['email_notify_icon_url']) + return $a->config['system']['email_notify_icon_url']; + return z_root() . '/images/hz-white-32.png'; +} + +function get_site_icon() { + $a = get_app(); + if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['site_icon_url']) + return $a->config['system']['site_icon_url']; + return z_root() . '/images/hz-32.png'; +} + diff --git a/include/enotify.php b/include/enotify.php index c9b6e0463..5bb53aa0e 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -529,6 +529,7 @@ function notification($params) { $tpl = get_markup_template('email_notify_html.tpl'); $email_html_body = replace_macros($tpl,array( '$banner' => $datarray['banner'], + '$notify_icon' => get_notify_icon(), '$product' => $datarray['product'], '$preamble' => $datarray['preamble'], '$sitename' => $datarray['sitename'], diff --git a/include/network.php b/include/network.php index 2e34bd7ff..fe6b553e9 100644 --- a/include/network.php +++ b/include/network.php @@ -1619,18 +1619,19 @@ function format_and_send_email($sender,$xchan,$item) { // load the template for private message notifications $tpl = get_markup_template('email_notify_html.tpl'); $email_html_body = replace_macros($tpl,array( - '$banner' => $banner, - '$product' => $product, - '$preamble' => '', - '$sitename' => $sitename, - '$siteurl' => $siteurl, + '$banner' => $banner, + '$notify_icon' => get_notify_icon(), + '$product' => $product, + '$preamble' => '', + '$sitename' => $sitename, + '$siteurl' => $siteurl, '$source_name' => $sender['xchan_name'], '$source_link' => $sender['xchan_url'], '$source_photo' => $sender['xchan_photo_m'], - '$username' => $xchan['xchan_name'], + '$username' => $xchan['xchan_name'], '$hsitelink' => $datarray['hsitelink'], '$hitemlink' => $datarray['hitemlink'], - '$thanks' => $thanks, + '$thanks' => $thanks, '$site_admin' => $site_admin, '$title' => $title, '$htmlversion' => $htmlversion, @@ -1639,20 +1640,20 @@ function format_and_send_email($sender,$xchan,$item) { // load the template for private message notifications $tpl = get_markup_template('email_notify_text.tpl'); $email_text_body = replace_macros($tpl, array( - '$banner' => $banner, - '$product' => $product, - '$preamble' => '', - '$sitename' => $sitename, - '$siteurl' => $siteurl, + '$banner' => $banner, + '$product' => $product, + '$preamble' => '', + '$sitename' => $sitename, + '$siteurl' => $siteurl, '$source_name' => $sender['xchan_name'], '$source_link' => $sender['xchan_url'], '$source_photo' => $sender['xchan_photo_m'], - '$username' => $xchan['xchan_name'], - '$hsitelink' => $datarray['hsitelink'], - '$hitemlink' => $datarray['hitemlink'], - '$thanks' => $thanks, + '$username' => $xchan['xchan_name'], + '$hsitelink' => $datarray['hsitelink'], + '$hitemlink' => $datarray['hitemlink'], + '$thanks' => $thanks, '$site_admin' => $site_admin, - '$title' => $title, + '$title' => $title, '$textversion' => $textversion )); @@ -1666,13 +1667,13 @@ function format_and_send_email($sender,$xchan,$item) { // use the EmailNotification library to send the message enotify::send(array( - 'fromName' => $product, - 'fromEmail' => $sender_email, - 'replyTo' => $sender_email, - 'toEmail' => str_replace('mailto:','',$xchan['xchan_addr']), - 'messageSubject' => (($title) ? $title : t('No Subject')), - 'htmlVersion' => $email_html_body, - 'textVersion' => $email_text_body, + 'fromName' => $product, + 'fromEmail' => $sender_email, + 'replyTo' => $sender_email, + 'toEmail' => str_replace('mailto:','',$xchan['xchan_addr']), + 'messageSubject' => (($title) ? $title : t('No Subject')), + 'htmlVersion' => $email_html_body, + 'textVersion' => $email_text_body, 'additionalMailHeader' => '', )); diff --git a/view/tpl/email_notify_html.tpl b/view/tpl/email_notify_html.tpl index a2159c885..61ede1ca2 100755 --- a/view/tpl/email_notify_html.tpl +++ b/view/tpl/email_notify_html.tpl @@ -7,7 +7,7 @@ - + diff --git a/view/tpl/oexchange_xrd.tpl b/view/tpl/oexchange_xrd.tpl index 74ef22874..e865e07d9 100755 --- a/view/tpl/oexchange_xrd.tpl +++ b/view/tpl/oexchange_xrd.tpl @@ -4,23 +4,23 @@ {{$base}}Friendika + type="http://www.oexchange.org/spec/0.8/prop/vendor">ZotlabsFriendika Social Network + type="http://www.oexchange.org/spec/0.8/prop/title">HubzillaFriendika + type="http://www.oexchange.org/spec/0.8/prop/name">HubzillaSend to Friendika + type="http://www.oexchange.org/spec/0.8/prop/prompt">Send to Hubzilla -- cgit v1.2.3
{{$product}}
{{$product}}
{{$preamble}}