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


PHP thesaurus::get_name方法代码示例

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


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

示例1: list_names

 function list_names($listArray, $highlight, $format = "")
 {
     $name = "";
     foreach ($listArray as $entry) {
         if (!($isDescriptor = thesaurus::is_descriptor($entry)) and $format) {
             $formString = "bright";
         } else {
             $formString = "";
         }
         $name .= "<a href='index.php?action=show&amp;id={$entry}'>";
         $name .= highlight($highlight, thesaurus::get_name($entry), $isDescriptor, $formString);
         $name .= "</a><br>";
     }
     echo substr($name, 0, strlen($name) - 4);
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:15,代码来源:output.php

示例2: list_id

function list_id($type, $idArray)
{
    $retXml = new simpleXmlElement("<{$type} />");
    if (is_array($idArray)) {
        foreach ($idArray as $entry) {
            if (is_numeric($entry)) {
                $xmlString = thesaurus::get_name($entry);
                extract_pattern($xmlString, "/\\(BS[: ](?<use>.*)\\)/");
            } else {
                $xmlString = $entry;
            }
            xml_insert($retXml, new simpleXmlElement("<{$type}>" . trim($xmlString) . "</{$type}>"));
        }
    }
    return $retXml;
}
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:16,代码来源:adlib.php

示例3: 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}&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'>";
                         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}&amp;action=add", "add");
                     // Delete Link
                     if ($cntChildren == 0) {
                         $javaText = "Wollen Sie " . $entry[name] . " wirklich l&ouml;schen? Es werden auch alle Links zu diesem Eintrag gelöscht";
                         $tempString .= form::link("delete", "x", "javascript:get_confirm(&#34;{$javaText}&#34;,&#34;index.php?action=deleteid&id={$id}&#34;);", "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}&amp;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);
             }
         }
     }
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:101,代码来源:hyrarchy.php

示例4:

}
?>
> Titelzeile
      <input type='checkbox' name='parseId' value='1' <?php 
if ($parseId) {
    echo "checked='checked'";
}
?>
> ID
      <input type='text' name='levelCnt' value='<?php 
echo $levelCnt;
?>
'> # of Levels</p>

<?php 
echo "<p>Import in Thesaurus <b>'" . thesaurus::get_name($id) . "'</b></p>";
?>
     
    </form>
  </div>
<?php 
//------------------------------------------------------------------------------
// display analysed data
echo "<div id='infobig'>";
import::analyse($destination, $id, $title, $root, $parseId, $action, $levelCnt);
echo "</div>";
?>

</body>
</html>
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:30,代码来源:import.php

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

示例6: descriptor

 function descriptor($id, $name, $error)
 {
     echo "<fieldset><legend>";
     //-----------------
     if (!thesaurus::is_descriptor($id)) {
         $checkString = "";
         echo "kein ";
     } else {
         $checkString = " checked";
     }
     echo "Begriff";
     if (!thesaurus::is_visible($id)) {
         echo " <span class='red'>(versteckt)</span>";
     }
     echo "</legend>";
     // descriptor value
     echo form::field("text", "name", $name, 30, "class='{$error}'", "", "", $help = "name-field");
     // display ID
     echo "<span class='small'>ID = {$id}</span>";
     // open tree
     echo form::link("opentree", "[+]", "index.php?action=showhyrarchy&amp;id={$id}", "opentree");
     // exit edit mode
     if (right::write()) {
         action::edit();
     }
     // delete entry
     if (thesaurus::child_num($id, 1) == 0) {
         $javaText = "Wollen Sie " . $name . " wirklich l&ouml;schen? Es werden auch alle Links zu diesem Eintrag gel&ouml;scht";
         echo form::link("delete", "x", "javascript:get_confirm(&#34;{$javaText}&#34;,&#34;index.php?action=deleteid&id={$id}&#34;);", "delete");
     }
     echo "<br>";
     // type of descriptor
     /*      $typeArray = thesaurus::get_type_list();
           $entryType = thesaurus::get_entrytype($id);
           $entryTypeName = thesaurus::get_entrytype_name($entryType);
     
           $javaText = "Wollen Sie wirklich allen Unterbegriffen von " . $name . " den Begriffstyp " . $entryTypeName . " zuweisen?";
           echo form::selector("entrytype",$typeArray,1,"",$entryType,"<span class='small'>Begriffstype</span><br>","","entrytype");
     
       // herite to all childs
           echo form::link("inheritance"," Begriffstyp vererben","javascript:get_confirm(&#34;$javaText&#34;,&#34;index.php?id=$id&amp;entrytype=$entryType&amp;action=inherit&#34;);","inheritance");
     */
     echo "<span class='normal'><i>" . thesaurus::get_name(thesaurus::get_thesaurus($id)) . "</i></span>";
     echo "<br>";
     // status of descriptor
     $statusArray = thesaurus::get_status_list();
     echo form::selector("status", $statusArray, 1, "", thesaurus::get_status($id), "<span class='small'>Status</span><br>", "", "statustype");
     echo "<br>";
     // descriptor is default value for ordered entries
     // default place for kandidates defined
     $orderDefault = system::getval("val_orderdefault");
     if ($orderDefault) {
         if (intval($orderDefault) == $id) {
             $checkedString = "checked='checked'";
         } else {
             $defaultString = "<br>(derzeit: <i>'";
             $defaultString .= "<a href='index.php?id={$orderDefault}&amp;action=show'>";
             $defaultString .= thesaurus::get_name($orderDefault);
             $defaultString .= "</a>";
             $defaultString .= "'</i>)";
         }
     } else {
         $defaultString = "<br>(Kein Ort für Kandidaten festgelegt)";
     }
     echo form::field("checkbox", "orderdefault", $id, "", $checkedString, "", "als Standard für Kandidaten festlegen {$defaultString}", "orderdefault");
     echo "</fieldset>";
 }
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:67,代码来源:form.php

示例7: analyse

    function analyse($path, $parent, $title, $root, $parseId, $action, $levelCnt)
    {
        //echoall($path);
        $importArray = import::fetch_file_to_array($path);
        $delimiter = ";";
        //    echoarray($importArray);
        ?>
<style>
  table {
    border:1px;
    padding:0px;
    margin:0px;
  }
  
  th {
    color:black;
    border-width:1px;
    font-size:10pt;
  }
  
  td {
    color:black;
    border-width:1px;
    font-size:10pt;
  }
</style>

<?php 
        if (is_array($importArray)) {
            echo "<h2>Analyse {$path}</h2>";
            //      $levelCnt = 7;
            $linePos = 0;
            echo "<table border='1' cellpadding='0' cellspacing='0'>";
            if ($parseId) {
                echo "<th>ID</th>";
            }
            for ($li = 0; $li < $levelCnt; $li++) {
                echo "<th>Level {$li}</th>";
            }
            echo "<th>Herkunft</th>";
            echo "<th>Bemerkung</th>";
            foreach ($importArray as $entry) {
                if ($linePos != 0 or !$title) {
                    $lineArray = explode($delimiter, $entry);
                    $colPos = 0;
                    if ($parseId) {
                        $entryid = $lineArray[0];
                    }
                    // loop for entries
                    if ($parseId) {
                        $start = 1;
                    } else {
                        $start = 0;
                    }
                    // filter id
                    for ($i = $start; $i < count($lineArray); $i++) {
                        $lineEntry = str_replace("\n", '', $lineArray[$i]);
                        $lineEntry = str_replace("\r", '', $lineEntry);
                        $source = $lineArray[$li + 1];
                        $comment = $lineArray[$li + 2];
                        if ($lineEntry) {
                            $parentArray[$colPos] = $lineEntry;
                            // utf8_encode($lineEntry);
                            // insert into database
                            if ($action == "insert") {
                                $parentName = $parentArray[$colPos - 1];
                                if (!$parentName) {
                                    $parentName = thesaurus::get_name($parent);
                                }
                                // no parent name -> use thesaurus
                                if ($root) {
                                    $source = $root;
                                }
                                $newId = import::insert($lineEntry, $parentName, "{$idName}={$entryid};Root={$source};Bemerkung={$comment}");
                            }
                            break;
                        }
                        $colPos++;
                    }
                    // remove unused array items
                    for ($i = $colPos + 1; $i < 7; $i++) {
                        $parentArray[$i] = "";
                    }
                    // display line
                    echo "<tr>";
                    if ($parseId) {
                        echo "<td>{$entryid}</td>";
                    } else {
                        echo "<td>&nbsp;</td>";
                    }
                    foreach ($parentArray as $entry) {
                        echo "<td>" . $entry . "</td>";
                    }
                    if ($source) {
                        echo "<td>{$source}</td>";
                    } else {
                        echo "<td>&nbsp;</td>";
                    }
                    if ($comment) {
                        echo "<td>{$comment}</td>";
//.........这里部分代码省略.........
开发者ID:nibble-arts,项目名称:openthesaurus,代码行数:101,代码来源:libimport.php


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