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


PHP thesaurus::get_hyrarchy方法代码示例

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


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

示例1: action


//.........这里部分代码省略.........
                break;
            }
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case swap:
            if ($_arg[id]) {
                thesaurus::swap_link($_arg[id], $_arg[_ID]);
            }
            break;
        case change:
            if ($_arg[id]) {
                //        thesaurus::change_link($_arg);
            }
            break;
        case add:
            // add new descriptor
            session::destroy("show");
            session::destroy("searchshow");
            //      session::set("",1);
            break;
            // clean database
        // clean database
        case correct:
            thesaurus::validate(true);
            echoalert("Datenbank bereinigt");
            break;
            //------------------------------------------------------------------------------
            // open hyrarchy down to selected entry
        //------------------------------------------------------------------------------
        // open hyrarchy down to selected entry
        case showhyrarchy:
            if ($_arg[id]) {
                $hyrarchyArray = thesaurus::get_hyrarchy($_arg[id]);
                // don't open selected entry
                //        array_pop($hyrarchyArray);
                foreach ($hyrarchyArray as $entry) {
                    //        echo $entry . " ";
                    echo session::open($entry);
                }
                session::set("hyrarchy", TRUE);
                // hide search window
                session::destroy("searchshow");
                // if nothing selected for display, show ID
                if (!session::get(show)) {
                    session::set("show", $_arg[id]);
                }
                break;
            }
            //------------------------------------------------------------------------------
            // debug on/off
        //------------------------------------------------------------------------------
        // debug on/off
        case debugon:
            system::setval(debug, TRUE);
            break;
        case debugoff:
            system::setval(debug, FALSE);
            // legend on/off
        // legend on/off
        case legendon:
            session::set("legend", TRUE);
            break;
        case legendoff:
            session::destroy("legend");
            break;
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:67,代码来源:action.php

示例2: 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


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