本文整理汇总了PHP中Tree::get_treeview方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::get_treeview方法的具体用法?PHP Tree::get_treeview怎么用?PHP Tree::get_treeview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree::get_treeview方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
import('@.Rover.Tree');
$tree = new Tree();
$map['user_id'] = $this->uid;
$list = $this->categories->where($map)->order('listorder')->select();
$tree->init($list);
$_linkAddType = pdm_ux('add?typeid=');
$_linkViewType = pdm_ux('collect?typeid=');
$leaf = "<span><i class='glyphicon glyphicon-leaf'></i> \$title (\$sum)</span> <a href='{$_linkAddType}\$id'>添加密码</a> | <a href='{$_linkViewType}\$id'>查看密码</a>";
$folder = "<span><i class='glyphicon glyphicon-minus-sign'></i> \$title (\$sum)</span> <a href='{$_linkAddType}\$id'>添加密码</a> | <a href='{$_linkViewType}\$id'>查看密码</a>";
$html = $tree->get_treeview(0, 'myTree', $leaf, $folder);
$this->assign('html', $html);
$this->display();
}
示例2: index
function index()
{
import('@.Rover.Tree');
$tree = new Tree();
$map['user_id'] = $this->uid;
$list = $this->categories->where($map)->order('listorder')->select();
$tree->init($list);
$_linkAddType = pdm_ux('add?parent=');
$_linkEditType = pdm_ux('edit?id=');
$_linkDeleteType = pdm_ux('delete?id=');
$lanmu = "<span><i class='glyphicon glyphicon-leaf'></i> \$title (\$sum)</span> <a href='{$_linkAddType}\$id'>添加子类</a> | <a href='{$_linkEditType}\$id'>修改</a> | <a href='{$_linkDeleteType}\$id'>删除</a>";
$moji = "<span><i class='glyphicon glyphicon-minus-sign'></i> \$title (\$sum)</span> <a href='{$_linkAddType}\$id'>添加子类</a> | <a href='{$_linkEditType}\$id'>修改</a> | <a href='{$_linkDeleteType}\$id'>删除</a>";
$html = $tree->get_treeview(0, 'myTree', $lanmu, $moji);
$this->assign('html', $html);
$this->display();
}
示例3: public_categorys
/**
* 显示栏目菜单列表
*/
public function public_categorys()
{
//管理员uid
$uid = AppframeAction::$Cache['uid'];
$cache_class_list = S("cache_class_list_{$uid}");
if (!$cache_class_list) {
import('Tree');
$tree = new Tree();
//栏目权限 超级管理员例外
if (session(C("ADMIN_AUTH_KEY")) == "") {
$role_id = AppframeAction::$Cache['User']['role_id'];
$priv_result = M("Category_priv")->where(array("roleid" => $role_id, 'action' => 'init'))->select();
$priv_catids = array();
foreach ($priv_result as $_v) {
$priv_catids[] = $_v['catid'];
}
}
if (!empty($this->categorys)) {
foreach ($this->categorys as $r) {
if ($r['type'] == 2 && $r['child'] == 0) {
continue;
}
//只显示有init权限的,超级管理员除外
if (session(C("ADMIN_AUTH_KEY")) == "" && !in_array($r['catid'], $priv_catids)) {
$arrchildid = explode(',', $r['arrchildid']);
$array_intersect = array_intersect($priv_catids, $arrchildid);
if (empty($array_intersect)) {
continue;
}
}
$r['icon_type'] = $r['vs_show'] = '';
$r['type'] = 'classlist';
$r['add_icon'] = "<a target='right' href='" . U("Contents/Content/classlist", array("catid" => $r['catid'])) . "' onclick=javascript:openwinx('" . U("Contents/Content/add", array("catid" => $r['catid'])) . "','')><img src='" . AppframeAction::$Cache['Config']['siteurl'] . "statics/images/add_content.gif' alt='添加'></a> ";
$r['add_lists'] = "<a href='" . U("Contents/Content/classlist", array("catid" => $r['catid'])) . "' target='right' >" . $r['catname'] . "</a>";
$categorys[$r['catid']] = $r;
}
}
if (!empty($categorys)) {
$tree->init($categorys);
$strs = "<span class='\$icon_type'>\$add_icon\$add_lists</span>";
$strs2 = "<span class='folder'>\$catname</span>";
$categorys = $tree->get_treeview(0, 'category_tree', $strs, $strs2, $ajax_show);
} else {
$categorys = "该站点下面还没有栏目,请先添加栏目";
}
//缓存
S("cache_class_list_{$uid}", $categorys, 300);
} else {
$categorys = $cache_class_list;
}
$this->assign("categorys", $categorys);
$this->display();
}