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


PHP thesaurus::is_equivalent方法代码示例

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


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

示例1: display


//.........这里部分代码省略.........
                             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);
                         }
                     }
                     // 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}&amp;action=show", "name", "", $id);
                     } else {
                         $tempString .= form::link("", "<span {$styleString}>" . $textString . "</span>", "index.php?id={$id}&amp;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'>";
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:67,代码来源:hyrarchy.php

示例2: get_child

 function get_child($deskriptorID)
 {
     $visible = session::get(visible);
     $descType = session::get(descriptor);
     //    if ($visible) $visibleString = " and entry.status=statustype.ID and statustype.visible='1'";
     $queryString = "SELECT parent.child \r\n    \tFROM entry,parent,linktype,statustype \r\n    \tWHERE entry.ID={$deskriptorID} \r\n    \t\tand parent.parent=entry.ID \r\n    \t\tand parent.type=linktype.ID and linktype.hyrarchic='1'\r\n    \t\t{$visibleString}\r\n        ";
     //echoalert($queryString);
     $tempArray = fetch_to_array(database::query($queryString), "child");
     // order by entry names
     if ($tempArray) {
         foreach ($tempArray as $entry) {
             // is descriptor
             // or is non-descriptor with children
             $cntChild = mysql_num_rows(database::query("SELECT * FROM entry,parent,linktype WHERE entry.ID='{$entry}' and entry.ID=parent.parent and parent.type=linktype.ID and linktype.hyrarchic='1'"));
             if (thesaurus::is_descriptor($entry) or $visible and !thesaurus::is_visible($entry) or $descType and thesaurus::is_equivalent($entry) or $cntChild) {
                 $orderArray[$entry] = strtolower(thesaurus::get_name($entry));
                 // array lowercase for sorting
                 asort($orderArray);
             }
         }
         // rewrite sorted array
         if (is_array($orderArray)) {
             return array_keys($orderArray);
         } else {
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:30,代码来源:thesaurus.php


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