Skip to content

Commit

Permalink
Support enum from different namespace
Browse files Browse the repository at this point in the history
By prefixing the hint for an enum with :, allow to fetch it from an absolute namespace.
  • Loading branch information
fkaag71 committed Nov 3, 2023
1 parent 239003c commit fccbf4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin.info.txt
@@ -1,7 +1,7 @@
base strata
author Brend Wanders/François KAAG
email francois.kaag@cardynal.fr
date 2023-10-10
date 2023-11-03
name Strata
desc Semi-Structured data plugin
url http://github.com/fkaag71/dokuwiki-strata
10 changes: 8 additions & 2 deletions types/enum.php
Expand Up @@ -14,9 +14,15 @@ function render($mode, &$R, &$triples, $value, $hint) {
// use the hint if available
$scope=getNS($ID);
if ($scope != "") $scope .=":";
$labels = $triples ->fetchTriples ($scope.$hint,null,$value,null,$scope);
if (str_starts_with($hint,':'))
{ $hint = substr($hint,1); }
else
{ $hint = $scope.$hint; }

$labels = $triples ->fetchTriples ($hint,null,$value,null,$null);
$label = ($labels? $labels[0]['predicate']: '#NA');
$R->internallink($scope.':'.$hint,$label);

$R->internallink($hint,$label);
return true;
}

Expand Down

0 comments on commit fccbf4c

Please sign in to comment.