本文整理汇总了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'] . ' <a href="' . $page_path . '" style="top: 0;" class="ico ico16 ico_goto" title="Посмотреть на сайте"> </a>';
}
$page_tree[$row['page_parent']][$row['page_id']] = $row;
}
s::tree('page_tree', $page_tree);
}
示例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'] . ' <a href="' . $page_path . '" class="ico11 icoRoundArrow" title="Посмотреть на сайте"> </a>';
$page_tree[$row['page_parent']][$row['page_id']] = $row;
}
s::tree('map_tree', $page_tree);
}
示例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);
}
示例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\');"> </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);
}