Beispiel #1
0
 function getTokenIssues($tokenID)
 {
     $paraID = false;
     $context = false;
     $place = false;
     $db = $this->startDB();
     $sql = "SELECT * FROM gap_issues WHERE tokenID = {$tokenID}  AND active = 1 ORDER BY updated DESC;";
     $result = $db->fetchAll($sql, 2);
     $sql = "SELECT * FROM gap_issues WHERE tokenID = {$tokenID}  AND active = 0 ORDER BY updated DESC;";
     $resultOld = $db->fetchAll($sql, 2);
     $tokensObj = new Tokens();
     $tokenData = $tokensObj->getTokenByID($tokenID);
     $tokensObj->highlightToken = $tokenID;
     if (is_array($tokenData)) {
         $token = $tokenData["token"];
         $paraID = $tokenData["paraID"];
         $pageID = $tokenData["pageID"];
         $docID = $tokenData["docID"];
         $context = $tokensObj->getGapVisDocPage($docID, $pageID, $paraID, $tokenID);
         $place = $tokensObj->getPlaceByTokensID($tokenID);
         $related = false;
         $relatedPlaceTokens = false;
         if (is_array($place)) {
             $related = $tokensObj->getTokenIDsBySharedPlaceURIid($tokenID, $place["uriID"], $token);
             $relatedPlaceTokens = $tokensObj->getUniqueTokensFromPlaceURI($place["uri"]);
         }
         $docObj = new Document();
         $document = $docObj->getByID($docID);
     }
     $output = array("tokenID" => $tokenID, "token" => $token, "docID" => $docID, "document" => $document, "pageID" => $pageID, "context" => $context, "place" => $place, "related" => $related, "relatedPlaceTokens" => $relatedPlaceTokens, "issues" => $result, "oldIssues" => $resultOld, "oldPlaces" => $tokensObj->getTokenDeactivatedPlaceRefs($tokenID));
     return $output;
 }