当前位置: 首页>>代码示例>>PHP>>正文


PHP thesaurus::getTranslationsList方法代码示例

本文整理汇总了PHP中thesaurus::getTranslationsList方法的典型用法代码示例。如果您正苦于以下问题:PHP thesaurus::getTranslationsList方法的具体用法?PHP thesaurus::getTranslationsList怎么用?PHP thesaurus::getTranslationsList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thesaurus的用法示例。


在下文中一共展示了thesaurus::getTranslationsList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: thesaurus

//recuperation du thesaurus session
if (!$id_thes) {
    $id_thes = thesaurus::getSessionThesaurusId();
}
if ($id_thes == '-1') {
    $id_thes = $thesaurus_defaut;
}
thesaurus::setSessionThesaurusId($id_thes);
$thes = new thesaurus($id_thes);
//Récuperation de la liste des langues définies pour l'interface
$langages = new XMLlist("{$include_path}/messages/languages.xml", 1);
$langages->analyser();
$lg = $langages->table;
//Récuperation de la liste des langues définies pour les thésaurus
//autre que la langue par defaut du thesaurus
$thes_liste_trad = thesaurus::getTranslationsList();
$lg1 = array();
foreach ($thes_liste_trad as $dummykey => $item) {
    if ($item != $thes->langue_defaut && $lg[$item] != '') {
        $lg1[$item] = $lg[$item];
    }
}
// dessin du form
$see_also = array();
if ($id) {
    $title = $msg[318];
    $action = "./autorites.php?categ=categories&sub=update&id={$id}&parent={$parent}";
    $delete_button = "<input type='button' class='bouton' value='{$msg['63']}' onClick=\"confirm_delete();\">";
    $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' ";
    $button_voir .= "onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=1&etat=aut_search&aut_type=categ&aut_id={$id}\"'>";
    // on récupère les données de la catégorie
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:categ_form.inc.php

示例2: array

 $members_catlg = $aq->get_query_members('catlg', 'catlg.libelle_categorie', 'catlg.index_categorie', 'catlg.num_noeud');
 $list_thes = array();
 if ($id_thes == -1) {
     //recherche dans tous les thesaurus
     $list_thes = thesaurus::getThesaurusList();
 } else {
     //recherche dans le thesaurus transmis
     $thes = new thesaurus($id_thes);
     $list_thes[$id_thes] = $thes->libelle_thesaurus;
 }
 $q = "drop table if exists catjoin ";
 $r = mysql_query($q, $dbh);
 $q = "create temporary table catjoin ENGINE=MyISAM as select ";
 foreach ($list_thes as $id_thesaurus => $libelle_thesaurus) {
     $thes = new thesaurus($id_thesaurus);
     if ($lang == $thes->langue_defaut || in_array($lang, thesaurus::getTranslationsList()) === false) {
         $q .= "noeuds.num_thesaurus, ";
         $q .= "noeuds.id_noeud as num_noeud, ";
         $q .= "catdef.note_application as note_application, ";
         $q .= "catdef.comment_public as comment_public, ";
         $q .= "noeuds.num_renvoi_voir, ";
         $q .= "catdef.libelle_categorie as libelle_categorie, ";
         $q .= "catdef.index_categorie as index_categorie, ";
         $q .= " " . $members_catdef['select'] . " as pert ";
         $q .= "from noeuds ";
         $q .= "join categories as catdef on noeuds.id_noeud = catdef.num_noeud and catdef.langue = '" . $thes->langue_defaut . "' ";
         $q .= "where 1 ";
         $q .= "and noeuds.num_thesaurus = '" . $thes->id_thesaurus . "' ";
         $q .= "and " . $first_clause . " ";
         $q .= "and " . $members_catdef['where'] . " ";
     } else {
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:category.inc.php

示例3: 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, ";
         }
//.........这里部分代码省略.........
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:101,代码来源:term_search.class.php

示例4: 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);
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:49,代码来源:term_show.class.php

示例5: search_categories

 function search_categories()
 {
     global $opac_search_other_function, $typdoc, $dbh, $charset, $opac_thesaurus_defaut, $lang, $opac_thesaurus;
     global $opac_stemming_active;
     $first_clause .= "categories.libelle_categorie not like '~%' ";
     $q = 'drop table if exists catjoin ';
     $r = pmb_mysql_query($q, $dbh);
     $q = 'create  temporary table catjoin ( ';
     $q .= "num_thesaurus int(3) unsigned not null default '0', ";
     $q .= "num_noeud int(9) unsigned not null default '0', ";
     $q .= 'key (num_noeud,num_thesaurus) ';
     $q .= ") ENGINE=MyISAM ";
     $r = pmb_mysql_query($q, $dbh);
     $list_thes = array();
     if ($opac_thesaurus) {
         //mode multithesaurus
         $list_thes = thesaurus::getThesaurusList();
         $id_thes_for_link = -1;
     } else {
         //mode monothesaurus
         $thes = new thesaurus($opac_thesaurus_defaut);
         $list_thes[$opac_thesaurus_defaut] = $thes->libelle_thesaurus;
         $id_thes_for_link = $opac_thesaurus_defaut;
     }
     $aq = new analyse_query(stripslashes($this->user_query), 0, 0, 1, 0, $opac_stemming_active);
     $members_catdef = $aq->get_query_members('catdef', 'catdef.libelle_categorie', 'catdef.index_categorie', 'catdef.num_noeud');
     $members_catlg = $aq->get_query_members('catlg', 'catlg.libelle_categorie', 'catlg.index_categorie', 'catlg.num_noeud');
     foreach ($list_thes as $id_thesaurus => $libelle_thesaurus) {
         $thes = new thesaurus($id_thesaurus);
         $q = "INSERT INTO catjoin SELECT noeuds.num_thesaurus, noeuds.id_noeud FROM ";
         if ($lang == $thes->langue_defaut || in_array($lang, thesaurus::getTranslationsList()) === false) {
             $q .= "noeuds JOIN categories as catdef on noeuds.id_noeud = catdef.num_noeud AND  catdef.langue = '" . $thes->langue_defaut . "'";
             //$q.=" WHERE noeuds.num_thesaurus='".$id_thesaurus."' AND not_use_in_indexation='0' AND catdef.libelle_categorie not like '~%' and ".$members_catdef["where"];
             $q .= " WHERE noeuds.num_thesaurus='" . $id_thesaurus . "' AND catdef.libelle_categorie not like '~%' and " . $members_catdef["where"];
         } else {
             $q .= "noeuds JOIN categories as catdef on noeuds.id_noeud = catdef.num_noeud AND catdef.langue='" . $thes->langue_defaut . "' JOIN categories as catlg on catdef.num_noeud=catlg.num_noeud and catlg.langue = '" . $lang . "'";
             //$q.=" WHERE noeuds.num_thesaurus='".$id_thesaurus."' AND not_use_in_indexation='0' AND if(catlg.num_noeud is null, ".$members_catdef["where"].", ".$members_catlg["where"].") AND if(catlg.num_noeud is null,catdef.libelle_categorie not like '~%',catlg.libelle_categorie not like '~%')";
             $q .= " WHERE noeuds.num_thesaurus='" . $id_thesaurus . "' AND if(catlg.num_noeud is null, " . $members_catdef["where"] . ", " . $members_catlg["where"] . ") AND if(catlg.num_noeud is null,catdef.libelle_categorie not like '~%',catlg.libelle_categorie not like '~%')";
         }
         $r = pmb_mysql_query($q, $dbh);
     }
     $clause = '';
     $add_notice = '';
     if ($opac_search_other_function) {
         $add_notice = search_other_function_clause();
     }
     if ($typdoc || $add_notice) {
         $clause .= ' JOIN notices_categories ON notices_categories.num_noeud=catjoin.num_noeud JOIN notices ON notices_categories.notcateg_notice=notices.notice_id WHERE 1 ';
     } else {
         $clause .= ' WHERE 1 ';
     }
     if ($typdoc) {
         $clause .= " and typdoc='" . $typdoc . "' ";
     }
     if ($add_notice) {
         $clause .= ' and notice_id in (' . $add_notice . ')';
     }
     $q = 'select count(distinct catjoin.num_noeud) from catjoin ' . $clause;
     $r = pmb_mysql_query($q);
     $nb_result_categories = pmb_mysql_result($r, 0, 0);
     if ($nb_result_categories) {
         $form = "<form name=\"search_categorie\" action=\"./index.php?lvl=more_results\" method=\"post\">";
         $form .= "<input type=\"hidden\" name=\"user_query\" value=\"" . htmlentities(stripslashes($this->user_query), ENT_QUOTES, $charset) . "\">\n";
         if (function_exists("search_other_function_post_values")) {
             $form .= search_other_function_post_values();
         }
         $form .= "<input type=\"hidden\" name=\"mode\" value=\"categorie\">\n";
         $form .= "<input type=\"hidden\" name=\"search_type_asked\" value=\"simple_search\">\n";
         $form .= "<input type=\"hidden\" id=\"count\" name=\"count\" value=\"" . $nb_result_categories . "\">\n";
         $form .= "<input type=\"hidden\" name=\"clause\" value=\"" . htmlentities($clause, ENT_QUOTES, $charset) . "\">\n";
         $form .= "<input type=\"hidden\" id=\"id_thes\" name=\"id_thes\" value=\"" . $id_thes_for_link . "\"></form>\n";
         $_SESSION["level1"]["category"]["form"] = $form;
         $_SESSION["level1"]["category"]["count"] = $nb_result_categories;
     }
     return $nb_result_categories;
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:76,代码来源:level1_search.class.php


注:本文中的thesaurus::getTranslationsList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。