Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1880328
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
6 KB
Subscribers
None
View Options
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 @@
<?php
/**
* DokuWiki Plugin DAVCard (Contact Syntax Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Böhler <dev@aboehler.at>
*/
// 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 .= '<a class="url fn plugin_davcard_url" href="#">'.$contactdata['formattedname'];
$R->doc .= '<span class="plugin_davcard_popup vcard">';
if(count($contactdata['addr']) > 0)
{
$R->doc .= '<span class="adr">';
foreach($contactdata['addr'] as $type => $addr)
{
$R->doc .= '<span class="type">'.$this->getLang('adr'.strtolower($type)).'</span>';
if($addr[2] != '')
{
$R->doc .= '<span class="street-address">'.$addr[2].'</span><br>';
}
if($addr[5] != '')
{
$R->doc .= '<span class="postal-code">'.$addr[5].' </span>';
}
if($addr[3] != '')
{
$R->doc .= '<span class="locality">'.$addr[3].'</span><br>';
}
if($addr[6] != '')
{
$R->doc .= '<span class="country-name">'.$addr[6].'</span>';
}
}
- $R->doc .= '</span><br>';
+ $R->doc .= '</span>';
}
if(count($contactdata['tel']) > 0)
{
$R->doc .= '<span class="tel">';
foreach($contactdata['tel'] as $type => $number)
{
$R->doc .= '<span class="type">'.$this->getLang('tel'.strtolower($type)).' </span>';
$R->doc .= $number.'<br>';
}
$R->doc .= '</span>';
}
if(count($contactdata['mail']) > 0)
{
- $R->doc .= '<span>EMail:<br>';
+ $R->doc .= '<span class="email_outer"><span class="email_type">EMail:</span>';
foreach($contactdata['mail'] as $type => $mail)
{
$R->doc .= '<span class="email">'.$mail.'</span><br>';
}
- $R->doc .= '</span><br>';
+ $R->doc .= '</span>';
}
$R->doc .= '</span>';
$R->doc .= '</a>';
}
}
// vim:ts=4:sw=4:et:enc=utf-8:
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Jan 24, 3:49 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
527745
Default Alt Text
(6 KB)
Attached To
rDAVCARD DokuWiki davcard PlugIn
Event Timeline
Log In to Comment