示例#1
0
 public function asHtml(ElementNode $el)
 {
     $content = '';
     foreach ($el->getChildren() as $child) {
         $content .= $child->getAsText();
     }
     $param = $el->getAttribute();
     if (is_array($param)) {
         $param = array_shift($param);
     }
     $param = trim($param);
     if ($content == '' and $param == '') {
         return '';
     }
     if ($param == '') {
         // Die Email steht im Content
         $email = '';
         foreach ($el->getChildren() as $child) {
             $email .= $child->getAsText();
         }
     } else {
         // Die Email steht im Parameter
         $email = $param;
         $content = '';
         foreach ($el->getChildren() as $child) {
             $content .= $child->getAsHTML();
         }
     }
     // Nur Content anzeigen, wenn keine gültige Email angegeben wurde
     if (!$this->config->getValidation()->isValidEmail($email)) {
         return $content;
     }
     // Mail vor Bots schützen?
     if ($this->config->get('callbacks.email_content.protect_email')) {
         return Html::mail_to_safe($email, $content);
     }
     return Html::mail_to($email, $content);
 }