'current', 'history' => 'history', 'all' => 'all' ]; public static function getAnnosysJSON($unitID, $collectioncode, $institutioncode) { Yii::info ( "collectioncode institutioncode :" . $collectioncode . ", " . $institutioncode ); $base = ExploreAnnosys::$annotationServiceURL; $params = urlencode ( $institutioncode ) . "/" . urlencode ( $collectioncode ) . "/" . urlencode ( $unitID ) . "/annotations/"; $url = $base . $params; // Yii::info ( $url ); $annotations = [ ]; $jsoncontent = @file_get_contents ( $url ); if ($jsoncontent === false) { return []; } else{ $data = json_decode ( $jsoncontent, TRUE ); if (isset ( $data ["hasAnnotation"] )) $hasAnnot = true; else $hasAnnot = false; if ($hasAnnot) { $annotationsTmp = $data ["annotations"]; foreach ( $annotationsTmp as $anno ) { $t = $anno ["time"]; // ti = int(t)/1000.0 // t=datetime.datetime.fromtimestamp(ti).strftime('%Y-%m-%d %H:%M:%S') // except: // t="" $tmp = [ ExploreAnnosys::$repos, $anno ["repositoryURI"], $anno ["annotator"], date('Y-m-d',$t/1000), $anno ["motivation"] ]; $annotations [] = $tmp; } } } return $annotations; } } ?>