function assoc_num($descriptorID) { $tempArray = thesaurus::get_assoc($descriptorID); if ($tempArray) { return count($tempArray); } else { return FALSE; } }
function record($id, $termType) { $uses = ""; $term = thesaurus::get_name($id); $uses = extract_pattern($term, "/\\(BS[: ](?<use>.*)\\)/"); $recordArray = array(); $record = new simpleXmlElement("<record />"); // check if term already exists // define array for record creation $recordArray['input.name'] = "Thesaurus Redaktion"; $recordArray['input.date'] = date("Y-m-d", time()); $recordArray['input.time'] = date("h:i:s", time()); $recordArray['term.type'] = $termType; $recordArray['term.status'] = thesaurus::get_status_name(thesaurus::get_status($id)); $recordArray['term'] = $term; $recordArray['notes'] = thesaurus::get_comment($id); $recordArray['broader_term'] = thesaurus::get_parent($id); // $recordArray['narrower_term'] = thesaurus::get_child($id); $recordArray['related_term'] = thesaurus::get_assoc($id); $recordArray['used_for'] = $uses; xml_insert($record->record, create_record($recordArray, $termType)); return $record; }
function assoc_links($id) { $tempArray = thesaurus::get_assoc($id); echo "<form method='get' action='index.php' name='vb'>"; echo "<fieldset>"; echo "<legend>Verwandte Begriffe</legend>"; $x = 0; $listArray = array(); if ($tempArray) { foreach ($tempArray as $entry) { $listArray[$x++] = thesaurus::get_descriptor($entry); } } echo_selection($listArray, "id", "", 3, "assoc-field"); // display action line action::display($id, 3); echo "</fieldset>"; echo "</form>"; }