function show_cat($cats, $prefix = "") { foreach ($cats as $c) { ?> <tr> <td><?php echo $prefix . $c['label']; ?> </td> <td><?php echo $c['slug']; ?> </td> <td> <a href="<?php echo site_url('admin_article/edit_category/' . $c['id']); ?> " rel="tooltip" title="Edit"><i class="icon-pencil"></i></a> <a href="<?php echo site_url('admin_article/delete_category/' . $c['id']); ?> " rel="tooltip" title="Delete" class="confirm"><i class="icon-remove"></i></a> </td> </tr> <?php if (!empty($c['children'])) { show_cat($c['children'], $prefix . "—"); } ?> <?php } }
function lists() { $item = v('item'); switch ($item) { case 'casecat': $data['contents'] = show_cat('yxy_casecat'); $data['h1title'] = '案例分类管理'; break; case 'caseslist': $data['contents'] = show_cases(); $data['h1title'] = '案例管理'; break; case 'lawcat': $data['contents'] = show_cat('yxy_lawcat'); $data['h1title'] = '法律法规分类管理'; break; case 'lawlist': $data['contents'] = show_laws(); $data['h1title'] = '法律法规管理'; break; case 'filecat': $data['contents'] = show_cat('yxy_filecat'); $data['h1title'] = '文档分类管理'; break; case 'filelist': $data['contents'] = show_files(); $data['filecat'] = get_all_filecat(); $data['h1title'] = '文档管理'; break; default: $data['contents'] = show_cases(); break; } $data['title'] = $data['top_title'] = '网站后台'; $data['itemname'] = $item; render($data, 'web', 'editcontent'); }