Ejemplo n.º 1
0
function treePrint($tree, $pid = 0)
{
    if (empty($tree[$pid])) {
        return;
    }
    foreach ($tree[$pid] as $k => $treerow) {
        if ($treerow['id'] != $_GET['id']) {
            echo '<option ';
            if ($_GET['pid'] == $treerow['id']) {
                echo 'selected ';
            }
            echo 'value="' . $treerow['id'] . '">' . $treerow['title'] . '</option>';
        }
        if (isset($tree[$treerow['id']])) {
            treePrint($tree, $treerow['id']);
        }
    }
    echo '</ul>';
}
Ejemplo n.º 2
0
            function treePrint(MurmurTree $tree, $first = true)
            {
                $subs = $tree->getSubChannels();
                if ($first) {
                    echo '<div id="jq_editable_server_conf_defaultchannel_form">';
                    //TODO i18n
                    echo '<p>Select the channel unregistered and new users are to join when joining the server.</p>';
                }
                ?>
									<ul>
										<li class="form_clickable_submit jslink" id="channel_<?php 
                echo $tree->getRootChannel()->getId();
                ?>
"><?php 
                echo $tree->getRootChannel()->getName();
                ?>
</li>
										<?php 
                if (!empty($subs)) {
                    foreach ($subs as $subTree) {
                        treePrint($subTree, false);
                    }
                }
                ?>
									</ul>
								<?php 
                if ($first) {
                    echo '</div>';
                }
            }