本文整理汇总了PHP中tree::mk方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::mk方法的具体用法?PHP tree::mk怎么用?PHP tree::mk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree
的用法示例。
在下文中一共展示了tree::mk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
break;
case "get_content":
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : 0;
$node = explode(':', $node);
if (count($node) > 1) {
$rslt = array('content' => 'Multiple selected');
} else {
$temp = $fs->get_node((int) $node[0], array('with_path' => true));
$rslt = array('content' => 'Selected: /' . implode('/', array_map(function ($v) {
return $v['nm'];
}, $temp['path'])) . '/' . $temp['nm']);
}
break;
case 'create_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$temp = $fs->mk($node, isset($_GET['position']) ? (int) $_GET['position'] : 0, array('nm' => isset($_GET['text']) ? $_GET['text'] : 'New node'));
$rslt = array('id' => $temp);
break;
case 'rename_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$rslt = $fs->rn($node, array('nm' => isset($_GET['text']) ? $_GET['text'] : 'Renamed node'));
break;
case 'delete_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$rslt = $fs->rm($node);
break;
case 'move_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? (int) $_GET['parent'] : 0;
$rslt = $fs->mv($node, $parn, isset($_GET['position']) ? (int) $_GET['position'] : 0);
break;
示例2: isset
}
$title_en = isset($_POST['title_en']) && $_POST['title_en'] ? $_POST['title_en'] : '';
$tids = isset($_POST['tids']) && $_POST['tids'] ? $_POST['tids'] : '';
$summary = isset($_POST['summary']) && $_POST['summary'] ? $_POST['summary'] : '';
$content = isset($_POST['content']) && $_POST['content'] ? $_POST['content'] : '';
$params = array('title_en' => $title_en, 'tids' => $tids, 'summary' => $summary, 'content' => $content);
$res = $fs->set_node($id, $params);
if ($res) {
$rslt = array('resCode' => 0, 'resMsg' => '修改成功');
} else {
$rslt = array('resCode' => 1, 'resMsg' => '修改失败');
}
break;
case 'create_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$temp = $fs->mk($node, isset($_GET['position']) ? (int) $_GET['position'] : 0, array('title' => isset($_GET['text']) ? $_GET['text'] : 'New node'), isset($_GET['type']) ? $_GET['type'] : 'file');
$rslt = array('id' => $temp);
break;
case 'rename_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$rslt = $fs->rn($node, array('title' => isset($_GET['text']) ? $_GET['text'] : 'Renamed node'));
break;
case 'delete_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$rslt = $fs->rm($node);
break;
case 'move_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? (int) $_GET['id'] : 0;
$parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? (int) $_GET['parent'] : 0;
$rslt = $fs->mv($node, $parn, isset($_GET['position']) ? (int) $_GET['position'] : 0);
break;