當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tree::get_treeview方法代碼示例

本文整理匯總了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();
 }
開發者ID:wsunxa,項目名稱:pdm,代碼行數:15,代碼來源:PasswordAction.class.php

示例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();
 }
開發者ID:tanaer,項目名稱:pdm,代碼行數:16,代碼來源:CategoriesAction.class.php

示例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();
 }
開發者ID:BGCX262,項目名稱:ztoa-svn-to-git,代碼行數:56,代碼來源:ContentAction.class.php


注:本文中的Tree::get_treeview方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。