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


PHP thesaurus::get_descriptor方法代码示例

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


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

示例1: display

 function display($searchResult)
 {
     if ($searchResult) {
         echo "<div id='result' class='search'>";
         echo "<b>Suchergebnis - </b>";
         echo " <i class='normal'>" . count($searchResult) . " Treffer</i>";
         echo form::link("delete", "x", "index.php?action=hidesearch", "close-search");
         action::listit("search", $searchResult);
         foreach ($searchResult as $entry) {
             $nameArray = thesaurus::get_descriptor($entry[ID]);
             export::descriptor($nameArray[ID], session::get("search"), "SHOW");
             echo "<hr>";
         }
         // set parent
         if (session::get(show) != 0) {
             $parent = session::get(show);
         } else {
             $parent = system::getval("val_orderdefault");
         }
         // sugest new entry if orderdefault is set or OB is displayed
         if ($parent) {
             form::insert_entry(array('parent' => $parent, 'action' => 'add', ""), array(), session::get(search));
         } else {
             echo "<p>Kein Oberbegriff für neuen Begriff gesetzt.</p>";
         }
         echo "</div>";
     } else {
         echo "<div id='result' class='search'>";
         echo "<span class='red'>Kein Eintrag gefunden</span>";
         echo form::link("delete", "x", "index.php?action=hidesearch", "close-search");
         // set parent
         if (session::get(show) != 0) {
             $parent = session::get(show);
         } else {
             $parent = system::getval("val_orderdefault");
         }
         // sugest new entry if orderdefault is set or OB is displayed
         if ($parent) {
             form::insert_entry(array('parent' => $parent, 'action' => 'add', ""), array(), session::get(search));
         } else {
             echo "<p>Kein Oberbegriff für neuen Begriff gesetzt.</p>";
         }
         echo "</div>";
     }
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:45,代码来源:search.php

示例2: descriptor

 function descriptor($id, $highlight = "", $view = "")
 {
     echo "<div id='export'>";
     $dataArray = thesaurus::get_descriptor($id);
     $linkArray = thesaurus::get_link($id, session::get(descriptor));
     $separator = FALSE;
     $isDescriptor = thesaurus::is_descriptor($id);
     //------------------------------------------------------------------------------
     // icons for actions
     echo "<p>";
     if ($view) {
         echo "<div id='box'>";
         echo "<table width='100%'><tr>";
         echo "<td>";
         echo form::link("opentree", "[+]", "index.php?action=showhyrarchy&amp;id={$id}", "opentree");
         // open hyrarchy tree
         echo " " . form::link("edit", "edit", "index.php?action=edit&amp;id={$id}", "edit");
         // link icons
         echo " " . form::link("link", "OB", "index.php?linkaction=link&amp;link={$id}&amp;id={$id}&amp;linktype=1", "newlink_1");
         echo " " . form::link("equiv", "BS", "index.php?linkaction=link&amp;link={$id}&amp;id={$id}&amp;linktype=2", "newlink_2");
         echo " " . form::link("assoc", "VB", "index.php?linkaction=link&amp;link={$id}&amp;id={$id}&amp;linktype=3", "newlink_3");
         echo " " . form::link("add", "add", "index.php?action=add&amp;parent={$id}", "add");
         echo "</td>";
         // print tree
         echo "<td>";
         echo " " . form::link("", "txt", "csv.php?id={$id}&amp;type=txt", "csv");
         echo "</td>";
         // print csv
         echo "<td>";
         echo " " . form::link("", "csv", "csv.php?id={$id}&amp;type=csv", "csv");
         echo "</td>";
         echo "<td align='right'>";
         // export Adlib
         echo "<td>";
         echo " " . form::link("", "adlib", "csv.php?id={$id}&amp;type=adlib", "adlib");
         echo "</td>";
         // set link
         $linkType = session::get(linktype);
         $linkIcon = array("", "dolink", "doequiv", "doassoc");
         if (session::get(link) != $id and session::get(link)) {
             echo "mit <b>'" . thesaurus::name(session::get(link)) . "'</b>' verknüpfen";
             echo " " . form::link($linkIcon[$linkType], $linkType, "index.php?linkaction=linkdo&amp;id={$id}", $linkIcon[$linkType]);
             echo " " . form::link("delete", "end", "index.php?linkaction=linkend", "end-linking");
         }
         echo "</td>";
         echo "</tr></table>";
         echo "</div>";
     }
     echo "</p>";
     //------------------------------------------------------------------------------
     // display name
     echo "<p>";
     echo "<span class='exporthead'><b>";
     $tempString = highlight($highlight, $dataArray[name], $isDescriptor);
     echo "<a href='index.php?action=show&amp;id={$id}'>";
     echo $tempString;
     // if javascript -> direkt edit
     if (session::get(JS)) {
     }
     echo grafik::disp("edit", "edit", 15);
     echo "</a>";
     echo "</b>";
     // display status of descriptor
     echo " <i>(" . thesaurus::get_status_name(thesaurus::get_status($id)) . ")</i>";
     // mark if kandidate
     if (!thesaurus::is_visible($id)) {
         echo "<br><span class='red'>versteckt</span>";
     }
     echo "</span>";
     // display type of descriptor
     echo "<br><i>" . thesaurus::get_name(thesaurus::get_thesaurus($id)) . "</i>";
     echo "</p>";
     //------------------------------------------------------------------------------
     // display comment
     echo "<p>";
     if ($dataArray[comment]) {
         echo "<tr><td></td>";
         echo "<td class='export'>";
         echo nl2br(highlight($highlight, $dataArray[comment]));
         echo "</td></tr>";
     }
     echo "</p>";
     //------------------------------------------------------------------------------
     // get link data for descriptor
     $parentArray = $linkArray[parent];
     $childArray = $linkArray[child];
     $assocArray = $linkArray[assoc];
     $equivArray = $linkArray[equiv];
     //------------------------------------------------------------------------------
     // list synonyms
     echo "<table>";
     if ($equivArray) {
         // sort for use and used for
         $x = $y = 0;
         foreach ($equivArray as $entry) {
             if ($entry > 0) {
                 $forArray[$x++] = $entry;
             } else {
                 $retArray[$x++] = abs($entry);
             }
//.........这里部分代码省略.........
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:101,代码来源:output.php

示例3: validate

 function validate($action = "")
 {
     // check entries with undefined links
     $sqlRef = database::query("SELECT * FROM parent");
     $tempString = "";
     // loop over all link entries
     while ($entry = mysql_fetch_array($sqlRef)) {
         if (!$action) {
             $parentName = thesaurus::get_name($entry[parent]);
             $childName = thesaurus::get_name($entry[child]);
             if (!thesaurus::get_descriptor($entry[parent]) and $entry[parent] != 0) {
                 $tempString .= "Oberbegriff {$entry['parent']} von <b>'{$childName}'</b> <i>({$entry['child']})</i> existiert nicht<br>";
             }
             if (!thesaurus::get_descriptor($entry[child])) {
                 $tempString .= "Unterbegriff {$entry['child']} von <b>'{$parentName}'</b> <i>({$entry['parent']})</i> existiert nicht<br>";
             }
         } else {
             if ((!thesaurus::get_descriptor($entry[parent]) or !thesaurus::get_descriptor($entry[child])) and $entry[parent] != 0) {
                 database::query("DELETE FROM parent WHERE ID={$entry['ID']}");
             }
         }
         // check crosslinks between thesauri
         if (thesaurus::get_thesaurus($entry[parent]) and thesaurus::get_thesaurus($entry[parent]) != thesaurus::get_thesaurus($entry[child])) {
             $crossString .= form::link("", $entry[parent], "index.php?action=show&amp;id={$entry['parent']}") . " <=> " . form::link("", $entry[child], "index.php?action=show&amp;id={$entry['child']}") . " link in different thesauri<br>";
         }
     }
     // display error messages
     if (right::link() and ($tempString or $crossString)) {
         echo "<div id='alert' class='red'>";
         if ($tempString) {
             echo "<b>OB / UB Fehler</b><br>{$tempString}<br>";
             echo "Datenbank bereinigen ";
             echo form::link("delete", "Datenbank bereinigen", "index.php?action=correct", "correct", "");
         }
         // display error message
         if ($crossString) {
             echo "<b>Crosslink Fehler</b><br>{$crossString}<br>";
             //        echo "Datenbank bereinigen ";
             //        echo form::link("delete","Datenbank bereinigen","index.php?action=correct","correct","");
         }
         echo "</div>";
     }
     // rewrite thesaurus links
     $sqlRef = database::query("SELECT * FROM entry");
     while ($entry = mysql_fetch_array($sqlRef)) {
         $tempArray = thesaurus::get_hyrarchy($entry[ID]);
         if (is_array($tempArray)) {
             $thesaurus = $tempArray[0];
         } else {
             $thesaurus = $tempArray;
         }
         database::query("UPDATE entry SET thesaurus='{$thesaurus}' WHERE ID='{$entry['ID']}'");
     }
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:54,代码来源:thesaurus.php

示例4: header

 function header()
 {
     echo "<b class='big'>";
     if (!thesaurus::is_thesaurus(session::get("link"))) {
         echo form::link("", "Hierarchie", "index.php?action=show&amp;id=0&amp;linkaction=linkdo");
     } else {
         echo "Hierarchie";
     }
     // title line
     echo "</b>";
     // insert thesaurus
     if (right::link()) {
         // new only if write permission
         echo form::link("add", "add", "index.php?action=add&amp;parent=0", "add-thesaurus");
     }
     // close complete tree
     action::closeall();
     // Show Link activity
     if ($linkID = session::get("link")) {
         echo "<br><i><span class='red'>";
         $linktype = thesaurus::get_type_short(session::get("linktype"));
         if (session::get('linkaction') == "change") {
             $linkArray = thesaurus::get_descriptor($linkID);
             $parentArray = thesaurus::get_descriptor(session::get("linkparent"));
             echo "<b>" . $linktype . " '" . $linkArray[name] . "'</b> von <b>'" . $parentArray[name] . "'</b> ändern";
         } else {
             $linkArray = thesaurus::get_descriptor($linkID);
             echo "Neuen <b>" . $linktype . "</b> f&uuml;r <b>'{$linkArray['name']}'</b> verlinken";
         }
         echo "</span><span class='normal'><br>Aktion beenden ";
         echo form::link("delete", "end", "index.php?linkaction=linkend", "end-linking");
         echo "</i>";
     }
     echo "<hr align='left' width='400px'>";
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:35,代码来源:hyrarchy.php

示例5: assoc_links

 function assoc_links($id)
 {
     $tempArray = thesaurus::get_assoc($id);
     echo "<form method='get' action='index.php' name='vb'>";
     echo "<fieldset>";
     echo "<legend>Verwandte Begriffe</legend>";
     $x = 0;
     $listArray = array();
     if ($tempArray) {
         foreach ($tempArray as $entry) {
             $listArray[$x++] = thesaurus::get_descriptor($entry);
         }
     }
     echo_selection($listArray, "id", "", 3, "assoc-field");
     // display action line
     action::display($id, 3);
     echo "</fieldset>";
     echo "</form>";
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:19,代码来源:form.php


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