roundcubemail/plugins/vcard_attachments/vcard_attachments.php
function html_output($p)
    {
        $attach_script = false;

        foreach ($this->vcard_parts as $part) {
            $vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));

            // successfully parsed vcards?
            if (empty($vcards)) {
                continue;
            }

            // remove part's body
            if (in_array($part, $this->vcard_bodies)) {
                $p['content'] = '';
            }

            foreach ($vcards as $idx => $vcard) {
                // skip invalid vCards
                if (empty($vcard->email) || empty($vcard->email[0])) {
                    continue;
                }

                $display = $vcard->displayname . ' <'.$vcard->email[0].'>';

                // add box below message body
                $p['content'] .= html::p(array('class' => 'vcardattachment'),
                    html::a(array(
                        'href'    => "#",
                        'onclick' => "return plugin_vcard_save_contact('" . rcube::JQ($part.':'.$idx) . "')",
                        'title'   => $this->gettext('addvcardmsg'),
                        ),
                        html::span(null, rcube::Q($display)))
                );
            }

            $attach_script = true;
        }

        if ($attach_script) {
            $this->include_script('vcardattach.js');
            $this->include_stylesheet($this->local_skin_path() . '/style.css');
        }

        return $p;
    }
function html_output($p)
    {
        $attach_script = false;

        foreach ($this->vcard_parts as $part) {
            $vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));

            // successfully parsed vcards?
            if (empty($vcards)) {
                continue;
            }

            // remove part's body
            if (in_array($part, $this->vcard_bodies)) {
                $p['content'] = '';
            }

            foreach ($vcards as $idx => $vcard) {
                // skip invalid vCards
                if (empty($vcard->email) || empty($vcard->email[0])) {
                    continue;
                }

                $display = $vcard->displayname . ' <'.$vcard->email[0].'>';

                // add box below message body
                $p['content'] .= html::p(array('class' => 'vcardattachment'),
                    html::a(array(
                        'href'    => "#",
                        'onclick' => "return plugin_vcard_save_contact('" . rcube::JQ($part.':'.$idx) . "')",
                        'title'   => $this->gettext('addvcardmsg'),
                        ),
                        html::span(null, rcube::Q($display)))
                );
            }

            $attach_script = true;
        }

        if ($attach_script) {
            $this->include_script('vcardattach.js');
            $this->include_stylesheet($this->local_skin_path() . '/style.css');
        }

        return $p;
    }
function html_output ( $ p ) { $ attach_script = false ; foreach ( $ this -> vcard_parts as $ part ) { $ vcards = rcube_vcard :: import ( $ this -> message -> get_part_content ( $ part , null , true ) ) ; // successfully parsed vcards? if ( empty ( $ vcards ) ) { continue ; } // remove part's body if ( in_array ( $ part , $ this -> vcard_bodies ) ) { $ p [ 'content' ] = '' ; } foreach ( $ vcards as $ idx => $ vcard ) { // skip invalid vCards if ( empty ( $ vcard -> email ) || empty ( $ vcard -> email [ 0 ] ) ) { continue ; } $ display = $ vcard -> displayname . ' <' . $ vcard -> email [ 0 ] . '>' ; // add box below message body $ p [ 'content' ] .= html :: p ( array ( 'class' => 'vcardattachment' ) , html :: a ( array ( 'href' => "#" , 'onclick' => "return plugin_vcard_save_contact('" . rcube :: JQ ( $ part . ':' . $ idx ) . "')" , 'title' => $ this -> gettext ( 'addvcardmsg' ) , ) , html :: span ( null , rcube :: Q ( $ display ) ) ) ) ; } $ attach_script = true ; } if ( $ attach_script ) { $ this -> include_script ( 'vcardattach.js' ) ; $ this -> include_stylesheet ( $ this -> local_skin_path ( ) . '/style.css' ) ; } return $ p ; }
This callback function adds a box below the message content
if there is a vcard attachment available
This callback function adds a box below the message content if there is a vcard attachment available