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


PHP display_tree函数代码示例

本文整理汇总了PHP中display_tree函数的典型用法代码示例。如果您正苦于以下问题:PHP display_tree函数的具体用法?PHP display_tree怎么用?PHP display_tree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: display_tree

function display_tree($tree, $acl, $curr_id = 0)
{
    foreach ($tree as $node) {
        if ($curr_id == $node['id']) {
            echo '<li class="active"><strong>';
        } else {
            echo '<li>';
        }
        echo '<i class="fa-li fa fa-user"></i>';
        if ($acl->is_allowed('acl/role/edit')) {
            echo '<a href="' . site_url('acl/role/edit/' . $node['id']) . '" class="users">';
            echo '<span>' . $node['name'] . '</span>';
            echo '</a>';
        } else {
            echo '<span>' . $node['name'] . '</span>';
        }
        if (isset($node['children'])) {
            echo '<ul class="fa-ul">';
            display_tree($node['children'], $acl);
            echo '</ul>';
        }
        if ($curr_id == $node['id']) {
            echo '</strong>';
        }
        echo '</li>';
    }
}
开发者ID:ardissoebrata,项目名称:ci-beam,代码行数:27,代码来源:role-tree.php

示例2: display_tree

 function display_tree($tree, $curr_id = 0, $acl)
 {
     foreach ($tree as $node) {
         echo '<li>';
         if (isset($node['children'])) {
             echo '<span class="toggle"></span>';
         }
         $class = $node['type'];
         if ($node['id'] == $curr_id) {
             $class .= ' current';
         }
         if ($acl->is_allowed('acl/resource/edit')) {
             echo '<a href="' . site_url('acl/resource/edit') . '/' . $node['id'] . '?redirect=' . urlencode(site_url('acl/resource')) . '" class="' . $class . '">';
             echo '<span>' . $node['name'] . '</span>';
             echo '</a>';
         } else {
             echo '<span>' . $node['name'] . '</span>';
         }
         if (isset($node['children'])) {
             echo '<ul>';
             display_tree($node['children'], $curr_id, $acl);
             echo '</ul>';
         }
         echo '</li>';
     }
 }
开发者ID:ariborneo,项目名称:koperasi,代码行数:26,代码来源:resource-edit.php

示例3: display_tree

function display_tree($nodes, $indent = 0)
{
    if ($indent >= 20) {
        return;
    }
    // Stop at 20 sub levels
    foreach ($nodes as $node) {
        print str_repeat('&nbsp;', $indent * 4);
        print $node['name'];
        print '<br/>';
        if (isset($node['children'])) {
            display_tree($node['children'], $indent + 1);
        }
    }
}
开发者ID:AlvaCorp,项目名称:simpleac,代码行数:15,代码来源:tree_demo.php

示例4: display_tree

function display_tree($children, $parent_id)
{
    $root = NULL;
    foreach ($children as $child) {
        $no_nest = isset($child['nested']) && $child['nested'] == 0 ? "no-nest" : false;
        $root = $child['id'] == 1 ? "ignore" : false;
        $folder = isset($child['children']) && $child['type'] != "blog" ? "ofolder" : "folder";
        $delete = anchor('admin/content/delete/' . $parent_id . '/' . $child['id'], '&nbsp;', 'class="delete"');
        echo "<li class=\"{$root} {$no_nest}\" id=\"" . $child['id'] . "\">\n";
        echo "<div class=\"item\">" . $delete . "<img src='" . base_url() . "css/images/img-page-" . $folder . ".png' class='folder' />" . anchor('admin/content/edit/' . $child['type'] . '/' . $child['parent_id'] . '/' . $child['id'], $child['title']) . "</div>";
        if (isset($child['children']) && $child['type'] != "blog") {
            echo "<ul class=\"pagetree\">\n";
            display_tree($child['children']);
            echo "</ul>\n";
        }
        echo "\t</li>\n";
    }
}
开发者ID:acutedeveloper,项目名称:openreach-forsite-ci,代码行数:18,代码来源:newsletters-content.php

示例5: display_tree

function display_tree($tree, $acl, $curr_id = 0)
{
    foreach ($tree as $node) {
        if ($curr_id == $node['id']) {
            echo '<li class="active"><strong>';
        } else {
            echo '<li>';
        }
        $class = 'fa ';
        switch ($node['type']) {
            case 'module':
                $class .= 'fa-folder-open-o ';
                break;
            case 'controller':
                $class .= 'fa-file-text-o';
                break;
            case 'action':
                $class .= 'fa-gear';
                break;
            default:
                $class .= 'fa-question';
                break;
        }
        echo '<i class="fa-li ' . $class . '"></i>';
        if ($acl->is_allowed('acl/resource/edit')) {
            echo '<a href="' . site_url('acl/resource/edit/' . $node['id']) . '">';
            echo $node['name'];
            echo '</a>';
        } else {
            echo $node['name'];
        }
        if (isset($node['children'])) {
            echo '<ul class="fa-ul">';
            display_tree($node['children'], $acl, $curr_id);
            echo '</ul>';
        }
        if ($curr_id == $node['id']) {
            echo '</strong>';
        }
        echo '</li>';
    }
}
开发者ID:ardissoebrata,项目名称:ci-beam,代码行数:42,代码来源:resource-tree.php

示例6: display_tree

 function display_tree($tree, $acl)
 {
     foreach ($tree as $node) {
         echo '<li>';
         if (isset($node['children'])) {
             echo '<span class="toggle"></span>';
         }
         if ($acl->is_allowed('acl/rule/edit')) {
             echo '<a href="' . site_url('acl/rule/edit') . '/' . $node['id'] . '?redirect=' . urlencode(current_url_params()) . '" class="users">';
             echo '<span>' . $node['name'] . '</span>';
             echo '</a>';
         } else {
             echo '<span>' . $node['name'] . '</span>';
         }
         if (isset($node['children'])) {
             echo '<ul>';
             display_tree($node['children'], $acl);
             echo '</ul>';
         }
         echo '</li>';
     }
 }
开发者ID:NaszvadiG,项目名称:ci-beam,代码行数:22,代码来源:rule-edit.php

示例7: mysql_connect

                <style type="text/css">
                <!--
                .style1 {
                        font-size: 18px;
                        font-weight: bold;
                }
                -->
                </style>

</head>
<body>
ENDHTML;
echo $html;
$dbh = mysql_connect($host_name, $db_username, $db_password) or die('I cannot connect to the database because: ' . mysql_error());
mysql_select_db($db_name);
display_tree(0);
function display_tree($root)
{
    // retrieve the left and right value of the $root node
    $result = mysql_query('SELECT lft, rgt FROM ModifiedPreorderTreeTraversalCategories ' . 'WHERE CategoryID=' . $root . ';');
    $row = mysql_fetch_array($result);
    // start with an empty $right stack
    $right = array();
    // now, retrieve all descendants of the $root node
    $result = mysql_query('SELECT CategoryID, CategoryName, lft, rgt FROM ModifiedPreorderTreeTraversalCategories ' . 'WHERE lft BETWEEN ' . $row['lft'] . ' AND ' . $row['rgt'] . ' ORDER BY lft ASC;');
    // display each row
    while ($row = mysql_fetch_array($result)) {
        // only check stack if there is one
        if (count($right) > 0) {
            // check if we should remove a node from the stack
            while ($right[count($right) - 1] < $row['rgt']) {
开发者ID:jassenm,项目名称:mongotickets_php,代码行数:31,代码来源:display_category_tree.php

示例8: session_start

session_start();
// check if we have created our session variable
if (!isset($HTTP_SESSION_VARS['expanded'])) {
    $HTTP_SESSION_VARS['expanded'] = array();
}
// check if an expand button was pressed
// expand might equal 'all' or a postid or not be set
if (isset($HTTP_GET_VARS['expand'])) {
    if ($HTTP_GET_VARS['expand'] == 'all') {
        expand_all($HTTP_SESSION_VARS['expanded']);
    } else {
        $HTTP_SESSION_VARS['expanded'][$HTTP_GET_VARS['expand']] = true;
    }
}
// check if a collapse button was pressed
// collapse might equal all or a postid or not be set
if (isset($HTTP_GET_VARS['collapse'])) {
    if ($HTTP_GET_VARS['collapse'] == 'all') {
        $HTTP_SESSION_VARS['expanded'] = array();
    } else {
        unset($HTTP_SESSION_VARS['expanded'][$HTTP_GET_VARS['collapse']]);
    }
}
do_html_header('Discussion Posts');
display_index_toolbar();
// display the tree view of conversations
display_tree($HTTP_SESSION_VARS['expanded']);
do_html_footer();
?>
 
开发者ID:andersonbporto,项目名称:programacao_internet_2015_1,代码行数:29,代码来源:index.php

示例9: display_the_tree

function display_the_tree()
{
    display_tree(0, table_categories);
}
开发者ID:holsinger,项目名称:openfloor,代码行数:4,代码来源:dbtree.php

示例10: session_start

session_start();
// check if we have created our session variable
if (!isset($_SESSION['expanded'])) {
    $_SESSION['expanded'] = array();
}
// check if an expand button was pressed
// expand might equal 'all' or a postid or not be set
if (isset($_GET['expand'])) {
    if ($_GET['expand'] == 'all') {
        expand_all($_SESSION['expanded']);
    } else {
        $_SESSION['expanded'][$_GET['expand']] = true;
    }
}
// check if a collapse button was pressed
// collapse might equal all or a postid or not be set
if (isset($_GET['collapse'])) {
    if ($_GET['collapse'] == 'all') {
        $_SESSION['expanded'] = array();
    } else {
        unset($_SESSION['expanded'][$_GET['collapse']]);
    }
}
do_html_header('Discussion Posts');
display_index_toolbar();
// display the tree view of conversations
display_tree($_SESSION['expanded']);
do_html_footer();
?>
 
开发者ID:kmfb21,项目名称:A290CGI-PHP,代码行数:29,代码来源:index.php

示例11: expand_all

    if ($_GET['expand'] == 'all') {
        expand_all($_SESSION['expanded']);
    } else {
        $_SESSION['expanded'][$_GET['expand']] = true;
    }
}
// check if a collapse button was pressed
// collapse might equal all or a postid or not be set
if (isset($_GET['collapse'])) {
    if ($_GET['collapse'] == 'all') {
        $_SESSION['expanded'] = array();
    } else {
        unset($_SESSION['expanded'][$_GET['collapse']]);
    }
}
//  global  $CHAPTERID;
//  echo $CHAPTERID;
display_index_toolbar();
//  echo $USER;
// echo $CHAPTERID;
// display the tree view of conversations
display_tree($COURSEID, $_SESSION['expanded'], $USER);
display_new_post_form($COURSEID, $USER);
//}
?>
<table  width="100%">
<tr>
  <td height="80" style="text-align:center;font-family:微软雅黑;font-size:20px;">&#169; 版权所有 | 设计者 &nbsp;烫烫烫烫的130</td>
</tr>
</table>
开发者ID:piriterchen,项目名称:online_learning,代码行数:30,代码来源:forum.php

示例12: display_tree

?>
">&raquo;</a></li>
      </ul>
    </div>
  <!-- end:pagination -->
  
      <!-- begin:comment -->
      <div class="row">
        <div class="col-md-12">
          <?php 
echo $not_found_comment;
?>
          <div class="comment">

            <?php 
display_tree($comm);
?>
     

          </div>
        </div>
      </div>
      <!-- end:comment -->

        <!-- begin:comment-form -->
        <div id="commentForm" class="row">
          <div class="col-md-12">
            <h3 class="blog-single-title">Задать вопрос</h3>

            <p id="comment-answer-name"></p>
开发者ID:stat92,项目名称:Gipnoz,代码行数:30,代码来源:q_a_view.php

示例13: quotes

<?php

$table = $cpos["table"];
$id = quotes($_GET["id"]);
//-本資料
$mode = quotes($_GET["mode"]);
//-母樹
$max = 0;
//明細
if ($id != "") {
    //--母類資料
    $main_data = $conn->GetRow("select * from " . $table . " where id='" . $mode . "'");
    $max = $main_data["max_count"];
    //--分類樹資料
    $tree_data_type = display_tree($mode, $conn, $table, 0, 0, " and lang='" . LANG . "'");
    //-分類資料
    if ($tree_data_type) {
        foreach ($tree_data_type as $k => $v) {
            if ($id != $v["id"] && $v["depth"] * 1 < $max) {
                $spce = '';
                for ($i = 0; $i <= $v["depth"]; $i++) {
                    $spce .= '&nbsp;&nbsp;&nbsp;';
                }
                $tree_array[$v['id']] = $spce . $v['name'];
            }
        }
    }
    //-資料送出處理
    if ($_POST) {
        //--更動資料時依照排序寫入
        $cpos["listorderby"] = "sort";
开发者ID:Jonesyei,项目名称:modelphp,代码行数:31,代码来源:category_class.php

示例14: display_tree

function display_tree($nodes, $indent = 0)
{
    if ($indent >= 10) {
        return;
    }
    ?>
  

  <ul   <?php 
    if ($indent != 0) {
        ?>
class="comment-reply"<?php 
    }
    ?>
   >

  <?php 
    foreach ($nodes as $node) {
        ?>
         
    
    <li>
      <div class="comment-container <?php 
        if ($node['unread'] == 0) {
            echo 'unread';
        }
        ?>
">
        <div class="comment-text">
          <span class="comment-reply-link"><a href="/admin/delComment/<?php 
        echo $node['id'];
        ?>
/"> Удалить</a></span>
          <span data-id="<?php 
        echo $node['id'];
        ?>
" class="comment-reply-link"><a href="#commentForm"><i class="fa fa-sign-in"></i> Ответить </a>___</span>       
          <h4><?php 
        echo $node['name'];
        ?>
</h4>
          <span class="comment-meta"><?php 
        echo $node['date'];
        ?>
</span>
          <p>
          <?php 
        if ($node['deleted'] == 0) {
            echo $node['text'];
        } else {
            echo "Комментарий был удален";
        }
        ?>
          </p>
        </div>
      </div>
      <!-- break -->

    <?php 
        if (isset($node['childs'])) {
            display_tree($node['childs'], $indent + 1);
        }
        ?>
    
    </li>
  <?php 
    }
    ?>

  </ul>

<?php 
}
开发者ID:stat92,项目名称:Gipnoz,代码行数:73,代码来源:comment_view.php

示例15: expand_all

    if ($_GET['expand'] == 'all') {
        expand_all($_SESSION['expanded']);
    } else {
        $_SESSION['expanded'][$_GET['expand']] = true;
    }
}
// check if a collapse button was pressed
// collapse might equal all or a postid or not be set
if (isset($_GET['collapse'])) {
    if ($_GET['collapse'] == 'all') {
        $_SESSION['expanded'] = array();
    } else {
        unset($_SESSION['expanded'][$_GET['collapse']]);
    }
}
//  global  $CHAPTERID;
//  echo $CHAPTERID;
display_index_toolbar();
//  echo $USER;
// echo $CHAPTERID;
// display the tree view of conversations
display_tree($CHAPTERID, $_SESSION['expanded'], $USER);
display_new_post_form($CHAPTERID, $USER);
//}
?>
<table width="100%">
<tr>
  <td height="80" style="text-align:center;font-family:微软雅黑;font-size:20px;">&#169; 版权所有 | 设计者 &nbsp;烫烫烫烫的130</td>
</tr>
</table>
开发者ID:piriterchen,项目名称:online_learning,代码行数:30,代码来源:forum.php


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