@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | * @param object $_preferences |
| 67 | 67 | */ |
| 68 | 68 | public function __construct($_sender, $_recipient, $_config = null, $_preferences = null) { |
| 69 | - if(!is_object($_sender)) { throw new Exception("no sender given."); } |
|
| 70 | - if(!is_object($_recipient)) { throw new Exception("no recipient given."); } |
|
| 69 | + if (!is_object($_sender)) { throw new Exception("no sender given."); } |
|
| 70 | + if (!is_object($_recipient)) { throw new Exception("no recipient given."); } |
|
| 71 | 71 | $this->sender = $_sender; |
| 72 | 72 | $this->recipient = $_recipient; |
| 73 | 73 | $this->config = $_config; |
| 74 | 74 | $this->preferences = $_preferences; |
| 75 | - if(is_object($this->mail)) |
|
| 75 | + if (is_object($this->mail)) |
|
| 76 | 76 | { |
| 77 | 77 | unset($this->mail); |
| 78 | 78 | } |
@@ -109,18 +109,18 @@ discard block |
||
| 109 | 109 | // embed images as inline |
| 110 | 110 | \EGroupware\Api\Mail::processURL2InlineImages($this->mail, $body_html, null); |
| 111 | 111 | } |
| 112 | - $this->mail->setHtmlBody($body_html, null, false); // no automatic alternativ |
|
| 112 | + $this->mail->setHtmlBody($body_html, null, false); // no automatic alternativ |
|
| 113 | 113 | $this->mail->setBody($body_plain); |
| 114 | 114 | |
| 115 | - if(is_array($_attachments) && count($_attachments) > 0) |
|
| 115 | + if (is_array($_attachments) && count($_attachments) > 0) |
|
| 116 | 116 | { |
| 117 | - foreach($_attachments as $attachment) |
|
| 117 | + foreach ($_attachments as $attachment) |
|
| 118 | 118 | { |
| 119 | 119 | if ($attachment->string) |
| 120 | 120 | { |
| 121 | 121 | $this->mail->AddStringAttachment($attachment->string, $attachment->filename, $attachment->encoding, $attachment->type); |
| 122 | 122 | } |
| 123 | - elseif($attachment->path) |
|
| 123 | + elseif ($attachment->path) |
|
| 124 | 124 | { |
| 125 | 125 | $this->mail->AddAttachment($attachment->path, $attachment->filename, $attachment->encoding, $attachment->type); |
| 126 | 126 | } |
@@ -139,20 +139,20 @@ discard block |
||
| 139 | 139 | * @return plain or html rendered link(s) as complete string |
| 140 | 140 | */ |
| 141 | 141 | private function render_links($_links = false, $_render_html = false, $_render_external = true) { |
| 142 | - if(!is_array($_links) || count($_links) == 0) { return false; } |
|
| 142 | + if (!is_array($_links) || count($_links) == 0) { return false; } |
|
| 143 | 143 | |
| 144 | 144 | // provide defaults if given arguments are null |
| 145 | 145 | // php distinguishes between missing and present(null) arguments |
| 146 | - if(is_null($_render_html)) { $_render_html = false; } |
|
| 147 | - if(is_null($_render_external)) { $_render_external = true; } |
|
| 146 | + if (is_null($_render_html)) { $_render_html = false; } |
|
| 147 | + if (is_null($_render_external)) { $_render_external = true; } |
|
| 148 | 148 | $newline = $_render_html ? "<br />" : "\n"; |
| 149 | 149 | $hruler = $_render_html ? Api\Html::hr() : ''; |
| 150 | 150 | |
| 151 | 151 | $rendered_links = array(); |
| 152 | - foreach($_links as $link) { |
|
| 153 | - if($_render_external || ! $link->popup) { $link->view['no_popup'] = 1; } |
|
| 152 | + foreach ($_links as $link) { |
|
| 153 | + if ($_render_external || !$link->popup) { $link->view['no_popup'] = 1; } |
|
| 154 | 154 | // do not expose sensitive data |
| 155 | - $url = preg_replace('/(sessionid|kp3|domain)=[^&]+&?/','',Api\Html::link('/index.php', $link->view)); |
|
| 155 | + $url = preg_replace('/(sessionid|kp3|domain)=[^&]+&?/', '', Api\Html::link('/index.php', $link->view)); |
|
| 156 | 156 | // complete missing protocol and domain part if needed |
| 157 | 157 | if ($url{0} == '/' && $_render_external) { |
| 158 | 158 | $url = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://'). |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $rendered_links[] = $_render_html ? $a_href : $url; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - return $hruler.$newline.lang('Linked entries:').$newline.implode($newline,$rendered_links); |
|
| 165 | + return $hruler.$newline.lang('Linked entries:').$newline.implode($newline, $rendered_links); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | } |