mode_flowmenuAction.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * 此文件是流程模块【flowmenu.菜单管理】对应控制器接口文件。
  4. */
  5. class mode_flowmenuClassAction extends inputAction{
  6. protected function savebefore($table, $arr, $id, $addbo){
  7. }
  8. protected function saveafter($table, $arr, $id, $addbo){
  9. }
  10. public $alldata = array();
  11. protected function storeafter($table, $rows)
  12. {
  13. $this->db->update('[Q]menu', '`status`=1' , '`id` in(1,2) and `status`=0');//总有一些人把系统菜单给停用了
  14. $pid = (int)$this->post('pid','0');
  15. if($pid>0){
  16. $this->showgetmenu($rows,0,1,1);
  17. $rows = $this->alldata;
  18. }
  19. return array(
  20. 'rows' => $rows
  21. );
  22. }
  23. private function showgetmenu($rows,$pid, $oi, $zt)
  24. {
  25. $zh = 0;
  26. foreach($rows as $k=>$rs){
  27. if($pid==$rs['pid']){
  28. $zh++;
  29. $rs['level'] = $oi;
  30. $zthui = $rs['status'];
  31. if($zt==0){
  32. $rs['ishui']=1;
  33. $zthui = 0;
  34. }
  35. $this->alldata[] = $rs;
  36. $len = count($this->alldata)-1;
  37. $cd = $this->showgetmenu($rows,$rs['id'], $oi+1, $zthui);
  38. $this->alldata[$len]['stotal']=$cd;
  39. }
  40. }
  41. return $zh;
  42. }
  43. }
粤ICP备19079148号