mode_flowmenuAction.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. $pid = (int)$this->post('pid','0');
  14. if($pid>0){
  15. $this->showgetmenu($rows,0,1,1);
  16. $rows = $this->alldata;
  17. }
  18. return array(
  19. 'rows' => $rows
  20. );
  21. }
  22. private function showgetmenu($rows,$pid, $oi, $zt)
  23. {
  24. $zh = 0;
  25. foreach($rows as $k=>$rs){
  26. if($pid==$rs['pid']){
  27. $zh++;
  28. $rs['level'] = $oi;
  29. $zthui = $rs['status'];
  30. if($zt==0){
  31. $rs['ishui']=1;
  32. $zthui = 0;
  33. }
  34. $this->alldata[] = $rs;
  35. $len = count($this->alldata)-1;
  36. $cd = $this->showgetmenu($rows,$rs['id'], $oi+1, $zthui);
  37. $this->alldata[$len]['stotal']=$cd;
  38. }
  39. }
  40. return $zh;
  41. }
  42. }
粤ICP备19079148号