Skip to content

Commit

Permalink
Merge pull request #11 from AlexBlack788/NS
Browse files Browse the repository at this point in the history
Wiki namespaces support
  • Loading branch information
lejmr authored Mar 2, 2020
2 parents 76d02f9 + 60191b4 commit ab32dce
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,24 @@ public function render($mode, Doku_Renderer $renderer, $data)

// Validate that the image exists otherwise pring a default image
global $conf;
//$image_in_mediadir = join("/", array($conf['mediadir'], trim(str_replace(":","/",$data), "/") ));
$media_id = $data . '.png';

$image_in_mediadir = mediaFN($media_id);
$id = cleanID($data);

if(!file_exists($image_in_mediadir)){
$renderer->doc .= "<img class='mediacenter' id='".trim($data)."'

$current_id = getID();
$current_ns = getNS($current_id);

resolve_mediaid($current_ns, $media_id, $exists);
$diagram_id = substr($media_id, 0, -4);

if(!$exists){
$renderer->doc .= "<img class='mediacenter' id='".$diagram_id."'
style='max-width:100%;cursor:pointer;' onclick='edit(this);'
src='".DOKU_BASE."lib/plugins/drawio/blank-image.png'
alt='".$media_id."' />";
// $renderer->doc = $image_in_mediadir;
return true;
}
$renderer->doc .= "<img class='mediacenter' id='".trim($data)."'
$renderer->doc .= "<img class='mediacenter' id='".$diagram_id."'
style='max-width:100%;cursor:pointer;' onclick='edit(this);'
src='".DOKU_BASE."lib/exe/fetch.php?media=".$data.".png'
src='".DOKU_BASE."lib/exe/fetch.php?media=".$media_id."'
alt='".$media_id."' />";
return true;
}
Expand Down

0 comments on commit ab32dce

Please sign in to comment.