当前位置: 首页>>代码示例>>PHP>>正文


PHP tree::getPosition方法代码示例

本文整理汇总了PHP中tree::getPosition方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::getPosition方法的具体用法?PHP tree::getPosition怎么用?PHP tree::getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tree的用法示例。


在下文中一共展示了tree::getPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionIndex

 public function actionIndex($parentid = 0)
 {
     $folder = zotop::model('system.folder');
     if (form::isPostBack()) {
         $post = form::post();
         foreach ((array) $post['id'] as $i => $id) {
             $folder->update(array('order' => $i + 1), $id);
         }
         if (!$folder->error()) {
             msg::success('保存成功', zotop::url('system/folder/index'));
         }
         msg::error($folder->msg());
     }
     $folders = $folder->getAll();
     $tree = new tree($folders, 0);
     $rows = $tree->getChild($parentid);
     $position = $tree->getPosition($parentid);
     foreach ($position as $p) {
         $pos[zotop::url('system/folder/index/' . $p['id'])] = $p['title'];
     }
     $page = new page();
     $page->set('title', zotop::t('文件管理'));
     $page->set('navbar', $this->navbar($parentid));
     $page->set('position', array(zotop::url('system/file') => zotop::t('文件管理'), zotop::url('system/folder') => zotop::t('分类管理')) + (array) $pos + array('列表'));
     $page->set('folders', $folders);
     $page->set('rows', $rows);
     $page->set('hash', $hash);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:29,代码来源:folder.php

示例2: position

 public function position($id = '', $template = '')
 {
     $id = empty($id) ? $this->id : $id;
     $nodes = $this->getAll();
     $tree = new tree($nodes);
     $position = $tree->getPosition($id);
     if (empty($template)) {
         return $position;
     }
     $str = '';
     if (is_array($position)) {
         foreach ($position as $pos) {
             @extract($pos);
             eval("\$temp = \"{$template}\";");
             $str .= $temp;
         }
     }
     return $str;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:19,代码来源:config.php

示例3: actionIndex

 public function actionIndex($type = 'all', $folderid = 0)
 {
     $file = zotop::model('system.file');
     $folder = zotop::model('system.folder');
     if (!empty($type) && $type != 'all') {
         $where = array('file.type', '=', $type);
     }
     $files = $file->db()->select('file.*', 'user.name as user_name', 'user.username as user_username')->join('user', 'user.id', 'file.userid')->where($where)->orderby('file.createtime', 'desc')->getPage();
     //zotop::dump($file->db()->Sql());
     $types = $file->types();
     $pagination = new pagination();
     $pagination->page = $files['page'];
     $pagination->pagesize = $files['pagesize'];
     $pagination->total = $files['total'];
     $p = $pagination->render();
     $totalsize = $file->totalsize($where);
     $totalcount = $file->count();
     $folders = $folder->getAll();
     $tree = new tree($folders, 0);
     $position = $tree->getPosition($folderid);
     foreach ($position as $p) {
         $pos[zotop::url('system/file/index/' . $type . '/' . $p['id'])] = $p['title'];
     }
     $page = new page();
     $page->set('title', zotop::t('文件管理'));
     $page->set('position', array(zotop::url('system/file') => zotop::t('文件管理'), zotop::url('system/file/' . $type . '/0') => zotop::t('全部文件')) + (array) $pos + array('列表'));
     $page->set('navbar', $this->navbar());
     $page->set('page', $files['page']);
     $page->set('pagesize', $files['pagesize']);
     $page->set('total', $files['total']);
     $page->set('files', $files['data']);
     $page->set('totalsize', $totalsize);
     $page->set('totalcount', $totalcount);
     $page->set('pagination', $p);
     $page->set('types', $types);
     $page->set('type', $type);
     $page->set('folderid', $folderid);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:39,代码来源:file.php


注:本文中的tree::getPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。