本文整理汇总了PHP中thesaurus::parent_num方法的典型用法代码示例。如果您正苦于以下问题:PHP thesaurus::parent_num方法的具体用法?PHP thesaurus::parent_num怎么用?PHP thesaurus::parent_num使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thesaurus
的用法示例。
在下文中一共展示了thesaurus::parent_num方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($id, $linktype)
{
echo "<table width='100%'>";
echo "<tr>";
echo "<td>";
// open tree to selected parent
action::open_tree();
// open deskriptor
action::show();
if (right::link()) {
// swap direktion for equivalent links
if ($linktype == 2 and right::write()) {
action::swap($id);
}
// change OB
if ($linktype == 1 and right::write()) {
action::change($id);
}
}
echo "</td>";
if (right::link()) {
echo "<td align='right'>";
if (right::write()) {
// make new parent link
action::add_link($id, $linktype);
if ($linktype == 1) {
$minimum = 1;
} else {
$linktype == 0;
}
// unlink selected parent
if (thesaurus::parent_num($id) > $minimum) {
action::unlink();
}
}
echo "</td>";
}
echo "</tr>";
echo "</table>";
}
示例2: display
function display($parent, $depth, $pos, $errorArray)
{
// V2.0
// starting on thesaurus level
if ($parent == 0) {
$elementArray = thesaurus::get_thesaurus_list();
// get thesauri
} else {
$elementArray = thesaurus::get_child($parent);
}
// get children
// entries found
if (is_array($elementArray)) {
$cntElements = count($elementArray);
// start new line
if (!isset($pos)) {
$pos = 0;
}
// set position to 0
$line = new line();
// ****************************************************************
// start array
$lineCnt = 0;
foreach ($elementArray as $id) {
// don't display if
// non descriptor
// or not visible
// if ((thesaurus::is_descriptor($id) or session::get("descriptor"))
// and (thesaurus::is_visible($id) or session::get("visible"))
// )
if (thesaurus::is_visible($id) or session::get("visible")) {
$cntParents = thesaurus::parent_num($id);
$equivArray = thesaurus::get_equiv($id, "BS");
if (is_array($equivArray)) {
$cntEquiv = count($equivArray);
} else {
$cntEquiv = 0;
}
// get count and list of subentries
$childrenArray = thesaurus::get_child($id);
$cntChildren = thesaurus::child_num($id, session::get(descriptor));
// get entry details
$entry = thesaurus::get_descriptor($id);
// ECHO ENTRY
// space in front
$x = 0;
while ($x < $pos - 1) {
$line->insert(grafik::disp("line", "|", 20), 20);
// insert line-grafik
$x++;
}
// search elements in next level enabled
if ($depth > $pos or $depth == -1) {
// display tree grafik
if ($pos > 0) {
if ($lineCnt++ < $cntElements - 1) {
$line->insert(grafik::disp("subtree", "|", 20), 20);
} else {
$line->insert(grafik::disp("subend", "|", 20), 20);
}
// insert sub end icon
}
// display open / close icon if subobjects
if ($cntChildren != 0) {
// subobjects found -> display icon to open / close
if (thesaurus::is_open($id)) {
if ($pos > 0) {
$tempString = form::link("minus", "[+]", "index.php?id={$id}&action=close", "close");
} else {
$tempString = form::link("thesaurus-open", "[+]", "index.php?id={$id}&action=close", "close");
}
} else {
if ($pos > 0) {
$tempString = form::link("plus", "[+]", "index.php?id={$id}&action=open", "open");
} else {
$tempString = form::link("thesaurus", "[T]", "index.php?id={$id}&action=open", "open");
}
}
} else {
$tempString = grafik::disp("space", " ", 20);
}
$line->insert($tempString, 20);
// insert navigation symbols
$tempString = "";
// Display parent and child link icon
if (session::get("show")) {
// display parent arrow
if (thesaurus::is_child_of(session::get("show"), $id) and session::get("show")) {
$line->insert(grafik::arrow("right", "blue", 15), 20);
// display parent arrow
}
// display link-arrow
if (thesaurus::is_parent_of(session::get("show"), $id)) {
$line->insert(grafik::arrow("right", "orange", 15), 20);
}
// display associate links
if (thesaurus::is_assoc_of(session::get("show"), $id)) {
$line->insert(grafik::disp("assoc", "=", 20), 20);
}
}
//.........这里部分代码省略.........