本文整理汇总了PHP中categories::listAncestorNames方法的典型用法代码示例。如果您正苦于以下问题:PHP categories::listAncestorNames方法的具体用法?PHP categories::listAncestorNames怎么用?PHP categories::listAncestorNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类categories
的用法示例。
在下文中一共展示了categories::listAncestorNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: traite_categories_for_form
function traite_categories_for_form($tableau_600 = "", $tableau_601 = "", $tableau_602 = "", $tableau_605 = "", $tableau_606 = "", $tableau_607 = "", $tableau_608 = "")
{
global $charset, $rameau, $lang, $msg;
$tabl_categ_lib = array();
category_auto::save_info_categ($tabl_categ_lib);
$list_rameau = array();
$pile = array();
$tabl_build = array();
$incr = 0;
$id_parent = $id_thes = 0;
foreach ($tabl_categ_lib as $key => $value) {
if (array_key_exists("link", $value)) {
if ($value["id_thes"] && !$value["link"] && !$value["word_parent"]) {
$id_parent = $value["id_parent"];
$id_thes = $value["id_thes"];
$thes_temp = new thesaurus($value["id_thes"]);
$lib = "[" . $thes_temp->libelle_thesaurus . "]";
$pile = array();
if ($value["id_parent"] && ($lib_hierar = trim(categories::listAncestorNames($value["id_parent"], $lang)))) {
$pile[] = $lib . " " . $lib_hierar . ":";
} else {
$pile[] = $lib . " ";
}
$pile[] = $value["wording"];
} else {
if ($value["link"] == 1) {
$lib_temp = implode("", $pile);
$list_rameau[$lib_temp] = htmlentities($lib_temp, ENT_QUOTES, $charset);
if (!$value["create_node"]) {
$list_rameau[$lib_temp] .= "</b>" . htmlentities($msg["func_category_auto_reprise"], ENT_QUOTES, $charset) . "<b>";
}
$tabl_build[$incr]["wording"] = $pile;
$tabl_build[$incr]["id_thes"] = $id_thes;
$tabl_build[$incr]["id_parent"] = $id_parent;
$tabl_build[$incr]["create_node"] = $value["create_node"];
$incr++;
} else {
while ($pile[count($pile) - 1] != $value["word_parent"] && count($pile)) {
array_pop($pile);
}
array_push($pile, ":");
array_push($pile, $value["wording"]);
}
}
} else {
if ($value["id_thes"] && $value["wording"]) {
$thes_temp = new thesaurus($value["id_thes"]);
$lib = "[" . $thes_temp->libelle_thesaurus . "]";
$lib_hierar = "";
if ($value["id_parent"]) {
$lib_hierar = " " . categories::listAncestorNames($value["id_parent"], $lang);
}
if (trim($lib_hierar)) {
$lib .= $lib_hierar . ":" . $value["wording"];
} else {
$lib .= " " . $value["wording"];
}
$list_rameau[$lib] = htmlentities($lib, ENT_QUOTES, $charset);
if (!$value["id_parent"]) {
$list_rameau[$lib] .= "</b>" . htmlentities($msg["func_category_auto_reprise"], ENT_QUOTES, $charset) . "<b>";
}
$tabl_build[$incr]["wording"] = $value["wording"];
$tabl_build[$incr]["id_thes"] = $value["id_thes"];
$tabl_build[$incr]["id_parent"] = $value["id_parent"];
$incr++;
}
}
}
$champ_rameau = "";
$champ_rameau .= implode("<br/>", $list_rameau);
//$champ_rameau.="<pre>".print_r($tabl_categ_lib,true)."</pre>";
$rameau_form = serialize($tabl_build);
// $rameau est la variable traitée par la fonction traite_categories_from_form,
// $rameau est normalement POSTée, afin de pouvoir être traitée en lot, donc hors
// formulaire, il faut l'affecter.
$rameau = addslashes(serialize($tabl_build));
return array("form" => "<input type='hidden' name='rameau' value='" . htmlentities($rameau_form, ENT_QUOTES, $charset) . "' />", "message" => htmlentities($msg["func_category_auto_reprise_suivante"], ENT_QUOTES, $charset) . "<br/><b>" . $champ_rameau . "</b>");
}
示例2: categories
$display .= '';
}
if ($categ->categ_see) {
$temp = new categories($categ->categ_see, $categ->langue);
$display .= $categ->categ_libelle . " -> <i>";
if ($thesaurus_categories_show_only_last) {
$display .= $temp->libelle_categorie;
} else {
$display .= categories::listAncestorNames($categ->categ_see, $categ->langue);
}
$display .= "@</i>";
} else {
if ($thesaurus_categories_show_only_last) {
$display .= $categ->categ_libelle;
} else {
$display .= categories::listAncestorNames($categ->categ_id, $categ->langue);
}
}
$acateg = new category($categ->categ_id);
$notice_count = $acateg->notice_count(false);
$categ_entry = $display;
$categ_comment = $categ->categ_comment;
$link_categ = "./autorites.php?categ=categories&sub=categ_form&parent=0&id=" . $categ->categ_id . "&id_thes=" . $categ->num_thesaurus . "&user_input=" . rawurlencode(stripslashes($user_input)) . "&nbr_lignes=" . $nbr_lignes . "&page=" . $page . "&nb_per_page=" . $nb_per_page;
if ($parity % 2) {
$pair_impair = "even";
} else {
$pair_impair = "odd";
}
$parity += 1;
$tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
$categ_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>\n \t\t\t\t<td valign='top' onmousedown=\"document.location='{$link_categ}';\">\n\t\t\t\t\t\t{$categ_entry}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td valign='top' onmousedown=\"document.location='{$link_categ}';\">\n\t\t\t\t\t\t{$categ_comment}\n\t\t\t\t\t\t</td>";
示例3:
$display_temp = $categ->categ_libelle . " -> ";
$chemin = categories::listAncestorNames($categ->categ_see, $categ->langue);
if ($thesaurus_categories_show_only_last) {
$display_temp .= $temp->libelle_categorie;
$lib_simple .= $temp->libelle_categorie;
} else {
$display_temp .= $chemin;
if ($from == "notice") {
$lib_simple .= $chemin;
} else {
$lib_simple .= $temp->libelle_categorie;
}
}
$display_temp .= "@";
} else {
$chemin = categories::listAncestorNames($categ->categ_id, $categ->langue);
if ($thesaurus_categories_show_only_last) {
$display_temp .= $categ->categ_libelle;
$lib_simple .= $categ->categ_libelle;
} else {
$display_temp .= $chemin;
if ($from == "notice") {
$lib_simple .= $chemin;
} else {
$lib_simple .= $categ->categ_libelle;
}
}
}
if (!$not_use_in_indexation && !preg_match("#:~|^~#i", $chemin)) {
$tab_lib_categ[$display_temp] = $lib_simple;
$array_selector[$id_categ_retenue] = $tab_lib_categ;
示例4: val_query_auth_empr
function val_query_auth_empr($field, $val)
{
global $lang, $pmb_perso_sep, $charset;
$name = $field[NAME];
$options = $field[OPTIONS][0];
$isbd_s = array();
$isbd_without = array();
if (!$val) {
return "";
}
foreach ($val as $id) {
switch ($field["OPTIONS"][0]["DATA_TYPE"]["0"]["value"]) {
case 1:
// auteur
$aut = new auteur($id);
$isbd_s[] = $aut->isbd_entry;
$isbd_without[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 2:
// categories
if ($field["OPTIONS"][0]["CATEG_SHOW"]["0"]["value"] == 1) {
$isbd_s[] = htmlentities(categories::getLibelle($id, $lang), ENT_QUOTES, $charset);
$isbd_without[] = categories::getLibelle($id, $lang);
} else {
$isbd_s[] = htmlentities(categories::listAncestorNames($id, $lang), ENT_QUOTES, $charset);
$isbd_without[] = categories::listAncestorNames($id, $lang);
}
break;
case 3:
// Editeur
$aut = new publisher($id);
$isbd_s[] = $aut->isbd_entry;
$isbd_without[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 4:
// collection
$aut = new collection($id);
$isbd_s[] = $aut->isbd_entry;
$isbd_without[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 5:
// subcollection
$aut = new subcollection($id);
$isbd_s[] = $aut->isbd_entry;
$isbd_without[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 6:
// Titre de serie
$aut = new serie($id);
$isbd_s[] = htmlentities($aut->name, ENT_QUOTES, $charset);
$isbd_without[] = $aut->name;
break;
case 7:
// Indexation decimale
$aut = new indexint($id);
$isbd_s[] = htmlentities($aut->display, ENT_QUOTES, $charset);
$isbd_without[] = $aut->display;
break;
case 8:
// titre uniforme
$aut = new titre_uniforme($id);
$isbd_s[] = htmlentities($aut->libelle, ENT_QUOTES, $charset);
$isbd_without[] = $aut->libelle;
break;
}
}
return array("ishtml" => true, "value" => implode($pmb_perso_sep, $isbd_s), "withoutHTML" => implode($pmb_perso_sep, $isbd_without));
}
示例5: val_query_auth_empr
function val_query_auth_empr($field)
{
global $lang, $pmb_perso_sep, $charset;
$name = $field[NAME];
$options = $field[OPTIONS][0];
$isbd_s = array();
if (!$field[VALUES]) {
return "";
}
foreach ($field[VALUES] as $id) {
if ($id) {
switch ($field["OPTIONS"][0]["DATA_TYPE"]["0"]["value"]) {
case 1:
// auteur
$aut = new auteur($id);
$isbd_s[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 2:
// categories
$isbd_s[] = html_entity_decode(categories::listAncestorNames($id, $lang), ENT_QUOTES, $charset);
break;
case 3:
// Editeur
$aut = new editeur($id);
$isbd_s[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 4:
// collection
$aut = new collection($id);
$isbd_s[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 5:
// subcollection
$aut = new subcollection($id);
$isbd_s[] = html_entity_decode($aut->isbd_entry, ENT_QUOTES, $charset);
break;
case 6:
// Titre de serie
$aut = new serie($id);
$isbd_s[] = html_entity_decode($aut->name, ENT_QUOTES, $charset);
break;
case 7:
// Indexation decimale
$aut = new indexint($id);
$isbd_s[] = html_entity_decode($aut->display, ENT_QUOTES, $charset);
break;
case 8:
// titre uniforme
$aut = new titre_uniforme($id);
$isbd_s[] = html_entity_decode($aut->libelle, ENT_QUOTES, $charset);
break;
}
}
}
$aff = implode($pmb_perso_sep, $isbd_s);
return $aff;
}