本文整理汇总了PHP中doTree函数的典型用法代码示例。如果您正苦于以下问题:PHP doTree函数的具体用法?PHP doTree怎么用?PHP doTree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doTree函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doTree
$misc->setFocus('forms[0].query');
}
function doTree()
{
global $misc, $data, $lang, $slony;
$reqvars = $misc->getRequestVars('database');
$tabs = $misc->getNavTabs('database');
$items = $misc->adjustTabsForTree($tabs);
$attrs = array('text' => noEscape(field('title')), 'icon' => field('icon'), 'action' => url(field('url'), $reqvars, field('urlvars', array())), 'branch' => url(field('url'), $reqvars, field('urlvars'), array('action' => 'tree')));
$misc->printTreeXML($items, $attrs);
exit;
}
require './admin.php';
/* shortcuts: these functions exit the script */
if ($action == 'tree') {
doTree();
}
if ($action == 'refresh_locks') {
currentLocks(true);
}
if ($action == 'refresh_processes') {
currentProcesses(true);
}
/* normal flow */
if ($action == 'locks' or $action == 'processes') {
$scripts = "<script src=\"libraries/js/jquery.js\" type=\"text/javascript\"></script>\n";
$scripts .= "<script src=\"js/database.js\" type=\"text/javascript\"></script>";
$refreshTime = $conf['ajax_refresh'] * 1000;
$scripts .= "<script type=\"text/javascript\">\n";
$scripts .= "var Database = {\n";
$scripts .= "ajax_time_refresh: {$refreshTime},\n";
示例2: array_merge
$nodes = array_merge($nodes, $misc->getServers(false, $group_id));
include_once './classes/ArrayRecordSet.php';
$nodes = new ArrayRecordSet($nodes);
} else {
$nodes = $misc->getServers(true, false);
}
}
$reqvars = $misc->getRequestVars('server');
$attrs = array('text' => field('desc'), 'icon' => field('icon'), 'toolTip' => field('id'), 'action' => field('action'), 'branch' => field('branch'));
$misc->printTree($nodes, $attrs, 'servers');
exit;
}
if ($action == 'tree') {
if (isset($_GET['group'])) {
doTree($_GET['group']);
} else {
doTree(false);
}
}
$misc->printHeader($lang['strservers']);
$misc->printBody();
$misc->printTrail('root');
switch ($action) {
case 'logout':
doLogout();
break;
default:
doDefault($msg);
break;
}
$misc->printFooter();
示例3: doTree
private function doTree($roots, $i, $lvl)
{
$arr = array();
while (count($roots) > $i) {
$rec = array('text' => $roots[$i]['tnam'], 'hasChildren' => false);
if (count($roots) > $i + 1) {
if ($roots[$i + 1]['level'] > $lvl) {
$rec['hasChildren'] = true;
$rec['children'] = doTree($roots, $i + 1, $lvl + 1);
} elseif ($roots[$i + 1]['level'] < $lvl) {
}
} else {
$arr[] = $rec;
}
}
return $arr;
}
示例4: elseif
} elseif ($action == 'nodes_top') {
doTree('nodes_top');
} elseif ($action == 'paths') {
doTree('paths');
} elseif ($action == 'listens') {
doTree('listens');
} elseif ($action == 'sets') {
doTree('sets');
} elseif ($action == 'sets_top') {
doTree('sets_top');
} elseif ($action == 'subscriptions') {
doTree('subscriptions');
} elseif ($action == 'sequences') {
doTree('sequences');
} elseif ($action == 'tables') {
doTree('tables');
}
$misc->printHeader('Slony');
$misc->printBody();
switch ($action) {
case 'save_create_cluster':
if (isset($_POST['cancel'])) {
doClusters();
} else {
doCreateCluster(false);
}
break;
case 'create_cluster':
doCreateCluster(true);
break;
case 'drop_cluster':