function txtAlfabetico() { $txt = ucfirst(LABEL_Titulo) . ': ' . $_SESSION["CFGTitulo"] . "\r\n"; $txt .= ucfirst(LABEL_Autor) . ': ' . $_SESSION["CFGAutor"] . "\r\n"; $txt .= ucfirst(LABEL_Keywords) . ': ' . $_SESSION["CFGKeywords"] . "\r\n"; $txt .= ucfirst(LABEL_Cobertura) . ': ' . $_SESSION["CFGCobertura"] . "\r\n"; $txt .= LABEL_URI . ': ' . $_SESSION["CFGURL"] . "\r\n"; $txt .= ucfirst(LABEL_Version) . ': ' . $_SESSION["CFGVersion"] . "\r\n"; $txt .= "__________________________________________________________________________\r\n"; //Lista de todos los términos $sql = SQLlistaTemas(); while ($arrayTema = mysqli_fetch_array($sql[datos])) { #Mantener vivo el navegador $time_now = time(); if ($time_start >= $time_now + 10) { $time_start = $time_now; header('X-pmaPing: Pong'); } // Diferenciar entre términos preferidos y términos no preferidos o referencias if ($arrayTema[t_relacion]) { //Remisiones de equivalencias y no preferidos $sqlNoPreferidos = SQLterminosValidosUF($arrayTema[id]); while ($arrayNoPreferidos = mysqli_fetch_array($sqlNoPreferidos[datos])) { $acronimo = arrayReplace(array("4", "5", "7", "8"), array(USE_termino, EQ_acronimo, EQP_acronimo, NEQ_acronimo), $arrayNoPreferidos[t_relacion]); $referencia_mapeo = $arrayNoPreferidos[vocabulario_id] !== '1' ? ' (' . $arrayNoPreferidos[titulo] . ' / ' . $arrayNoPreferidos[idioma] . ')' : '' . "\r\n"; $txt .= "\n" . $arrayTema[tema] . $referencia_mapeo; $txt .= ' ' . $acronimo . ': ' . $arrayNoPreferidos[tema_pref] . "\r\n"; } } else { // Si es preferido: mostar notas y relaciones $txt .= "\n" . $arrayTema[tema] . "\r\n"; $txt .= LABEL_fecha_creacion . ': ' . $arrayTema[cuando] . "\r\n"; if ($arrayTema[cuando_final] > $arrayTema[cuando]) { $txt .= LABEL_fecha_modificacion . ': ' . $arrayTema[cuando_final] . "\r\n"; } //Notas $sqlNotas = SQLdatosTerminoNotas($arrayTema[id], array("NB", "NH", "NA", "NC")); while ($arrayNotas = mysqli_fetch_array($sqlNotas[datos])) { $acronimo = arrayReplace(array("NB", "NH", "NA", "NC"), array(NB_acronimo, NH_acronimo, NA_acronimo, NC_acronimo), $arrayNotas[tipo_nota]); $txt .= ' ' . $acronimo . ': ' . html2txt($arrayNotas[nota]) . "\r\n"; } //Relaciones $sqlRelaciones = SQLverTerminoRelaciones($arrayTema[id]); $arrayRelacionesVisibles = array("2", "3", "4"); // TG/TE/UP /TR while ($arrayRelaciones = mysqli_fetch_array($sqlRelaciones[datos])) { if (in_array($arrayRelaciones[t_relacion], $arrayRelacionesVisibles)) { $acronimo = arrayReplace($arrayRelacionesVisibles, array(TR_acronimo, TG_acronimo, UP_acronimo), $arrayRelaciones[t_relacion]); $txt .= ' ' . $acronimo . ': ' . $arrayRelaciones[tema] . "\r\n"; } } //Terminos especificos $SQLTerminosE = SQLverTerminosE($arrayTema[id]); while ($arrayTE = mysqli_fetch_array($SQLTerminosE[datos])) { $txt .= ' ' . TE_acronimo . ': ' . $arrayTE[tema] . "\r\n"; } } } $filname = string2url($_SESSION[CFGTitulo] . ' ' . MENU_ListaAbc) . '.txt'; return sendFile("{$txt}", "{$filname}"); }
function txtAlfabetico($params = array()) { global $CFG; $txt = ucfirst(LABEL_Titulo) . ': ' . $_SESSION["CFGTitulo"] . "\r\n"; $txt .= ucfirst(LABEL_Autor) . ': ' . $_SESSION["CFGAutor"] . "\r\n"; $txt .= ucfirst(LABEL_Keywords) . ': ' . $_SESSION["CFGKeywords"] . "\r\n"; $txt .= ucfirst(LABEL_Cobertura) . ': ' . $_SESSION["CFGCobertura"] . "\r\n"; $txt .= LABEL_URI . ': ' . $_SESSION["CFGURL"] . "\r\n"; $txt .= ucfirst(LABEL_Version) . ': ' . $_SESSION["CFGVersion"] . "\r\n"; $txt .= "__________________________________________________________________________\r\n"; //Lista de todos los términos $sql = SQLlistaTemas($params["hasTopTerm"]); if ($params["hasTopTerm"] > 0) { $txt .= txt4term($params["hasTopTerm"], $params); } while ($arrayTema = $sql->FetchRow()) { #Mantener vivo el navegador $time_now = time(); if ($time_start >= $time_now + 10) { $time_start = $time_now; header('X-pmaPing: Pong'); } // Diferenciar entre términos preferidos y términos no preferidos o referencias if ($arrayTema[t_relacion]) { //Remisiones de equivalencias y no preferidos $sqlNoPreferidos = SQLterminosValidosUF($arrayTema[id]); while ($arrayNoPreferidos = $sqlNoPreferidos->FetchRow()) { $acronimo = arrayReplace(array("4", "5", "6", "7"), array(USE_termino, EQP_acronimo, EQ_acronimo, NEQ_acronimo), $arrayNoPreferidos[t_relacion]); $referencia_mapeo = $arrayNoPreferidos[vocabulario_id] !== '1' ? ' (' . $arrayNoPreferidos[titulo] . ')' : '' . "\r\n"; $txt .= "\n" . $arrayTema[tema] . $referencia_mapeo; $txt .= ' ' . $acronimo . $arrayNoPreferidos[rr_code] . ': ' . $arrayNoPreferidos[tema_pref] . "\r\n"; } } else { // Si es preferido: mostar notas y relaciones $txt .= "\n" . $arrayTema[tema] . "\r\n"; //show code $txt .= $CFG["_SHOW_CODE"] == '1' && strlen($arrayTema["code"] > 0) ? ' ' . ucfirst(LABEL_CODE) . ': ' . $arrayTema["code"] . "\r\n" : ""; $label_target_vocabulary = ''; $txt .= $params["includeCreatedDate"] == 1 ? LABEL_fecha_creacion . ': ' . $arrayTema[cuando] . "\r\n" : ''; if ($arrayTema[cuando_final] > $arrayTema[cuando] && $params["includeModDate"] == 1) { $txt .= LABEL_fecha_modificacion . ': ' . $arrayTema[cuando_final] . "\r\n"; } if ($params["includeTopTerm"] == 1) { $arrayMyTT = ARRAYmyTopTerm($arrayTema[id]); $txt .= $arrayMyTT["tema_id"] !== $arrayTema[id] ? ' TT: ' . $arrayMyTT["tema"] . "\r\n" : ''; } //include or not notes if (is_array($params["includeNote"])) { //Notas $sqlNotas = SQLdatosTerminoNotas($arrayTema[id]); while ($arrayNotas = $sqlNotas->FetchRow()) { $arrayNotas[label_tipo_nota] = in_array($arrayNotas[ntype_id], array(8, 9, 10, 11, 15)) ? arrayReplace(array(8, 9, 10, 11, 15), array(LABEL_NA, LABEL_NH, LABEL_NB, LABEL_NP, LABEL_NC), $arrayNotas[ntype_id]) : $arrayNotas[ntype_code]; if ($arrayNotas[tipo_nota] !== 'NP' && in_array($arrayNotas[tipo_nota], $params["includeNote"])) { $txt .= ' ' . $arrayNotas[label_tipo_nota] . ': ' . html2txt($arrayNotas[nota]) . "\r\n"; } } } //Relaciones $sqlRelaciones = SQLverTerminoRelaciones($arrayTema[id]); $arrayRelacionesVisibles = array(2, 3, 4, 5, 6, 7); // TG/TE/UP/TR while ($arrayRelaciones = $sqlRelaciones->FetchRow()) { if (in_array($arrayRelaciones[t_relacion], $arrayRelacionesVisibles)) { $acronimo = arrayReplace($arrayRelacionesVisibles, array(TR_acronimo, TG_acronimo, UP_acronimo, EQP_acronimo, EQ_acronimo, NEQ_acronimo), $arrayRelaciones[t_relacion]); if (in_array($arrayRelaciones[t_relacion], array(5, 6, 7))) { //términos equivalentes .. se concatenan después de los TE/NT $label_target_vocabulary .= ' ' . $acronimo . ': ' . $arrayRelaciones[tema] . ' (' . $arrayRelaciones[titulo] . ')' . "\r\n"; } else { if ($arrayRelaciones[t_relacion] == 4) { # is UF and not hidden UF $txt .= in_array($arrayRelaciones[rr_code], $CFG["HIDDEN_EQ"]) ? false : ' ' . $acronimo . $arrayRelaciones[rr_code] . ': ' . $arrayRelaciones[tema] . "\r\n"; } else { $txt .= ' ' . $acronimo . $arrayRelaciones[rr_code] . ': ' . $arrayRelaciones[tema] . "\r\n"; } } } } //Terminos especificos $SQLTerminosE = SQLverTerminosE($arrayTema[id]); while ($arrayTE = $SQLTerminosE->FetchRow()) { $txt .= ' ' . TE_acronimo . $arrayTE[rr_code] . ': ' . $arrayTE[tema] . "\r\n"; } $txt .= $label_target_vocabulary; //Terminos equivalentes web services $SQLtargetTerms = SQLtargetTerms($arrayTema[id]); while ($arrayTT = $SQLtargetTerms->FetchRow()) { $txt .= ' ' . FixEncoding(ucfirst($arrayTT[tvocab_label])) . ': ' . FixEncoding($arrayTT[tterm_string]) . "\r\n"; } } } $filname = string2url($_SESSION[CFGTitulo] . ' ' . MENU_ListaAbc) . '.txt'; return sendFile("{$txt}", "{$filname}"); }