Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added title support. closes #2

  • Loading branch information...
commit 06ca10361ca18d4b24a834252dabdc4783126717 1 parent 137506f
@splitbrain authored
Showing with 15 additions and 6 deletions.
  1. +1 −1  plugin.info.txt
  2. +14 −5 syntax.php
View
2  plugin.info.txt
@@ -1,7 +1,7 @@
base vshare
author Andreas Gohr
email andi@splitbrain.org
-date 2010-06-07
+date 2010-06-20
name Video Sharing Site Plugin
desc Easily embed videos from various Video Sharing sites. Example: {{youtube>XXXXXX}}
url http://www.dokuwiki.org/plugin:vshare
View
19 syntax.php
@@ -43,6 +43,10 @@ function connectTo($mode) {
function handle($match, $state, $pos, &$handler){
$command = substr($match,2,-2);
+ // title
+ list($command,$title) = explode('|',$command);
+ $title = trim($title);
+
// alignment
$align = 0;
if(substr($command,0,1) == ' ') $align += 1;
@@ -84,7 +88,8 @@ function handle($match, $state, $pos, &$handler){
'vars' => $varr,
'align' => $align,
'width' => $width,
- 'height' => $height
+ 'height' => $height,
+ 'title' => $title
);
}
@@ -95,15 +100,19 @@ function render($mode, &$R, $data){
if($mode != 'xhtml') return false;
if(is_null($data)) return false;
- if($data['align'] == 1) $R->doc .= '<div class="vshare__right">';
- if($data['align'] == 2) $R->doc .= '<div class="vshare__left">';
- if($data['align'] == 3) $R->doc .= '<div class="vshare__center">';
+ if($data['align'] == 0) $align = 'none';
+ if($data['align'] == 1) $align = 'right';
+ if($data['align'] == 2) $align = 'left';
+ if($data['align'] == 3) $align = 'center';
+ if($data['title']) $title = ' title="'.hsc($data['title']).'"';
+
+ $R->doc .= '<div class="vshare__'.$align.'"'.$title.'>';
$R->doc .= html_flashobject(
$data['flash'],
$data['width'],
$data['height'],
$data['vars'],
$data['vars']);
- if($data['align']) $R->doc .= '</div>';
+ $R->doc .= '</div>';
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.