本文整理汇总了PHP中thesaurus类的典型用法代码示例。如果您正苦于以下问题:PHP thesaurus类的具体用法?PHP thesaurus怎么用?PHP thesaurus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了thesaurus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testXquery_escape
public function testXquery_escape()
{
$string = 'Eléphant ';
$this->assertEquals($string, thesaurus::xquery_escape($string));
$string = '&é"\'(-è_ çà)=ù*!:;,?./§%µ+°0987654321';
$this->assertEquals('&é"'(-è_ çà)=ù*!:;,?./§%µ+°0987654321', thesaurus::xquery_escape($string));
}
示例2: categ_browser
function categ_browser($parent = 0, $folder_link = '', $document_link = '', $id_thes = 0)
{
global $PHP_SELF;
$this->parent = $parent;
$this->folder_link = $folder_link;
$this->document_link = $document_link;
//recuperation du thesaurus session
if (!$id_thes) {
$id_thes = thesaurus::getSessionThesaurusId();
} else {
thesaurus::setSessionThesaurusId($id_thes);
}
if ($id_thes != -1) {
$this->thes = new thesaurus($id_thes);
}
$this->id_thes = $id_thes;
if ($this->id_thes != -1) {
// 1 seul thesaurus
if (!$this->parent) {
$this->parent = $this->thes->num_noeud_racine;
}
$this->parents_tab = array();
$this->children_tab = array();
$caller = preg_replace('/\\/.*\\//', './', $PHP_SELF);
if (!$this->folder_link) {
$this->folder_link = "<a href='" . $caller . "?parent=!!id!!'>";
}
if (!$this->document_link) {
$this->document_link = "<a href='" . $caller . "?id=!!id!!'>";
}
$this->get_children();
$this->get_parents();
}
return TRUE;
}
示例3: list_thesauri
function list_thesauri($OPACUserId = -1)
{
$thesauri = thesaurus::getThesaurusList();
$results = array();
global $opac_thesaurus, $opac_thesaurus_defaut;
foreach ($thesauri as $id => $caption) {
if ($OPACUserId != -1 && $opac_thesaurus == 0 && $opac_thesaurus_defaut != $id) {
continue;
}
$athesaurus = new thesaurus($id);
$results[] = array('thesaurus_id' => $id, 'thesaurus_caption' => utf8_normalize($caption), 'thesaurus_num_root_node' => $athesaurus->num_noeud_racine, 'thesaurus_num_unclassed_node' => $athesaurus->num_noeud_nonclasses, 'thesaurus_num_orphans_node' => $athesaurus->num_noeud_orphelins);
}
return $results;
}
示例4: category
function category($id = 0)
{
if ($id) {
// on cherche à atteindre une notice existante
$this->id = $id;
$this->is_under_tilde = 0;
$this->thes = thesaurus::getByEltId($id);
$this->getData();
} else {
// la notice n'existe pas
$this->id = 0;
$this->is_under_tilde = 0;
$this->getData();
}
}
示例5: get_data
function get_data()
{
global $dbh;
global $categorie_separator;
global $lang;
// on récupère les infos de la catégorie
$this->thes = thesaurus::getByEltId($this->id);
if (categories::exists($this->id, $lang)) {
$lg = $lang;
} else {
$lg = $this->thes->langue_defaut;
}
$query = "select ";
$query .= "categories.libelle_categorie,categories.note_application, categories.comment_public, ";
$query .= "noeuds.num_parent, noeuds.num_renvoi_voir ";
$query .= "from noeuds, categories ";
$query .= "where categories.langue = '" . $lg . "' ";
$query .= "and noeuds.id_noeud = '" . $this->id . "' ";
$query .= "and noeuds.id_noeud = categories.num_noeud ";
$query .= "limit 1";
$result = pmb_mysql_query($query, $dbh);
$current = pmb_mysql_fetch_object($result);
$this->libelle = $current->libelle_categorie;
$this->parent = $current->num_parent;
$this->voir = $current->num_renvoi_voir;
$this->note = $current->note_application;
$this->comment = $current->comment_public;
// on regarde si la catégorie à des enfants
$query = "select count(1) from noeuds where num_parent = '" . $this->id . "' ";
$result = pmb_mysql_query($query, $dbh);
$this->has_child = pmb_mysql_result($result, 0, 0);
// on regarde si la catégorie à des associées
$query = "select count(1) from voir_aussi where num_noeud_orig = '" . $this->id . "' or num_noeud_dest = '" . $this->id . "' ";
$result = pmb_mysql_query($query, $dbh);
$this->has_child = $this->has_child + pmb_mysql_result($result, 0, 0);
// on regarde si la catégorie est utilisée dans des notices
$query = "select count(1) from notices_categories where num_noeud = '" . $this->id . "' ";
$result = pmb_mysql_query($query, $dbh);
$this->has_notices = pmb_mysql_result($result, 0, 0);
}
示例6: cleanCategoriesPath
function cleanCategoriesPath()
{
global $msg, $charset, $PMBusername;
if (SESSrights & ADMINISTRATION_AUTH) {
// Pour tous les thésaurus, on parcours les childs
$list_thesaurus = thesaurus::getThesaurusList();
foreach ($list_thesaurus as $id_thesaurus => $libelle_thesaurus) {
$thes = new thesaurus($id_thesaurus);
$noeud_rac = $thes->num_noeud_racine;
$r = noeuds::listChilds($noeud_rac, 0);
while ($row = mysql_fetch_object($r)) {
noeuds::process_categ_path($row->id_noeud);
}
}
if ($thesaurus_auto_postage_search) {
categories::process_categ_index();
}
$result .= htmlentities($msg["clean_categories_path_end"], ENT_QUOTES, $charset);
} else {
$result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
}
return $result;
}
示例7: die
<?php
// +-------------------------------------------------+
// � 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: main.inc.php,v 1.2 2007-03-10 09:03:17 touraine37 Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
die("no access");
}
// page de switch recherche sujets
require_once $class_path . "/searcher.class.php";
require_once "{$class_path}/thesaurus.class.php";
//recuperation du thesaurus session
if (!$id_thes) {
$id_thes = thesaurus::getSessionThesaurusId();
} else {
thesaurus::setSessionThesaurusId($id_thes);
}
$link = "./circ.php?categ=resa_planning&resa_action=add_resa&id_empr={$id_empr}&groupID={$groupID}&id_notice=!!id!!";
$link_serial = '';
$link_analysis = '';
$link_bulletin = '';
$unq = md5(microtime());
$browser_url = './circ/resa_planning/subjects/categ_browser.php?id_thes=' . $id_thes . '&id_empr=' . $id_empr . '&groupID=' . $groupID . '&unq=' . $unq;
$sh = new searcher_subject("./circ.php?categ=resa_planning&resa_action=search_resa&mode=1&id_empr={$id_empr}&groupID={$groupID}&unq={$unq}");
示例8: getRdfThesaurus
function getRdfThesaurus($idThes)
{
$arrayTriples = array();
$uriThes = $this->baseUriThesaurus . $idThes;
$thes = new thesaurus($idThes);
//Type
$triple = array();
$triple[0] = '<' . $uriThes . '>';
$triple[1] = "rdf:type";
$triple[2] = "skos:ConceptScheme";
$arrayTriples[] = $triple;
//Label
$triple = array();
$triple[0] = '<' . $uriThes . '>';
$triple[1] = "skos:prefLabel";
$triple[2] = '"' . addslashes($thes->getLibelle()) . '"';
$arrayTriples[] = $triple;
//topConcepts
$resBis = mysql_query("SELECT id_noeud FROM noeuds WHERE num_parent='" . $thes->num_noeud_racine . "' AND num_renvoi_voir='0' AND autorite != 'ORPHELINS' AND num_thesaurus='" . $idThes . "'");
while ($rowBis = mysql_fetch_object($resBis)) {
$triple = array();
$triple[0] = '<' . $uriThes . '>';
$triple[1] = "skos:hasTopConcept";
$triple[2] = '<' . $this->baseUriConcept . $rowBis->id_noeud . '>';
$arrayTriples[] = $triple;
}
return $arrayTriples;
}
示例9: list_id
function list_id($type, $idArray)
{
$retXml = new simpleXmlElement("<{$type} />");
if (is_array($idArray)) {
foreach ($idArray as $entry) {
if (is_numeric($entry)) {
$xmlString = thesaurus::get_name($entry);
extract_pattern($xmlString, "/\\(BS[: ](?<use>.*)\\)/");
} else {
$xmlString = $entry;
}
xml_insert($retXml, new simpleXmlElement("<{$type}>" . trim($xmlString) . "</{$type}>"));
}
}
return $retXml;
}
示例10: thesaurus
break;
case 'search_form':
$libelle_partiel = 1;
if (!$id_thes) {
$id_thes = thesaurus::getSessionThesaurusId();
}
thesaurus::setSessionThesaurusId($id_thes);
break;
default:
if (!$id_thes) {
$id_thes = thesaurus::getSessionThesaurusId();
}
thesaurus::setSessionThesaurusId($id_thes);
break;
}
$thes = new thesaurus($id_thes);
if ($aj == 'add' && SESSrights & THESAURUS_AUTH) {
// on arrive du formulaire d'ajout à la volée
if (!strlen($category_parent)) {
$category_parent_id = $thes->num_noeud_racine;
}
$category_voir_id = 0;
$noeud = new noeuds();
$noeud->num_parent = $category_parent_id;
$noeud->num_thesaurus = $thes->id_thesaurus;
$noeud->save();
$cat = new categories($noeud->id_noeud, $thes->langue_defaut);
$cat->libelle_categorie = stripslashes($category_libelle);
$cat->note_application = stripslashes($category_comment);
$cat->index_categorie = " " . strip_empty_words($cat->libelle_categorie) . " ";
$cat->save();
示例11: get_config_form
function get_config_form()
{
global $charset, $msg, $dbh;
global $thesaurus_default;
global $base_path;
if (!$this->config['used_thesaurus']) {
$this->config['used_thesaurus'] = $thesaurus_default;
}
if (!$this->config['base_uri']) {
$this->config['base_uri'] = "/";
}
if (!$this->config['tree']) {
$this->config['tree'] = array();
}
if (!$this->config['restricted_empr_write_permission']) {
$this->config['restricted_empr_write_permission'] = array();
}
if (!$this->config['restricted_user_write_permission']) {
$this->config['restricted_user_write_permission'] = array();
}
if (!$this->config['metasMapper_class']) {
$this->config['metasMapper_class'] = "";
}
if (!$this->config['upload_rep']) {
global $PMBuserid;
$query = "select deflt_upload_repertoire from users where userid = " . $PMBuserid;
$result = pmb_mysql_query($query);
if (pmb_mysql_num_rows($result)) {
$this->config['upload_rep'] = pmb_mysql_result($result, 0, 0);
} else {
$this->config['upload_rep'] = 0;
}
}
$result = parent::get_config_form();
//Included sets
$result .= "\n\t\t\t<div class='row'>\n\t\t\t\t<label for='base_uri'>" . htmlentities($this->msg['webdav_base_uri'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' name='base_uri' value='" . htmlentities($this->config['base_uri'], ENT_QUOTES, $charset) . "'/>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='base_uri'>" . htmlentities($this->msg['webdav_allow_web'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t" . htmlentities($this->msg['webdav_yes'], ENT_QUOTES, $charset) . " <input type='radio' name='allow_web' value='1' " . ($this->config['allow_web'] == 1 ? "checked='checked'" : "") . "/> \n\t\t\t\t" . htmlentities($this->msg['webdav_no'], ENT_QUOTES, $charset) . " <input type='radio' name='allow_web' value='0' " . ($this->config['allow_web'] == 0 ? "checked='checked'" : "") . "/>\n\t\t\t\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='authentication'>" . htmlentities($this->msg['webdav_authentication'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<select name='authentication'>\n\t\t\t\t\t<option value='anonymous' " . ($this->config['authentication'] == "anonymous" ? "selected='selected'" : "") . ">" . htmlentities($this->msg['webdav_anonymous'], ENT_QUOTES, $charset) . "</option>\n\t\t\t\t\t<option value='gestion' " . ($this->config['authentication'] == "gestion" ? "selected='selected'" : "") . ">" . htmlentities($this->msg['webdav_authenticate_gest'], ENT_QUOTES, $charset) . "</option>\n\t\t\t\t\t<option value='opac' " . ($this->config['authentication'] == "opac" ? "selected='selected'" : "") . ">" . htmlentities($this->msg['webdav_authenticate_opac'], ENT_QUOTES, $charset) . "</option>\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='write_permission'>" . htmlentities($this->msg['webdav_write_permission'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t" . htmlentities($this->msg['webdav_yes'], ENT_QUOTES, $charset) . " <input type='radio' name='write_permission' value='1' " . ($this->config['write_permission'] == 1 ? "checked='checked'" : "") . "/> \n\t\t\t\t" . htmlentities($this->msg['webdav_no'], ENT_QUOTES, $charset) . " <input type='radio' name='write_permission' value='0' " . ($this->config['write_permission'] == 0 ? "checked='checked'" : "") . "/>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='restricted_write_permission'>" . htmlentities($this->msg['webdav_restricted_write_permission'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>";
//groupes d'utilisateurs
$result .= "\n\t\t\t\t<div class='colonne2'>\n\t\t\t\t\t<label for='restricted_write_permission'>" . htmlentities($this->msg['webdav_restricted_user_write_permission'], ENT_QUOTES, $charset) . "</label><br />";
$query = "SELECT grp_id, grp_name FROM users_groups ORDER BY grp_name ";
$res = pmb_mysql_query($query);
if (pmb_mysql_num_rows($res) > 0) {
$result .= "\n\t\t\t\t<select id='restricted_user_write_permission' name='restricted_user_write_permission[]' multiple>";
while ($obj = pmb_mysql_fetch_object($res)) {
$result .= "\n\t\t\t\t\t<option value='" . $obj->grp_id . "' " . (in_array($obj->grp_id, $this->config['restricted_user_write_permission']) ? "selected=selected" : "") . ">" . htmlentities($obj->grp_name, ENT_QUOTES, $charset) . "</option>";
}
$result .= " or id_noeud in (select id_noeud from noeuds where num_parent=" . $this->categ->id . "))\n\t\t\t\t\t</select>";
}
$result .= "\n\t\t\t\t</div>";
$result .= "\n\t\t\t\t<div class='colonne-suite'>\n\t\t\t\t\t<label for='restricted_write_permission'>" . htmlentities($this->msg['webdav_restricted_empr_write_permission'], ENT_QUOTES, $charset) . "</label><br />";
//catégories de lecteurs
$requete = "SELECT id_categ_empr, libelle FROM empr_categ ORDER BY libelle ";
$res = pmb_mysql_query($requete);
if (pmb_mysql_num_rows($res) > 0) {
$result .= "\n\t\t\t\t<select id='restricted_empr_write_permission' name='restricted_empr_write_permission[]' multiple>";
while ($obj = pmb_mysql_fetch_object($res)) {
$result .= "\n\t\t\t\t\t<option value='" . $obj->id_categ_empr . "' " . (in_array($obj->id_categ_empr, $this->config['restricted_empr_write_permission']) ? "selected=selected" : "") . ">" . htmlentities($obj->libelle, ENT_QUOTES, $charset) . "</option>";
}
$result .= "\n\t\t\t\t\t</select>";
}
$result .= "\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='included_sets'>" . htmlentities($this->msg['webdav_restricted_sets'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<select MULTIPLE name='included_sets[]'>";
$sets = new connector_out_sets();
foreach ($sets->sets as &$aset) {
$result .= "\n\t\t\t\t\t<option " . (in_array($aset->id, $this->included_sets) ? "selected" : "") . " value='" . $aset->id . "'>" . htmlentities($aset->caption, ENT_QUOTES, $charset) . "</option>";
}
$result .= "\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='used_thesaurus'>" . htmlentities($this->msg['webdav_user_thesaurus'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<select name='used_thesaurus'>";
$liste_thesaurus = thesaurus::getThesaurusList();
foreach ($liste_thesaurus as $id_thesaurus => $libelle_thesaurus) {
$result .= "\n\t\t\t\t\t<option value='" . $id_thesaurus . "' " . ($id_thesaurus == $this->config['used_thesaurus'] ? "selected='selected'" : "") . ">" . htmlentities($libelle_thesaurus, ENT_QUOTES, $charset) . "</option>";
}
$result .= "\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='only_with_notices'>" . htmlentities($this->msg['webdav_only_with_notices'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t" . $this->msg['webdav_yes'] . " <input type='radio' value='1' name='only_with_notices' " . ($this->config['only_with_notices'] ? "checked='checked'" : "") . "/>\n\t\t\t\t" . $this->msg['webdav_no'] . " <input type='radio' value='0' name='only_with_notices' " . ($this->config['only_with_notices'] ? "" : "checked='checked'") . "/> \n\t\t\t</div>";
$result .= "\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='tree'>" . htmlentities($this->msg['webdav_tree'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<select name='tree_elem' id='select_tree_elem' onchange='load_tree_elem(this.value)'>\n\t\t\t\t\t<option value='0'>" . htmlentities($this->msg['webdav_select_tree_elem'], ENT_QUOTES, $charset) . "</option>\n\t\t\t\t\t<option value='typdoc'>typdoc</option>\n\t\t\t\t\t<option value='statut'>statut</option>\n\t\t\t\t\t<option value='categorie'>categorie</option>\n\t\t\t\t\t<option value='indexint'>indexint</option>\n\t\t\t\t</select><br />\n\t\t\t\t<table id='tree'>";
foreach ($this->config['tree'] as $pos => $elem) {
$result .= "\n\t\t\t\t\t<tr id='tree_elem_tr" . $pos . "'>\n\t\t\t\t\t\t<td recept='yes' recepttype='tree_elem' highlight='tree_elem_show_recept' downlight='tree_elem_hide_recept' id='tree_elem_td" . $pos . "' draggable='yes' callback_after='move_tree_elem' dragtype='tree_elem' dragicon='{$base_path}/images/icone_drag_notice.png' dragtext='" . $elem . "'>\n\t\t\t\t\t\t\t<input type='hidden' name='tree[]' value='" . $elem . "' />\n\t\t\t\t\t\t\t<img src='{$base_path}/images/sort.png' style='width:12px; vertical-align:middle'/>" . $elem . "</td>\n\t\t\t\t\t\t<td onclick='tree_elem_delete(\"tree_elem_tr" . $pos . "\");'><img src=\"{$base_path}/images/trash.png\" /></td>\n\t\t\t\t\t</tr>";
}
$result .= "\n\t\t\t\t</table>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tvar nb_tree_elems = " . count($this->config['tree']) . ";\n\t\t\t\t\tfunction load_tree_elem(elem){\n\t\t\t\t\t\tif(elem){\n\t\t\t\t\t\t\tvar tr = document.createElement('tr');\n\t\t\t\t\t\t\tdocument.getElementById('tree').appendChild(tr);\n\t\t\t\t\t\t\ttr.setAttribute('id','tree_elem_tr'+nb_tree_elems);\n\t\t\t\t\t\t\tvar td = document.createElement('td');\t\n\t\t\t\t\t\t\ttd.setAttribute('recept','yes');\n\t\t\t\t\t\t\ttd.setAttribute('recepttype','tree_elem');\n\t\t\t\t\t\t\ttd.setAttribute('highlight','tree_elem_show_recept');\n\t\t\t\t\t\t\ttd.setAttribute('downlight','tree_elem_hide_recept');\n\t\t\t\t\t\t\ttd.setAttribute('id','tree_elem_td'+nb_tree_elems);\n\t\t\t\t\t\t\ttd.setAttribute('draggable','yes');\n\t\t\t\t\t\t\ttd.setAttribute('callback_after','move_tree_elem');\n\t\t\t\t\t\t\ttd.setAttribute('dragtype','tree_elem');\n\t\t\t\t\t\t\ttd.setAttribute('dragicon','{$base_path}/images/icone_drag_notice.png');\n\t\t\t\t\t\t\ttd.setAttribute('dragtext',elem);\n\t\t\t\t\t\t\ttd.innerHTML = '<input type=\"hidden\" name=\"tree[]\" value=\"'+elem+'\" /> <img src=\"{$base_path}/images/sort.png\" style=\"width:12px; vertical-align:middle\"/>'+elem;\n\t\t\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\t\t\tvar td = document.createElement('td');\t\n\t\t\t\t\t\t\ttd.setAttribute('onclick','tree_elem_delete(\"tree_elem_tr'+nb_tree_elems+'\")');\n\t\t\t\t\t\t\ttd.innerHTML = '<img src=\"{$base_path}/images/trash.png\" />';\n\t\t\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\t\t\tnb_tree_elems++;\n\t\t\t\t\t\t\tinit_drag();\n\t\t\t\t\t\t\tdocument.getElementById('select_tree_elem').selectedIndex=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfunction move_tree_elem(elem,evt,target){\n\t\t\t\t\t\n\t\t\t\t\t\tif(target != 'false' || target != 'null'){\n\t\t\t\t\t\t\telem = elem.parentNode;\n\t\t\t\t\t\t\ttarget = document.getElementById(target).parentNode;\n\t\t\t\t\t\t\tparent = target.parentNode;\n\t\t\t\t\t\t\tparent.insertBefore(elem,target);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfunction tree_elem_show_recept(obj){\n\t\t\t\t\t\tobj.style.background='#DDD';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfunction tree_elem_hide_recept(obj){\n\t\t\t\t\t\tobj.style.background='';\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\tfunction tree_elem_delete(id){\n\t\t\t\t\t\tdocument.getElementById(id).parentNode.removeChild(document.getElementById(id));\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='default_statut'>" . htmlentities($this->msg['webdav_metasMapper_class'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\t\t\n\t\t\t\t<input type='text' name='metasMapper_class' value='" . htmlentities($this->config['metasMapper_class'], ENT_QUOTES, $charset) . "'/>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='default_statut'>" . htmlentities($this->msg['webdav_default_statut'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>";
$query = "select id_notice_statut, gestion_libelle from notice_statut order by gestion_libelle";
$res = pmb_mysql_query($query);
if (pmb_mysql_num_rows($res)) {
$result .= "\n\t\t\t\t<select name='default_statut'>";
while ($row = pmb_mysql_fetch_object($res)) {
$result .= "\n\t\t\t\t\t<option value='" . $row->id_notice_statut . "'" . ($row->id_notice_statut == $this->config['default_statut'] ? "selected='selected'" : "") . ">" . htmlentities($row->gestion_libelle, ENT_QUOTES, $charset) . "</option>";
}
$result .= "\n\t\t\t\t</select>";
}
$result .= "\t\t\t\t\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\n\t\t\t<script src=\"./javascript/select.js\" type='text/javascript'></script>\n\t\t\t<script src=\"./javascript/upload.js\" type='text/javascript'></script>";
//Intégration de la gestion de l'interface de l'upload
//statut docunum
$result .= "\n\t\t\t<div class='row'>\n\t\t\t\t<label for='default_docnum_statut'>" . htmlentities($this->msg['webdav_default_docnum_statut'], ENT_QUOTES, $charset) . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>";
$query = "select id_explnum_statut, gestion_libelle from explnum_statut order by gestion_libelle";
$res = pmb_mysql_query($query);
if (pmb_mysql_num_rows($res)) {
$result .= "\n\t\t\t\t<select name='default_docnum_statut'>";
while ($row = pmb_mysql_fetch_object($res)) {
$result .= "\n\t\t\t\t\t<option value='" . $row->id_explnum_statut . "'" . ($row->id_explnum_statut == $this->config['default_docnum_statut'] ? "selected='selected'" : "") . ">" . htmlentities($row->gestion_libelle, ENT_QUOTES, $charset) . "</option>";
}
$result .= "\n\t\t\t\t</select>";
}
$result .= "\n\t\t\t</div>";
global $pmb_docnum_in_database_allow, $pmb_docnum_in_directory_allow;
$result .= "<div class='row'>";
//.........这里部分代码省略.........
示例12: doSearchCandidate
private function doSearchCandidate(Application $app, $bid, $pid, $t, $k, $piv)
{
$ret = new \DOMDocument("1.0", "UTF-8");
$ret->standalone = true;
$ret->preserveWhiteSpace = false;
$root = $ret->appendChild($ret->createElement("result"));
$root->appendChild($ret->createCDATASection(var_export(["bid" => $bid, "pid" => $pid, "t" => $t, "k" => $k, "piv" => $piv], true)));
$ctlist = $root->appendChild($ret->createElement("candidates_list"));
try {
$databox = $app['phraseanet.appbox']->get_databox((int) $bid);
$domstruct = $databox->get_dom_structure();
$domth = $databox->get_dom_thesaurus();
$domct = $databox->get_dom_cterms();
if ($domstruct && $domth && $domct) {
$xpathth = new \DOMXPath($domth);
$xpathct = new \DOMXPath($domct);
// on cherche les champs d'ou peut provenir un candidat, en fct de l'endroit oe on veut inserer le nouveau terme
$fields = array();
$xpathstruct = new \DOMXPath($domstruct);
$nodes = $xpathstruct->query("/record/description/*[@tbranch]");
for ($i = 0; $i < $nodes->length; $i++) {
$fieldname = $nodes->item($i)->nodeName;
$tbranch = $nodes->item($i)->getAttribute("tbranch");
if ($pid != "") {
$q = "(" . $tbranch . ")/descendant-or-self::te[@id='" . $pid . "']";
} else {
$q = "(" . $tbranch . ")/descendant-or-self::te[not(@id)]";
}
$fields[$fieldname] = ["name" => $fieldname, "tbranch" => $tbranch, "cid" => null, "sourceok" => false];
if (!$tbranch) {
continue;
}
$l = $xpathth->query($q)->length;
if ($l > 0) {
// le pt d'insertion du nvo terme se trouve dans la tbranch du champ,
// donc ce champ peut etre source de candidats
$fields[$fieldname]["sourceok"] = true;
} else {
// le pt d'insertion du nvo terme ne se trouve PAS dans la tbranch du champ,
// donc ce champ ne peut pas etre source de candidats
}
}
// on considere que la source 'deleted' est toujours valide
$fields["[deleted]"] = ["name" => $app->trans('thesaurus:: corbeille'), "tbranch" => null, "cid" => null, "sourceok" => true];
if (count($fields) > 0) {
$q = "@w='" . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($t)) . "'";
if ($k) {
if ($k != "*") {
$q .= " and @k='" . \thesaurus::xquery_escape($app['unicode']->remove_indexer_chars($k)) . "'";
}
} else {
$q .= " and not(@k)";
}
$q = "/cterms//te[./sy[{$q}]]";
$nodes = $xpathct->query($q);
// le terme peut etre present dans plusieurs candidats
for ($i = 0; $i < $nodes->length; $i++) {
// on a trouve le terme dans les candidats, mais en provenance de quel champ ?.. on remonte au champ candidat
for ($n = $nodes->item($i)->parentNode; $n && $n->parentNode && $n->parentNode->nodeName != "cterms"; $n = $n->parentNode) {
}
if ($n && array_key_exists($f = $n->getAttribute("field"), $fields)) {
$fields[$f]["cid"] = $nodes->item($i)->getAttribute("id");
}
}
}
foreach ($fields as $kfield => $field) {
if ($field["cid"] === null) {
continue;
}
$ct = $ctlist->appendChild($ret->createElement("ct"));
$ct->setAttribute("field", $field["name"]);
$ct->setAttribute("sourceok", $field["sourceok"] ? "1" : "0");
if ($field["cid"] !== null) {
$ct->setAttribute("id", $field["cid"]);
}
}
}
} catch (\Exception $e) {
}
return $ret;
}
示例13: do_query
function do_query($mode, $param = "")
{
global $lang;
$select = "SELECT DISTINCT noeuds.id_noeud AS categ_id, ";
$from = "FROM noeuds ";
$join = " JOIN categories AS catdef ON noeuds.id_noeud = catdef.num_noeud AND catdef.langue = '" . addslashes($this->thes->langue_defaut) . "' ";
$where = "WHERE 1 ";
$order = "ORDER BY categ_libelle ";
$limit = "";
if ($lang == $this->thes->langue_defaut || in_array($lang, thesaurus::getTranslationsList()) === false) {
$simple = true;
} else {
$simple = false;
}
//$select.= "noeuds.num_parent AS categ_parent, ";
if ($simple) {
$select .= "catdef.libelle_categorie AS categ_libelle, ";
//$select.= "catdef.note_application as categ_comment, ";
//$select.= "catdef.index_categorie as index_categorie ";
} else {
$select .= "IF (catlg.num_noeud IS NULL, catdef.libelle_categorie, catlg.libelle_categorie) AS categ_libelle, ";
$join .= "LEFT JOIN categories AS catlg ON catdef.num_noeud = catlg.num_noeud AND catlg.langue = '" . $lang . "' ";
//$select.= "if (catlg.num_noeud is null, catdef.note_application, catlg.note_application) as categ_comment, ";
//$select.= "if (catlg.num_noeud is null, catdef.index_categorie, catlg.index_categorie) as index_categorie ";
}
if ($mode == 1) {
$where .= "AND noeuds.num_thesaurus = '" . $this->id_thes . "' ";
if ($simple) {
$where .= "AND catdef.libelle_categorie = '" . addslashes($this->term) . "' ";
} else {
$where .= "AND (IF (catlg.num_noeud IS NULL, catdef.libelle_categorie = '" . addslashes($this->term) . "', catlg.libelle_categorie = '" . addslashes($this->term) . "') ) ";
}
} elseif ($mode == 2) {
$from = "FROM voir_aussi JOIN noeuds ON noeuds.id_noeud=voir_aussi.num_noeud_dest ";
//On écrase l'ancien from car ce n'est pas ce que l'on veut
$where .= "AND voir_aussi.num_noeud_orig = '" . $param . "' ";
} elseif ($mode == 3) {
$select .= "noeuds.num_thesaurus as thes_id, ";
$select .= "thesaurus.libelle_thesaurus as thes_libelle, ";
$join .= "JOIN thesaurus ON noeuds.num_thesaurus=thesaurus.id_thesaurus ";
$where .= "AND noeuds.id_noeud = '" . $param . "' ";
} elseif ($mode == 4) {
$where .= "AND noeuds.num_parent = '" . $param . "' ";
$limit .= "LIMIT 400";
}
$select .= "noeuds.num_renvoi_voir AS categ_see ";
$requete = $select . $from . $join . $where . $order . $limit;
return pmb_mysql_query($requete);
}
示例14: extrait_info_notice
function extrait_info_notice($sql = "", $entete = 1, $flag = "")
{
global $dbh;
global $dest;
global $worksheet;
global $myCart;
global $entete_bloc;
global $msg;
global $debligne_excel;
global $etat_table;
// permet de savoir si les tag table sont ouverts ou fermés
global $max_aut;
// le nombre max de colonnes d'auteurs
global $thesaurus_mode_pmb;
global $thesaurus_defaut;
global $lang;
global $pmb_keyword_sep;
global $max_perso;
global $res_compte3;
if (!$debligne_excel) {
$debligne_excel = 0;
}
$res = @mysql_query($sql, $dbh);
$nbr_lignes = @mysql_num_rows($res);
$nbr_champs = @mysql_num_fields($res);
if ($nbr_lignes) {
// Pour les champs personnalisés
$caddie_type = $myCart->type;
switch ($caddie_type) {
case 'EXPL':
$libelle_caddie_type = "expl";
break;
case 'NOTI':
default:
$libelle_caddie_type = "notices";
break;
}
switch ($dest) {
case "TABLEAU":
if ($entete) {
$worksheet->write_string(1 + $debligne_excel, 0, $msg["caddie_mess_edition_" . $entete_bloc]);
$debligne_excel++;
$worksheet->write_string(1 + $debligne_excel, 0, $msg['caddie_action_marque']);
for ($i = 0; $i < $nbr_champs; $i++) {
// entête de colonnes
$fieldname = mysql_field_name($res, $i);
$worksheet->write_string(1 + $debligne_excel, $i + 1, $fieldname);
}
for ($i = 0; $i < $max_aut; $i++) {
$worksheet->write_string(1 + $debligne_excel, $i * 6 + 1 + $nbr_champs, "aut_entree_{$i}");
$worksheet->write_string(1 + $debligne_excel, $i * 6 + 2 + $nbr_champs, "aut_rejete_{$i}");
$worksheet->write_string(1 + $debligne_excel, $i * 6 + 3 + $nbr_champs, "aut_dates_{$i}");
$worksheet->write_string(1 + $debligne_excel, $i * 6 + 4 + $nbr_champs, "aut_fonction_{$i}");
$worksheet->write_string(1 + $debligne_excel, $i * 6 + 5 + $nbr_champs, "aut_type_{$i}");
$worksheet->write_string(1 + $debligne_excel, $i * 6 + 6 + $nbr_champs, "aut_resp_type_{$i}");
}
$worksheet->write_string(1 + $debligne_excel, $max_aut * 6 + $nbr_champs + 1, "DESCR");
for ($i = 0; $i < $max_perso; $i++) {
$perso = mysql_fetch_object($res_compte3);
$worksheet->write_string(1 + $debligne_excel, $max_aut * 6 + $nbr_champs + 2 + $i, $perso->titre);
}
$debligne_excel++;
}
//Fonctions d'auteurs
$codes_auteurs = get_functions_authors();
for ($i = 0; $i < $nbr_lignes; $i++) {
$debligne_excel++;
$row = mysql_fetch_row($res);
switch ($caddie_type) {
case 'EXPL':
$id_notice = $row[2];
break;
case 'NOTI':
default:
$id_notice = $row[0];
break;
}
if ($flag) {
$worksheet->write_string($debligne_excel, 0, "X");
}
$j = 0;
foreach ($row as $dummykey => $col) {
if (!$col) {
$col = " ";
}
$worksheet->write_string($debligne_excel, $j + 1, $col);
$j++;
}
$rqt_aut = "SELECT author_name, author_rejete, author_date, responsability_fonction, author_type, responsability_type ";
$rqt_aut .= "FROM responsability JOIN authors ON responsability_author=author_id ";
$rqt_aut .= "WHERE responsability_notice={$id_notice} ";
$rqt_aut .= "ORDER BY responsability_type ASC, responsability_ordre ASC";
$res_aut = @mysql_query($rqt_aut);
for ($iaut = 0; $iaut < $max_aut; $iaut++) {
$aut = @mysql_fetch_row($res_aut);
$worksheet->write_string($debligne_excel, $iaut * 6 + 1 + $nbr_champs, $aut[0]);
$worksheet->write_string($debligne_excel, $iaut * 6 + 2 + $nbr_champs, $aut[1]);
$worksheet->write_string($debligne_excel, $iaut * 6 + 3 + $nbr_champs, $aut[2]);
$worksheet->write_string($debligne_excel, $iaut * 6 + 4 + $nbr_champs, $codes_auteurs[$aut[3]]);
if ($aut[4] == "70") {
//.........这里部分代码省略.........
示例15: show_list_of_terms
function show_list_of_terms()
{
global $charset;
global $msg;
global $lang;
global $dbh;
global $opac_thesaurus;
global $nbresultterme;
//Si il y a eu erreur lors de la première analyse...
if ($this->error_message) {
return $this->error_message;
}
//Recherche des termes correspondants à la requête
$where_term = $this->get_where_term();
if ($where_term) {
$members_catdef = $this->aq->get_query_members("catdef", "catdef.libelle_categorie", "catdef.index_categorie", "catdef.num_noeud");
$members_catlg = $this->aq->get_query_members("catlg", "catlg.libelle_categorie", "catlg.index_categorie", "catlg.num_noeud");
} else {
echo $msg["term_search_info"];
return;
}
if ($nbresultterme) {
$this->n_total = $nbresultterme;
$requete = "select count(catdef.num_noeud) as nb, ";
} else {
$requete = "select SQL_CALC_FOUND_ROWS count(catdef.num_noeud) as nb, ";
}
if ($this->id_thes != -1) {
//1 seul thesaurus
if ($lang == $this->thes->langue_defaut || in_array($lang, thesaurus::getTranslationsList()) === false) {
//Recherche dans la langue par défaut du thesaurus
$requete .= "num_thesaurus, ";
$requete .= "num_noeud as categ_id, ";
$requete .= "libelle_categorie as categ_libelle, ";
$requete .= "catdef.index_categorie as indexcat ";
if ($where_term) {
$requete .= ", " . $members_catdef["select"] . " as pert ";
}
$requete .= "from categories as catdef ";
$requete .= "where 1 ";
if ($where_term) {
$requete .= "and " . $members_catdef["where"] . " ";
}
$requete .= "and num_thesaurus = '" . $this->id_thes . "' ";
$requete .= "and catdef.langue = '" . $this->thes->langue_defaut . "' ";
$requete .= "and catdef.libelle_categorie not like '~%' ";
$requete .= "group by categ_libelle ";
$requete .= "order by ";
if ($where_term) {
$requete .= "pert desc, ";
}
$requete .= "indexcat asc ";
$requete .= "limit " . $this->offset . "," . $this->n_per_page;
} else {
//Recherche dans la langue de l'interface ou dans la langue par défaut du thesaurus
$requete .= "catdef.num_thesaurus, ";
$requete .= "catdef.num_noeud as categ_id, ";
$requete .= "if (catlg.num_noeud is null, catdef.libelle_categorie, catlg.libelle_categorie ) as categ_libelle, ";
$requete .= "if (catlg.num_noeud is null, catdef.index_categorie , catlg.index_categorie ) as indexcat ";
if ($where_term) {
$requete .= ", if (catlg.num_noeud is null, " . $members_catdef["select"] . ", " . $members_catlg["select"] . ") as pert ";
}
$requete .= "from categories as catdef ";
$requete .= "left join categories as catlg on catdef.num_noeud = catlg.num_noeud and catlg.langue = '" . $lang . "' ";
$requete .= "where 1 ";
if ($where_term) {
$requete .= "and (if(catlg.num_noeud is null, " . $members_catdef["where"] . ", " . $members_catlg["where"] . ") ) ";
}
$requete .= "and catdef.num_thesaurus = '" . $this->id_thes . "' ";
$requete .= "and catdef.langue = '" . $this->thes->langue_defaut . "' ";
$requete .= "and catdef.libelle_categorie not like '~%' ";
$requete .= "group by categ_libelle ";
$requete .= "order by ";
if ($where_term) {
$requete .= "pert desc, ";
}
$requete .= "indexcat asc ";
$requete .= "limit " . $this->offset . "," . $this->n_per_page;
}
} else {
//tous les thesaurus
//on recherche dans la langue de l'interface ou dans la langue par défaut du thesaurus
$requete .= "catdef.num_thesaurus, ";
$requete .= "catdef.num_noeud as categ_id, ";
$requete .= "if (catlg.num_noeud is null, catdef.libelle_categorie , catlg.libelle_categorie ) as categ_libelle, ";
$requete .= "if (catlg.num_noeud is null, catdef.index_categorie , catlg.index_categorie ) as indexcat ";
if ($where_term) {
$requete .= ", if (catlg.num_noeud is null, " . $members_catdef["select"] . ", " . $members_catlg["select"] . ") as pert ";
}
$requete .= "from thesaurus ";
$requete .= "left join categories as catdef on id_thesaurus=catdef.num_thesaurus and catdef.langue=thesaurus.langue_defaut ";
$requete .= "left join categories as catlg on catdef.num_noeud=catlg.num_noeud and catlg.langue = '" . $lang . "' ";
if ($where_term) {
$requete .= "where if(catlg.num_noeud is null, " . $members_catdef["where"] . ", " . $members_catlg["where"] . ") ";
}
$requete .= "group by categ_libelle, catdef.num_thesaurus ";
$requete .= "order by ";
if ($where_term) {
$requete .= "pert desc, ";
}
//.........这里部分代码省略.........