function HTMLformAssociateTargetTerms($ARRAYtermino, $term_id = "0") { $sql = SQLtargetVocabulary("1"); $rows = '<div id="bodyText">'; $rows .= '<a class="topOfPage" href="javascript: history.go(-1);">' . LABEL_Anterior . '</a>'; $rows .= '<h1>' . LABEL_EditorTermino . '</h1>'; $rows .= ' <fieldset>'; $rows .= ' <legend>' . LABEL_relacion_vocabulario . ' <a href="index.php?tema=' . $ARRAYtermino[idTema] . '">' . $ARRAYtermino[titTema] . '</a></legend>'; if (!$sql[cant]) { //No hay vocabularios de referencia, solo vocabulario principal $rows .= '<p class="error">' . ucfirst(LABEL_NO_vocabulario_referencia) . '</p>'; } else { //Hay vobularios de referencia $array_vocabularios = array(); while ($array = mysqli_fetch_array($sql[datos])) { if ($array[vocabulario_id] !== '1') { //vocabularios que no sean el vocabulario principal array_push($array_vocabularios, $array[tvocab_id] . '#' . FixEncoding($array[tvocab_label])); } } $rows .= '<form class="formdiv" name="alta_tt" action="index.php" method="get" onsubmit="return checkrequired(this)">'; $rows .= '<div>'; $rows .= '<label for="tvocab_id" accesskey="t">'; $rows .= FORM_LABEL_nombre_vocabulario . '*</label>'; $rows .= '<select id="tvocab_id" name="tvocab_id">'; $rows .= '<optgroup label="' . FORM_LABEL_nombre_vocabulario . '">'; $rows .= doSelectForm($array_vocabularios, ""); $rows .= '</optgroup>'; $rows .= '</select><br/>'; $rows .= '</div>'; $rows .= '<div>'; $rows .= '<label for="string2search" accesskey="s">'; $rows .= LABEL_Buscar . '</label>'; $rows .= '<input name="string2search" type="text" id="string2search" size="15" maxlength="50"/>'; $rows .= '</div>'; $rows .= '<div class="submit_form" align="center">'; $rows .= ' <input type="submit" name="boton" value="' . LABEL_Buscar . '"/> <input type="button" name="cancelar" type="button" onClick="location.href=\'index.php?tema=' . $ARRAYtermino[idTema] . '\'" value="' . ucfirst(LABEL_Cancelar) . '"/> <input type="hidden" name="tema" value="' . $ARRAYtermino[idTema] . '"/> <input type="hidden" name="taskterm" value="findTargetTerm"/>'; $rows .= '</div>'; $rows .= '</form>'; } $rows .= ' </fieldset>'; if ($_GET[string2search] && $_GET[tvocab_id]) { require 'vocabularyservices.php'; $arrayVocab = ARRAYtargetVocabulary($_GET[tvocab_id]); $arrayTerm = xmlVocabulary2array($arrayVocab[tvocab_uri_service] . '?task=search&arg=' . urlencode($_GET[string2search])); $rows .= HTMLtargetVocabularySearchResult($arrayTerm, $_GET[string2search], $arrayVocab, $ARRAYtermino[idTema]); } //fin de if buscar $rows .= ' </div>'; return $rows; }
function HTMLformAssociateTargetTerms($ARRAYtermino, $term_id = "0") { $sql = SQLtargetVocabulary("1"); $rows = '<div class="container" id="bodyText">'; $rows .= '<a class="topOfPage" href="index.php?tema=' . $ARRAYtermino["idTema"] . '" title="' . LABEL_Anterior . '">' . LABEL_Anterior . '</a>'; if (SQLcount($sql) == '0') { //No hay vocabularios de referencia, solo vocabulario principal $rows .= HTMLalertNoTargetVocabulary(); } else { //Hay vobularios de referencia $array_vocabularios = array(); while ($array = $sql->FetchRow()) { if ($array[vocabulario_id] !== '1') { //vocabularios que no sean el vocabulario principal array_push($array_vocabularios, $array[tvocab_id] . '#' . FixEncoding($array[tvocab_label])); } } $arrayOptions = strlen($ARRAYtermino["code"]) > 0 ? array('string#' . ucfirst(LABEL_string2search), 'reverse#' . ucfirst(LABEL_reverseMappign), 'code#' . LABEL_CODE) : array('string#' . ucfirst(LABEL_string2search), 'reverse#' . ucfirst(LABEL_reverseMappign)); $display = in_array($_GET[search_by], array('reverse', 'code')) ? 'style="display: none;"' : ''; $string2search = $_GET[string2search] ? XSSprevent($_GET[string2search]) : $ARRAYtermino["titTema"]; $rows .= '<form class="" role="form" name="alta_tt" id="alta_tt" action="index.php" method="get">'; $rows .= ' <div class="row"> <div class="col-sm-12"> <legend>' . ucfirst(LABEL_relacion_vocabulario) . ' <a href="index.php?tema=' . $ARRAYtermino["idTema"] . '">' . $ARRAYtermino["titTema"] . '</a></legend> </div> <!-- panel --> <div class="col-lg-7"> <div class="panel panel-default"> <div class="panel-body form-horizontal"> <div class="form-group"> <label for="tvocab_id" class="col-sm-3 control-label">' . ucfirst(FORM_LABEL_nombre_vocabulario) . '</label> <div class="col-sm-9"> <select class="form-control" id="tvocab_id" name="tvocab_id"> ' . doSelectForm($array_vocabularios, $_GET["tvocab_id"]) . ' </select> </div> </div>'; //Configurar opcion búsqueda por código $rows .= '<div class="form-group"> <label for="search_by" class="col-sm-3 control-label">' . ucfirst(LABEL_selectMapMethod) . '</label> <div class="col-sm-9"> <select class="form-control" id="search_by" name="search_by" onChange="mostrar(this.value);"> ' . doSelectForm($arrayOptions, $_GET["search_by"]) . ' </select> </div> </div>'; $rows .= '<div id="by_string" class="form-group" ' . $display . '> <label for="string2search" class="col-sm-3 control-label">' . ucfirst(LABEL_Buscar) . '</label> <div class="col-sm-9"> <input type="text" class="form-control" required type="search" required id="string2search" name="string2search" value="' . $string2search . '"> </div> </div> <div class="form-group"> <div class="col-sm-12 text-right"> <button type="submit" class="btn btn-primary" value="' . LABEL_Buscar . '"/>' . ucfirst(LABEL_Buscar) . '</button> <button type="button" class="btn btn" name="cancelar" type="button" onClick="location.href=\'index.php?tema=' . $ARRAYtermino["idTema"] . '\'" value="' . ucfirst(LABEL_Cancelar) . '"/>' . ucfirst(LABEL_Cancelar) . '</button> </div> </div> </div> </div> </div> <!-- / panel -->'; $rows .= '<input type="hidden" name="tema" value="' . $ARRAYtermino["idTema"] . '"/> <input type="hidden" name="taskterm" value="findTargetTerm"/>'; $rows .= '</form>'; } $rows .= '</div>'; if ($string2search && $_GET["tvocab_id"]) { require_once T3_ABSPATH . 'common/include/vocabularyservices.php'; $arrayVocab = ARRAYtargetVocabulary($_GET["tvocab_id"]); switch ($_GET["search_by"]) { case 'string': $dataTerm = getURLdata($arrayVocab[tvocab_uri_service] . '?task=search&arg=' . urlencode($string2search)); break; case 'code': $dataTerm = getURLdata($arrayVocab[tvocab_uri_service] . '?task=fetchCode&arg=' . urlencode($ARRAYtermino["code"])); break; case 'reverse': $dataTerm = getURLdata($arrayVocab[tvocab_uri_service] . '?task=fetchSourceTerms&arg=' . rawurlencode($ARRAYtermino["titTema"])); break; default: $dataTerm = getURLdata($arrayVocab[tvocab_uri_service] . '?task=search&arg=' . urlencode($string2search)); break; } $rows .= HTMLtargetVocabularySearchResult($dataTerm, $_GET[string2search], $arrayVocab, $ARRAYtermino["idTema"]); } //fin de if buscar $rows .= ' </div>'; $rows .= '<script type="text/javascript"> function mostrar(id) { ((id == "string") ? $("#by_string").show() : $("#by_string").hide()); } </script>'; return $rows; }