コード例 #1
0
ファイル: role-tree.php プロジェクト: ardissoebrata/ci-beam
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>';
    }
}
コード例 #2
0
ファイル: resource-edit.php プロジェクト: ariborneo/koperasi
 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>';
     }
 }
コード例 #3
0
ファイル: tree_demo.php プロジェクト: AlvaCorp/simpleac
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);
        }
    }
}
コード例 #4
0
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";
    }
}
コード例 #5
0
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>';
    }
}
コード例 #6
0
ファイル: rule-edit.php プロジェクト: NaszvadiG/ci-beam
 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>';
     }
 }
コード例 #7
0
                <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']) {
コード例 #8
0
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();
?>
 
コード例 #9
0
ファイル: dbtree.php プロジェクト: holsinger/openfloor
function display_the_tree()
{
    display_tree(0, table_categories);
}
コード例 #10
0
ファイル: index.php プロジェクト: kmfb21/A290CGI-PHP
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();
?>
 
コード例 #11
0
ファイル: forum.php プロジェクト: piriterchen/online_learning
    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>
コード例 #12
0
ファイル: q_a_view.php プロジェクト: stat92/Gipnoz
?>
">&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>
コード例 #13
0
ファイル: category_class.php プロジェクト: Jonesyei/modelphp
<?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";
コード例 #14
0
ファイル: comment_view.php プロジェクト: stat92/Gipnoz
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 
}
コード例 #15
0
ファイル: forum.php プロジェクト: piriterchen/online_learning
    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>
コード例 #16
0
ファイル: view_post.php プロジェクト: kmfb21/A290CGI-PHP
<?php

// include function libraries
include 'include_fns.php';
$postid = $_GET['postid'];
// get post details
$post = get_post($postid);
do_html_header($post['title']);
// display post
display_post($post);
// if post has any replies, show the tree view of them
if ($post['children']) {
    echo '<br /><br />';
    display_replies_line();
    display_tree($_SESSION['expanded'], 0, $postid);
}
do_html_footer();
?>
 
コード例 #17
0
<?php

// include function libraries
include 'include_fns.php';
$postid = $HTTP_GET_VARS['postid'];
// get post details
$post = get_post($postid);
do_html_header($post['title']);
// display post
display_post($post);
// if post has any replies, show the tree view of them
if ($post['children']) {
    echo '<br /><br />';
    display_replies_line();
    display_tree($HTTP_SESSION_VARS['expanded'], 0, $postid);
}
do_html_footer();
?>
 
コード例 #18
0
ファイル: directoryhowto5.php プロジェクト: pabalexa/handyq03
					alfabéticamente.<br />
				</span> <input type='submit' value='Reorganizar árbol.'>
			</form>

			<!-- Formulario para elimiinar un nodo de seccion -->

			<form action="directoryhowto6.php?accion=delete" method="POST"
				style="background-color: rgba(6, 109, 5, 0.5); width: 300px; padding: 5px;">
				<span class='white'>El proceso elimina un nodo, a excepcion
					de la Raiz.<br /> Si el nodo tiene hijos, estos pasan a apuntar
					al padre del nodo eliminado.<br />
				</span> 
				<span class='white'>Secciones actuales.<br /></span>
				<?php 
get_select_tree(0, "tseccion");
?>
				<input type='submit' value='Eliminar seccion'>
			</form>
			<br /><br /><br /><br />
		</div>
		<div id='rightChildLayer'>
			Arbol actual de secciones.
			<?php 
echo "<p>\n";
display_tree(1, "linkStyle");
echo "</p>\n";
?>
		</div>
	</div>
</body>
</html>
コード例 #19
0
ファイル: products2.php プロジェクト: Jonesyei/modelphp
        alert('必須輸入尺寸貨號!!', -1);
    }
}
$act = @$_POST["act"];
$del_id = quotes(@$_GET["del_id"]);
include_once "centerpoes.php";
//--匯出/入資料
$data["output_title"] = array('編號', '商品別名', '商品分類', '商品名稱', '商品售價', '商品特價', '可獲得紅利', '可折抵購物金', '規格', '顏色', '尺寸圖片', '現貨', '貨號', '尺寸是否顯示狀態', '尺寸金額', '商品內容');
$data["output_row"] = array('id', 'alies', 'class', 'name', 'price1', 'price2', 'point', 'depoint', 'size', 'color', 'stock_pic', 'stock', 'stock_no', 'stock_status', 'stock_price', 'detail');
$data["input_title"] = array('編號', '商品別名', '商品分類', '商品名稱', '商品售價', '商品特價', '可獲得紅利', '可折抵購物金', '規格', '顏色', '尺寸圖片', '現貨', '貨號', '尺寸是否顯示狀態', '尺寸金額', '商品內容');
$data["input_row"] = array('id', 'alies', 'class', 'name', 'price1', 'price2', 'point', 'depoint', 'size', 'color', 'stock_pic', 'stock', 'stock_no', 'stock_status', 'stock_price', 'detail');
$data["cpos"] = $cpos;
//---------
//display_tree($root,$db,$table,$start=0,$count=0,$where_sql="",$total_data="")
//$tree_data_pro=display_tree('1',$conn,PREFIX.'category');	//-品牌資料
$tree_data_type = display_tree($cpos["cate_root"], $conn, PREFIX . 'category');
//-分類資料
//-圖片上傳最大數
$data["uploadfilemax"] = 20;
if ($_GET["id"] || $_GET["id"] == '0') {
    $_SESSION["admin_info"]["view"] = "detail";
    $data["one"]["class_html"] = Make_List($_SETUP["pro_class"], $data["one"]["class"]);
    //----商品資訊單筆
    //$data["one"]["detail_fck"] = Fck("detail",'90%','450','../fckeditor/',deQuotes(@$data["one"]["detail"],-1));
    $data["one"]["pic"] = is_array($data["one"]["pic"]) ? $data["one"]["pic"] : explode('|__|', $data["one"]["pic"]);
    $data["one"]["small_pic"] = explode('|__|', $data["one"]["small_pic"]);
    //----加價購
    if ($data["one"]["add_pic"] != NULL && $data["one"]["add_pic"] != '') {
        $add_pic = explode('|__|', $data["one"]["add_pic"]);
    }
    if ($data["one"]["add_pro"] != NULL && $data["one"]["add_pro"] != '') {
コード例 #20
0
ファイル: about.php プロジェクト: Jonesyei/modelphp
            $data["order_html"] .= '<tr><td align="right">活動描述:</td><td>' . Fck("memo_2", '90%', '450', '../fckeditor/', $data["one"]["memo_2"]) . '</td></tr>';
            break;
            /*現金折抵*/
        /*現金折抵*/
        case "active_desh":
            $data["one"]["detail"] = explode('|__|', $data["one"]["detail"]);
            $data["order_html"] .= '<tr><td align="right">活動時間:</td><td>
							<input type="text" name="active_on_date" value="' . $data["one"]["active_on_date"] . '"> - <input type="text" name="active_off_date" value="' . $data["one"]["active_off_date"] . '">
							</td></tr><script>' . "Datepick('[name=\"active_on_date\"]',\"\",\"yyyy-mm-dd\");Datepick('[name=\"active_off_date\"]',\"\",\"yyyy-mm-dd\");</script>";
            $data["order_html"] .= '<tr><td align="right">現折:</td><td>
							滿<input type="text" name="detail[]" value="' . $data["one"]["detail"][0] . '">元<br>
							折抵<input type="text" name="detail[]" value="' . $data["one"]["detail"][1] . '">元
							</td></tr>';
            $data["close"]["pic"] = '1';
            $data["button"]["pick_product"] = '1';
            $tree_data_type = display_tree('1', $conn, PREFIX . 'category');
            //-分類資料
            //---取出分類資料----
            if ($tree_data_type) {
                foreach ($tree_data_type as $item) {
                    $aa[$item['id']] = $item['show_text'];
                }
            }
            $data["one"]["prolist"] = create_select("prolist", $aa, NULL, '1', "根目錄");
            //--加價購選單
            //----商品資料
            if ($data["one"]["add_pic"] != NULL && $data["one"]["add_pic"] != '') {
                $add_pic = explode('|__|', $data["one"]["add_pic"]);
            }
            if ($data["one"]["add_pro"] != NULL && $data["one"]["add_pro"] != '') {
                $add_pro = explode('|__|', $data["one"]["add_pro"]);
コード例 #21
0
<?php

$this->load->view('admin/header');
?>

<?php 
$this->load->view('admin/side-menu');
?>

<div class="span-17 last">

<h1>Test Page</h1>
	
<ul id="pagetree">
<?php 
display_tree($children);
?>
</ul>
<style>
	.ui-state-highlight { height: 30px; border: 1px solid #999999; background-color: #EEEEEE; margin: 0px 0px 1px 0px; }
	</style>
	
<?php 
function display_tree($array)
{
    $root = NULL;
    foreach ($array as $child) {
        if ($child['lft'] == '1') {
            $root = 'class="ignore"';
        }
        echo "<li {$root} id=\"" . $child['lft'] . "\">\n";
コード例 #22
0
ファイル: move.php プロジェクト: genaromendezl/ATutor
    ?>
</p>
	</div>
	
	<div class="row">
		<ul>
			<li class="folders"><label><input type="radio" name="dir_name" value="<?php 
    echo _AT('home');
    ?>
"<?php 
    if ($pathext == '') {
        echo ' checked="checked"';
        $here = ' ' . _AT('current_location');
    }
    echo '/>' . _AT('home') . ' ' . $here . '</label>';
    echo display_tree($current_path, '', $pathext);
    ?>
</li>
		</ul>
	</div>

	<div class="row buttons">
		<input type="submit" name="dir_chosen" value="<?php 
    echo _AT('move');
    ?>
" accesskey="s" /> 
		<input type="submit" name="cancel" value="<?php 
    echo _AT('cancel');
    ?>
" />
	</div>
コード例 #23
0
function display_tree($current_path, $cur_dir, $pathext, $ignore_children = false)
{
    // open the cur_dir
    static $list_array;
    if (!isset($list_array)) {
        $list_array = explode(',', $_GET['list']);
    }
    if ($dir = opendir($current_path . $cur_dir)) {
        // recursively call output_dirs() for all directories in this directory
        while (false !== ($file = readdir($dir))) {
            //if the name is not a directory
            if ($file == '.' || $file == '..') {
                continue;
            }
            // if it is a directory call function
            if (is_dir($current_path . $cur_dir . $file)) {
                //$ldir = explode('/',$cur_dir.$file);
                //$count = count($ldir);
                //$label = $ldir[$count-1];
                $check = '';
                $here = '';
                if ($cur_dir . $file == substr($pathext, 0, -1)) {
                    $check = 'checked="checked"';
                    $here = ' ' . _AT('current_location');
                } else {
                    if ($cur_dir == $pathext && in_array($file, $list_array)) {
                        $ignore_children = true;
                    }
                }
                if ($ignore_children) {
                    $check = 'disabled="disabled"';
                    $class = ' disabled';
                }
                $dir_option .= '<ul><li class="folders' . $class . '">';
                $dir_option .= '<label><input type="radio" name="dir_name" value="' . $cur_dir . $file . '" ' . $check . '/>' . $file . $here . '</label>';
                $dir_option .= '' . display_tree($current_path, $cur_dir . $file . '/', $pathext, $ignore_children) . '';
                $dir_option .= '</li></ul>';
                if ($cur_dir == $pathext && in_array($file, $list_array)) {
                    $ignore_children = false;
                    $class = '';
                }
            }
        }
        // end while
        closedir($dir);
    }
    return $dir_option;
}