本文整理汇总了PHP中thesaurus::get_type_name方法的典型用法代码示例。如果您正苦于以下问题:PHP thesaurus::get_type_name方法的具体用法?PHP thesaurus::get_type_name怎么用?PHP thesaurus::get_type_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thesaurus
的用法示例。
在下文中一共展示了thesaurus::get_type_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_link
function add_link($id, $linktype)
{
if ($linktype > 0) {
$typename = thesaurus::get_type_name($linktype);
// make new parent link
echo form::link($typename, "new", "index.php?id={$id}&linkaction=link&link=" . $id . "&linktype={$linktype}", "newlink_{$linktype}");
} else {
echo form::link("add", "+", "index.php?action=add&parent={$id}", "add");
}
}
示例2: display
//.........这里部分代码省略.........
}
}
// entry name
$textLength = strlen($entry[name]) * 15;
$textString = $entry[name];
// set style for selection
$styleString = "";
if (thesaurus::is_equivalent($id)) {
$styleString = "class='bright'";
}
if (thesaurus::is_descriptor($id)) {
$textString = strtoupper($textString);
}
if ($id == session::get("show")) {
$styleString = "class='select'";
} elseif ($cntParents > 1) {
$styleString = "class='multiple'";
}
if (!thesaurus::is_visible($id)) {
$styleString = "class='red'";
}
if (thesaurus::is_deleted($id)) {
$styleString = "class='through'";
}
// draw name with link
if ($pos == 0) {
$tempString .= form::link("", "<b><span {$styleString}>" . $textString . "</span></b>", "index.php?id={$id}&action=show", "name", "", $id);
} else {
$tempString .= form::link("", "<span {$styleString}>" . $textString . "</span>", "index.php?id={$id}&action=show", "name", "", $id);
}
// number of sub-objects
if ($cntChildren) {
$subText = "";
$listCnt = 0;
foreach ($childrenArray as $entry) {
$subText .= thesaurus::get_name($entry) . "<br>";
}
$tempString .= "<span ";
$tempString .= help::show("elementcount", $subText) . ">";
$tempString .= "<i class='small'>";
if ($cntChildren) {
$tempString .= " ({$cntChildren} UB)</i>";
}
$tempString .= "</span>";
}
// number of equiv-objects
if ($cntEquiv) {
$equivText = "";
$listCnt = 0;
foreach ($equivArray as $entry) {
$equivText .= thesaurus::get_name($entry) . "<br>";
}
$tempString .= "<span ";
$tempString .= help::show("equivcount", $equivText) . ">";
$tempString .= "<i class='small'>";
if ($cntEquiv) {
$tempString .= " ({$cntEquiv} BS)</i>";
}
$tempString .= "</span>";
}
// Count of containing elements
// show owner
$ownerID = thesaurus::get_owner($entry[ID]);
$infoText = "ID: " . $id;
$infoText .= "<br>Status: " . thesaurus::get_status_name(thesaurus::get_status($id));
// $infoText .= "<br>Begriffstyp: " . thesaurus::get_entrytype_name(thesaurus::get_entrytype($id));
$infoText .= "<br>Ersteller: " . user::name($ownerID);
$tempString .= " " . form::link("", "?", "", "owner", $infoText);
// Edit Link
$tempString .= form::link("add", "add", "index.php?parent={$id}&action=add", "add");
// Delete Link
if ($cntChildren == 0) {
$javaText = "Wollen Sie " . $entry[name] . " wirklich löschen? Es werden auch alle Links zu diesem Eintrag gelöscht";
$tempString .= form::link("delete", "x", "javascript:get_confirm("{$javaText}","index.php?action=deleteid&id={$id}");", "delete");
}
// Link Link
if (session::get("link") and $id != session::get("link")) {
if (!thesaurus::is_parent_of(session::get("link"), $id) or session::get(linkaction) == "change") {
$linkType = "do" . thesaurus::get_type_name(session::get("linktype"));
$tempString .= form::link($linkType, "L", "index.php?id={$id}&linkaction=linkdo", "{$linkType}");
}
}
$line->insert($tempString);
// Insert text in line
$tempString = "";
// recursive display subtree
if (thesaurus::is_open($id)) {
// recursive call of level
if (thesaurus::child_num($id, 1)) {
hyrarchy::display_line($line);
hyrarchy::display($id, $depth, $pos + 1, $errorArray);
}
}
}
// display line
hyrarchy::display_line($line);
}
}
}
}