$last[0] = $new_termino; } elseif ($level > 0) { $new_termino = abm_tema('alta', $encoded_term); //$new_relacion = do_r($last[$level-1],$new_termino,"3"); $to_do[] = $last[$level - 1] . "|" . $new_termino . "|3"; $last[$level] = $new_termino; } if ($equ === true) { foreach ($liste as $value) { $value = trim($value); if ($value == $terme) { continue; } //$encoded_value = ( $CFG["_CHAR_ENCODE"] == "utf-8" ) ? $value : utf8_decode($value) ; $encoded_value = utf8_decode($value); $id_equ = abm_tema('alta', $encoded_value); //$equ_relacion = do_r($id_equ,$new_termino,"4") ; $to_do[] = $id_equ . "|" . $new_termino . "|4"; } } if ($debug) { echo $level . "-" . $terme . "\n"; } } foreach ($to_do as $line) { if ($debug) { echo $line . "\n"; } $t = explode("|", $line); do_r($t[0], $t[1], $t[2]); }
} # Borrado de término if ($_GET[id_dete]) { borra_t($_GET[id_dete]); } # Alta de término if ($_POST[alta_t] == 'new') { $arrayTerminos = explode("\n", doValue($_POST, FORM_LABEL_termino)); for ($i = 0; $i < sizeof($arrayTerminos); ++$i) { $new_termino = abm_tema('alta', $arrayTerminos[$i]); $tema = $new_termino; } } # Modificación de término if ($_POST[edit_id_tema]) { $new_termino = abm_tema('mod', doValue($_POST, FORM_LABEL_termino), "{$_POST['edit_id_tema']}"); $tema = $new_termino; } # Alta de nota if ($_POST[altaNota]) { $tema = abmNota('A', "{$_POST['idTema']}", doValue($_POST, FORM_LABEL_tipoNota), doValue($_POST, FORM_LABEL_Idioma), doValue($_POST, FORM_LABEL_nota)); } #Operaciones Mod y Borrado de notas if ($_POST[modNota]) { # Modificación de nota if ($_POST[guardarCambioNota] == LABEL_Cambiar) { $tema = abmNota('M', "{$_POST['idTema']}", doValue($_POST, FORM_LABEL_tipoNota), doValue($_POST, FORM_LABEL_Idioma), doValue($_POST, FORM_LABEL_nota), "{$_POST['idNota']}"); } # Borrado de nota if ($_POST[eliminarNota] == LABEL_EliminarNota) { $tema = abmNota('B', "{$_POST['idTema']}", "", "", "", "{$_POST['idNota']}");
break; case '-1': // ERROR header("HTTP/1.1 406 Not Acceptable"); echo ' ' . $_POST[code_tema] . ': ' . MSG_ERROR_CODE . ' (' . LABEL_Termino . ' ' . $task[tema] . ')'; break; } } } //gestión de codigo de tema if ($_POST["edit_tema_id"]) { $tema_id = str_replace("edit_tema", "", $_POST["edit_tema_id"]); //additional secure check $string_term = secure_data($_POST["edit_tema"], "sql"); if (is_numeric($tema_id) && strlen($string_term) > 0) { $task = abm_tema('mod', $string_term, $tema_id); } $arrayTerm = ARRAYverTerminoBasico($tema_id); echo $arrayTerm[tema]; } } $searchq = $_GET['q']; if (!$searchq) { return; } if (strlen($searchq) >= CFG_MIN_SEARCH_SIZE) { $getRecord_sql = $_GET[t] == 'e' ? SQLSimpleSearchTrueTerms($searchq, "15") : SQLbuscaTerminosSimple($searchq, "15"); // ---------------------------------------------------------------- // // AJAX Response // // ---------------------------------------------------------------- // if ($getRecord_sql[cant] > 0) {
function resolve2FreeTerms($string, $tema_id) { $term = fetchSearchExactFreeTerms($string, $tema_id); return !$term[tema_id] ? abm_tema('alta', $string) : $term[tema_id]; }
function ALTAtema($string, $tesauro_id, $estado_id = "13") { return abm_tema('alta', $string); }