source: pmb4.2/trunk/fuentes/pmb/catalog/notices/search/terms/main.inc.php @ 815

Last change on this file since 815 was 815, checked in by jrpelegrina, 4 years ago

Initial release of pmb 4.2

  • Property svn:executable set to *
File size: 5.1 KB
Line 
1<?php
2// +-------------------------------------------------+
3// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
4// +-------------------------------------------------+
5// $Id: main.inc.php,v 1.18 2009-05-16 11:12:02 dbellamy Exp $
6
7if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) die("no access");
8
9// page de switch recherche sujets
10
11// inclusions principales
12require_once("$class_path/thesaurus.class.php");
13
14
15//recuperation du thesaurus session
16if(!$id_thes) {
17$id_thes = thesaurus::getSessionThesaurusId();
18} else {
19        thesaurus::setSessionThesaurusId($id_thes);
20}
21
22
23$search_form_term = "
24<form class='form-$current_module' name='term_search_form' method='post' action='./catalog.php?categ=search&mode=5'>
25<h3>".$msg["search_by_terms"]."</h3>
26        <div class='form-contenu'>
27                <div class='row'>
28                        <div class='colonne'>
29                                <!-- sel_thesaurus -->         
30                                <input type='text' class='saisie-50em' name='search_term' value='".htmlentities(stripslashes($search_term),ENT_QUOTES,$charset)."' />
31                        </div>
32                </div>
33                <div class='row'>
34                        <span class='saisie-contenu'>
35                                $msg[155]&nbsp;<a class='aide' title='$msg[1900]$msg[1901]$msg[1902]' href='./help.php?whatis=regex' onclick='aide_regex();return false;'>$msg[1550]</a>
36                                </span>
37                        </div>
38                </div>
39        <!--    Bouton Rechercher -->
40        <div class='row'>
41                <input type='submit' class='bouton' value='$msg[142]' />
42                </div>
43        </form>
44        <script type='text/javascript'>
45                document.forms['term_search_form'].elements['search_term'].focus();
46                function aide_regex()
47                        {
48                                var fenetreAide;
49                                fenetreAide = openPopUp('./help.php?whatis=regex', 'regex_howto', 500, 400, -2, -2, 'scrollbars=yes, resizable=yes');
50                        }
51                </script>
52        <br />
53        ";
54       
55       
56//affichage du selectionneur de thesaurus et du lien vers les thésaurus
57$liste_thesaurus = thesaurus::getThesaurusList();
58$sel_thesaurus = '';
59$lien_thesaurus = '';
60
61if ($thesaurus_mode_pmb != 0) {  //la liste des thesaurus n'est pas affichée en mode monothesaurus
62        $sel_thesaurus = "<select class='saisie-30em' id='id_thes' name='id_thes' ";
63        $sel_thesaurus.= "onchange = \"document.location = './catalog.php?categ=search&mode=5&id_thes='+document.getElementById('id_thes').value; \">" ;
64        foreach($liste_thesaurus as $id_thesaurus=>$libelle_thesaurus) {
65                $sel_thesaurus.= "<option value='".$id_thesaurus."' "; ;
66                if ($id_thesaurus == $id_thes) $sel_thesaurus.= " selected";
67                $sel_thesaurus.= ">".htmlentities($libelle_thesaurus,ENT_QUOTES,$charset)."</option>";
68        }
69        $sel_thesaurus.= "<option value=-1 ";
70        if ($id_thes == -1) $sel_thesaurus.= "selected ";
71        $sel_thesaurus.= ">".htmlentities(addslashes($msg['thes_all']),ENT_QUOTES,$charset)."</option>";
72        $sel_thesaurus.= "</select>&nbsp;";
73
74        $lien_thesaurus = "<a href='./autorites.php?categ=categories&sub=thes'>".$msg[thes_lien]."</a>";
75
76}       
77$search_form_term=str_replace("<!-- sel_thesaurus -->",$sel_thesaurus,$search_form_term);
78$search_form_term=str_replace("<!-- lien_thesaurus -->",$lien_thesaurus,$search_form_term);
79
80
81//affichage du choix de langue pour la recherche
82//$sel_langue = '';
83//$sel_langue = "<div class='row'>";
84//$sel_langue.= "<input type='checkbox' name='lg_search' id='lg_search' value='1' />&nbsp;".htmlentities(addslashes($msg['thes_sel_langue']),ENT_QUOTES,$charset);
85//$sel_langue.= "</div><br />";
86//$search_form_term=str_replace("<!-- sel_langue -->",$sel_langue,$search_form_term);
87
88
89echo $search_form_term;
90
91
92//Nouvelle recherche
93if (($search_term)&&(!$recalled)) {
94        $_SESSION["CURRENT"]=count($_SESSION["session_history"]);
95        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["URI"]="./catalog.php?categ=search&mode=5&id_thes=".$id_thes;
96        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["SEARCH_TYPE"]="term_search";
97        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"]=$_POST;
98        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"]["recalled"]=1;
99        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["GET"]=$_GET;
100        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_QUERY"]="<b>".$msg["histo_term"]."</b> ".htmlentities(stripslashes($search_term),ENT_QUOTES,$charset);
101        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_QUERY_START"]="<b>".$msg["histo_term"]."</b> ".htmlentities(stripslashes($search_term),ENT_QUOTES,$charset);
102        $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_TITLE"]=$msg["search_by_terms"];
103} else if ((!$search_term)&&(!$recalled)&&($_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["SEARCH_TYPE"]=="term_search")&&($_SESSION["CURRENT"]!==false)) { 
104                $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["SEARCH_TYPE"]="";
105        } else if (($recalled)&&($_SESSION["CURRENT"]!==false)) {
106                $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["SEARCH_TYPE"]="term_search";
107        }
108echo "
109<a name='search_frame'/>
110<div class='row'>
111        <iframe name='term_search' src='".$base_path."/catalog/notices/search/terms/term_browse.php?search_term=".rawurlencode(stripslashes($search_term))."&page_search=$page_search&term_click=".rawurlencode(stripslashes($term_click))."&id_thes=".$id_thes."'width=100% height=600></iframe>
112</div>";
Note: See TracBrowser for help on using the repository browser.