當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TikiLib::get_preference方法代碼示例

本文整理匯總了PHP中TikiLib::get_preference方法的典型用法代碼示例。如果您正苦於以下問題:PHP TikiLib::get_preference方法的具體用法?PHP TikiLib::get_preference怎麽用?PHP TikiLib::get_preference使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TikiLib的用法示例。


在下文中一共展示了TikiLib::get_preference方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getSubGraph

function getSubGraph($params)
{
    global $wikilib, $dbTiki;
    $nodeName = $params->getParam(0);
    $nodeName = $nodeName->scalarVal();
    $depth = $params->getParam(1);
    $depth = $depth->scalarVal();
    $nodes = array();
    $passed = array($nodeName => true);
    $queue = array($nodeName);
    $i = 0;
    $tikilib = new TikiLib($dbTiki);
    $existing_color = $tikilib->get_preference("wiki_3d_existing_page_color", '#00BB88');
    $missing_color = $tikilib->get_preference("wiki_3d_missing_page_color", '#FF6666');
    while ($i <= $depth && sizeof($queue) > 0) {
        $nextQueue = array();
        foreach ($queue as $nodeName) {
            $neighbours = $wikilib->wiki_get_neighbours($nodeName);
            $temp_max = sizeof($neighbours);
            for ($j = 0; $j < $temp_max; $j++) {
                if (!isset($passed[$neighbours[$j]])) {
                    $nextQueue[] = $neighbours[$j];
                    $passed[$neighbours[$j]] = true;
                }
                $neighbours[$j] = new XML_RPC_Value($neighbours[$j]);
            }
            $node = array();
            $base_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $base_url = preg_replace('/\\/tiki-wiki3d_xmlrpc.php.*$/', '', $base_url);
            if ($wikilib->page_exists($nodeName)) {
                $color = $existing_color;
                $actionUrl = "{$base_url}/tiki-index.php?page={$nodeName}";
            } else {
                $color = $missing_color;
                $actionUrl = "{$base_url}/tiki-editpage.php?page={$nodeName}";
            }
            $node['neighbours'] = new XML_RPC_Value($neighbours, "array");
            if (!empty($color)) {
                $node['color'] = new XML_RPC_Value($color, "string");
            }
            $node['actionUrl'] = new XML_RPC_Value($actionUrl, "string");
            $nodes[$nodeName] = new XML_RPC_Value($node, "struct");
        }
        $i++;
        $queue = $nextQueue;
    }
    $response = array("graph" => new XML_RPC_Value($nodes, "struct"));
    return new XML_RPC_Response(new XML_RPC_Value($response, "struct"));
}
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:49,代碼來源:tiki-wiki3d_xmlrpc.php


注:本文中的TikiLib::get_preference方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。