diff --git a/style.css b/style.css --- a/style.css +++ b/style.css @@ -1,34 +1,54 @@ div.dokuwiki a.plugin_davcard_url:link, div.dokuwiki a.plugin_davcard_url:active, div.dokuwiki a.plugin_davcard_url:hover, div.dokuwiki a.plugin_davcard_url:visited { position: relative; padding-left: 18px; z-index: 10; } div.dokuwiki a.plugin_davcard_url:link span.plugin_davcard_popup, div.dokuwiki a.plugin_davcard_url:active span.plugin_davcard_popup, div.dokuwiki a.plugin_davcard_url:visited span.plugin_davcard_popup { display: none; } div.dokuwiki a.plugin_davcard_url:hover { text-decoration: none !important; z-index: 15; } div.dokuwiki a.plugin_davcard_url:hover span.plugin_davcard_popup { display: block; position: absolute; top: 1.2em; left: 18px; width: 20em; height: 64px; min-height: 64px; height: auto; background-color: __background__; border: 1px solid __border__; padding: 0.5em; font-size: 90%; -} \ No newline at end of file +} + +div.dokuwiki a.plugin_davcard_url:hover span.plugin_davcard_popup span.adr, +div.dokuwiki a.plugin_davcard_url:hover span.plugin_davcard_popup span.tel, +div.dokuwiki a.plugin_davcard_url:hover span.plugin_davcard_popup span.email_outer, +{ + display:block; + position: relative; + margin-left: 45px; +} + +div.dokuwiki a.plugin_davcard_url:hover span.plugin_davcard_popup span.adr span.type, +div.dokuwiki a.plugin_davcard_url:hover span.plugin_davcard_popup span.tel span.type, +div.dokuwiki a.plugin_davcard_url:hover span.plugin_davcard_popup span.email_type, +{ + font-weight: bold; + margin-left: -45px; + position: absolute; +} + + diff --git a/syntax/card.php b/syntax/card.php --- a/syntax/card.php +++ b/syntax/card.php @@ -1,164 +1,164 @@ */ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); class syntax_plugin_davcard_card extends DokuWiki_Syntax_Plugin { protected $hlp = null; // Load the helper plugin public function syntax_plugin_davcard_card() { $this->hlp =& plugin_load('helper', 'davcard'); } /** * What kind of syntax are we? */ function getType(){ return 'substition'; } /** * What about paragraphs? */ function getPType(){ return 'normal'; } /** * Where to sort in? */ function getSort(){ return 165; } /** * Connect pattern to lexer */ function connectTo($mode) { $this->Lexer->addSpecialPattern('\{\{davcard>[^}]*\}\}',$mode,'plugin_davcard_card'); } /** * Handle the match */ function handle($match, $state, $pos, Doku_Handler $handler){ global $ID; $options = trim(substr($match,10,-2)); $options = explode(',', $options); $data = array('name' => '', 'id' => '', ); foreach($options as $option) { list($key, $val) = explode('=', $option); $key = strtolower(trim($key)); $val = trim($val); switch($key) { default: $data[$key] = $val; } } if($data['id'] === '' && $data['name'] === '') { msg($this->getLang('id_name_not_set'), -1); } return $data; } /** * Create output */ function render($format, Doku_Renderer $R, $data) { if($format == 'metadata') { if(strpos($data['id'], 'webdav://') === 0) { $connectionId = str_replace('webdav://', '', $data['id']); $R->meta['plugin_davcard']['webdavclient'][] = $connectionId; return true; } } if($format != 'xhtml') return false; $contactdata = array(); if(strpos($data['id'], 'webdav://') === 0) { if($data['name'] !== '') { $contactdata = $this->hlp->getContactByName($data['id'], $data['name']); } } $R->doc .= ''.$contactdata['formattedname']; $R->doc .= ''; if(count($contactdata['addr']) > 0) { $R->doc .= ''; foreach($contactdata['addr'] as $type => $addr) { $R->doc .= ''.$this->getLang('adr'.strtolower($type)).''; if($addr[2] != '') { $R->doc .= ''.$addr[2].'
'; } if($addr[5] != '') { $R->doc .= ''.$addr[5].' '; } if($addr[3] != '') { $R->doc .= ''.$addr[3].'
'; } if($addr[6] != '') { $R->doc .= ''.$addr[6].''; } } - $R->doc .= '

'; + $R->doc .= '
'; } if(count($contactdata['tel']) > 0) { $R->doc .= ''; foreach($contactdata['tel'] as $type => $number) { $R->doc .= ''.$this->getLang('tel'.strtolower($type)).' '; $R->doc .= $number.'
'; } $R->doc .= '
'; } if(count($contactdata['mail']) > 0) { - $R->doc .= 'EMail:
'; + $R->doc .= '
'; + $R->doc .= '
'; } $R->doc .= ''; $R->doc .= '
'; } } // vim:ts=4:sw=4:et:enc=utf-8: