Exemple #1
0
function ARRAYtargetVocabulary($tvocab_id)
{
    global $DBCFG;
    $sql = SQLtargetVocabulary("X", $tvocab_id);
    return mysqli_fetch_array($sql[datos]);
}
function ARRAYtargetVocabulary($tvocab_id)
{
    global $DBCFG;
    $sql = SQLtargetVocabulary("X", $tvocab_id);
    return $sql->FetchRow();
}
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;
}
Exemple #4
0
function HTMLlistaTargetVocabularios()
{
    $sql = SQLtargetVocabulary("0");
    $rows .= '<table cellpadding="0" cellspacing="0" summary="' . LABEL_lcConfig . '" >';
    $rows .= '<thead>';
    $rows .= '<tr>';
    $rows .= '<th class="izq" colspan="3">' . LABEL_lcConfig . ' &middot; [<a href="admin.php?tvocabulario_id=0&doAdmin=seeformTargetVocabulary" title="' . MENU_NuevoVocabularioReferencia . '">' . LABEL_Agregar . ' ' . LABEL_vocabulario_referenciaWS . '</a>]</th>';
    $rows .= '</tr>';
    $rows .= '<tr>';
    $rows .= '<th>' . ucfirst(LABEL_tvocab_label) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_Titulo) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_Terminos) . '</th>';
    $rows .= '</tr>';
    $rows .= '</thead>';
    $rows .= '<tbody>';
    while ($array = mysqli_fetch_array($sql[datos])) {
        $fecha_alta = do_fecha($listaUsers[cuando]);
        $label_tvocab_status = $array[tvocab_status] == '1' ? ucfirst(LABEL_enable) : ucfirst(LABEL_disable);
        $rows .= '<tr>';
        $rows .= '<td class="izq"><a href="admin.php?tvocab_id=' . $array[tvocab_id] . '&amp;doAdmin=seeformTargetVocabulary" title="' . MENU_DatosTesauro . ' ' . $array[tvocab_title] . '">' . FixEncoding($array[tvocab_label]) . '</a> (' . FixEncoding($array[tvocab_tag]) . ')</td>';
        $rows .= '<td class="izq"><a href="' . $array[tvocab_url] . '" title="' . LABEL_vocabulario_referenciaWS . ' ' . FixEncoding($array[tvocab_title]) . '">' . FixEncoding($array[tvocab_title]) . '</a></td>';
        //hay términos y esta habilitado
        if ($array[cant] > 0) {
            $rows .= '<td><a href="admin.php?doAdmin=seeTermsTargetVocabulary&amp;tvocab_id=' . $array[tvocab_id] . '">' . $label_tvocab_status . ': ' . $array[cant] . '</a></td>';
        }
        $rows .= '</tr>';
    }
    $rows .= '</tbody>';
    $rows .= '<tfoot>';
    $rows .= '<tr>';
    $rows .= '<td colspan="3">' . $sql[cant] . '</td>';
    $rows .= '</tr>';
    $rows .= '</tfoot>';
    $rows .= '</table>        ';
    return $rows;
}
function HTMLlistaTargetVocabularios()
{
    $sql = SQLtargetVocabulary("0");
    $rows .= '<div class="table-responsive"> ';
    $rows .= '<h3>' . ucfirst(LABEL_lcConfig) . ' &middot; <a class="btn btn-primary btn-xs" href="admin.php?tvocabulario_id=0&doAdmin=seeformTargetVocabulary" title="' . ucfirst(LABEL_addTargetVocabulary) . '">' . ucfirst(LABEL_addTargetVocabulary) . '</a></h3>';
    $rows .= '<table class="table table-striped table-bordered table-condensed table-hover"  summary="' . LABEL_lcConfig . '">';
    $rows .= '<thead>';
    $rows .= '<tr>';
    $rows .= '<th>' . ucfirst(LABEL_tvocab_label) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_Titulo) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_Terminos) . '</th>';
    $rows .= '</tr>';
    $rows .= '</thead>';
    $rows .= '<tbody>';
    while ($array = $sql->FetchRow()) {
        $fecha_alta = do_fecha($listaUsers[cuando]);
        $label_tvocab_status = $array[tvocab_status] == '1' ? ucfirst(LABEL_enable) : ucfirst(LABEL_disable);
        $rows .= '<tr>';
        $rows .= '<td class="izq"><a href="admin.php?tvocab_id=' . $array[tvocab_id] . '&amp;doAdmin=seeformTargetVocabulary" title="' . MENU_DatosTesauro . ' ' . $array[tvocab_title] . '">' . FixEncoding($array[tvocab_label]) . '</a> (' . FixEncoding($array[tvocab_tag]) . ')</td>';
        $rows .= '<td class="izq"><a href="' . $array[tvocab_url] . '" title="' . LABEL_vocabulario_referenciaWS . ' ' . FixEncoding($array[tvocab_title]) . '">' . FixEncoding($array[tvocab_title]) . '</a></td>';
        //hay términos y esta habilitado
        if ($array[cant] > 0) {
            $rows .= '<td><a href="admin.php?doAdmin=seeTermsTargetVocabulary&amp;tvocab_id=' . $array[tvocab_id] . '">' . $label_tvocab_status . ': ' . $array[cant] . '</a></td>';
        }
        $rows .= '</tr>';
    }
    $rows .= '</tbody>';
    $rows .= '<tfoot>';
    $rows .= '<tr>';
    $rows .= '<td colspan="3">' . SQLcount($sql) . '</td>';
    $rows .= '</tr>';
    $rows .= '</tfoot>';
    $rows .= '</table> </table>       ';
    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;
}