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


PHP s::tree方法代码示例

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


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

示例1: cache

 function cache()
 {
     admin::components('shiftable');
     db::table('pages');
     db::where('site_id', ADMIN_SITE_ID);
     db::where('page_pub', '2', '!=');
     db::order('page_map');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         if ($row['page_cache'] == '1') {
             $row['page_cache'] = ' checked="checked"';
         } else {
             $row['page_cache'] = '';
         }
         if ($row['page_folder'] == '/') {
             $page_path = 'http://' . ADMIN_SITE;
         } else {
             $page_path = 'http://' . ADMIN_SITE . '' . $row['page_folder'];
         }
         $row['page_line'] = $row['page_title'];
         if ($row['page_dynamic'] == '0') {
             $row['page_line'] = $row['page_line'] . '&nbsp;<a href="' . $page_path . '" style="top: 0;" class="ico ico16 ico_goto" title="Посмотреть на сайте">&nbsp;</a>';
         }
         $page_tree[$row['page_parent']][$row['page_id']] = $row;
     }
     s::tree('page_tree', $page_tree);
 }
开发者ID:rigidus,项目名称:ea,代码行数:27,代码来源:map.module.php

示例2: show

 function show()
 {
     db::table('pages');
     db::where('site_id', SITE_ID);
     db::where('page_pub', '1');
     db::where('page_map', '1');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         if ($row['page_map'] == '1') {
             $row['page_map'] = ' checked="checked"';
         } else {
             $row['page_map'] = '';
         }
         if ($row['page_folder'] == '/') {
             $page_path = 'http://' . SITE;
         } else {
             $page_path = 'http://' . SITE . '' . $row['page_folder'];
         }
         $row['page_line'] = $row['page_title'] . '&nbsp;&nbsp;<a href="' . $page_path . '" class="ico11 icoRoundArrow" title="Посмотреть на сайте">&nbsp;</a>';
         $page_tree[$row['page_parent']][$row['page_id']] = $row;
     }
     s::tree('map_tree', $page_tree);
 }
开发者ID:rigidus,项目名称:ea,代码行数:23,代码来源:map.handler.php

示例3: showPoints

 function showPoints($menu_id = false)
 {
     if (!$menu_id) {
         $menu_id = params::get('menu_id');
     }
     $menu_tree = array();
     db::table('menus_points');
     db::where('menu_id', $menu_id);
     db::order('point_order');
     $res = db::select();
     if (db::rows() == 0) {
         buffer::setTmpl();
         return false;
     }
     while ($row = mysql_fetch_assoc($res)) {
         if ($row['point_pub'] == '1') {
             $row['point_pub'] = '_pub';
         } else {
             $row['point_pub'] = '_unpub';
         }
         $menu_tree[$row['point_parent']][$row['point_id']] = $row;
     }
     s::tree('menu_tree', $menu_tree);
 }
开发者ID:rigidus,项目名称:ea,代码行数:24,代码来源:main.module.php

示例4: view

 function view()
 {
     admin::components('livesearch', 'shiftable');
     self::clearGarbage();
     $arr = array();
     $arr_parents = array();
     /*
     	Check empty child
     */
     db::table('pages');
     db::where('site_id', ADMIN_SITE_ID);
     db::where('page_pub', '2', '!=');
     db::where('page_folder', '/', '!=');
     $res = db::select('page_id', 'page_parent', 'page_child');
     while ($row = mysql_fetch_assoc($res)) {
         $arr[$row['page_parent']][$row['page_id']] = $row;
         if ($row['page_child'] == '1') {
             $arr_parents[$row['page_id']] = true;
         }
     }
     foreach ($arr_parents as $k => $v) {
         if (isset($arr[$k])) {
             unset($arr_parents[$k]);
         }
     }
     unset($arr);
     if ($arr_parents) {
         db::table('pages');
         foreach ($arr_parents as $k => $v) {
             db::where('page_id', $k);
         }
         db::update('page_child', '0');
     }
     unset($arr_parents);
     /*
     	Load page tree
     */
     $page_tree = array();
     db::table('pages');
     db::where('site_id', ADMIN_SITE_ID);
     db::where('page_pub', '2', '!=');
     db::order('page_map');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         if ($row['page_pub'] == '1') {
             $row['page_pub'] = '_pub';
         } else {
             $row['page_pub'] = '_unpub';
         }
         if ($row['page_dynamic'] == '0') {
             $row['goto_page'] = true;
         }
         if ($row['page_folder'] == '/') {
             $row['index_page'] = true;
             $row['page_path'] = 'http://' . ADMIN_SITE;
         } else {
             $row['add_page'] = true;
             $row['page_path'] = 'http://' . ADMIN_SITE . '' . $row['page_folder'];
             if ($row['page_child'] == '1') {
                 $row['parent_pages'] = true;
                 if (cookie::coll_call('page_tree', $row['page_id'])) {
                     $row['open_close'] = '_open';
                 } else {
                     $row['open_close'] = '_close';
                 }
                 $row['page_ico'] = '<a href="javascript:void(null);" class="ico ico11 ico_folder' . $row['open_close'] . '" onclick="new ElementController.toggle(' . $row['page_id'] . ', \'tree_' . $row['page_id'] . '\', this, \'page_tree\');">&nbsp;</a>';
             } else {
                 $row['all_pages'] = true;
             }
         }
         $row['page_line'] = '<a href="' . SYS_DIR . 'pages/main/edit/' . $row['page_id'] . '/" title="Редактировать" class="page_link">' . $row['page_title'] . '</a>';
         $page_tree[$row['page_parent']][$row['page_id']] = $row;
     }
     s::tree('page_tree', $page_tree);
 }
开发者ID:rigidus,项目名称:ea,代码行数:75,代码来源:main.module.php


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