1<?php 2/** 3 * @author François KAAG (francois.kaag@cardynal.fr) 4 */ 5// must be run within Dokuwiki 6if(!defined('DOKU_INC')) die('Meh.'); 7 8/** 9 * New enum type for Strata 10 */ 11class plugin_strata_type_enum extends plugin_strata_type { 12 function render($mode, &$R, &$triples, $value, $hint) { 13 global $ID; 14 // use the hint if available 15 $scope=getNS($ID); 16 $labels = $triples ->fetchTriples ($scope.':'.$hint,null,$value,null,$scope); 17 $label = ($labels? $labels[0]['predicate']: '#NA'); 18 $R->cdata($label); 19 return true; 20 } 21 22 function getInfo() { 23 return array( 24 'desc'=>'Displays a value or a key by using the corresponding prefix in a given data fragment', 25 'tags'=>array('string'), 26 'hint'=>'data fragment' 27 ); 28 } 29} 30 31