EmptyAction.class.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. if(!defined("Ainaphp")) exit("Access Denied");
  3. class EmptyAction extends Action
  4. {
  5. public function _empty()
  6. {
  7. //空操作 空模块
  8. if(MODULE_NAME!='Urlrule'){
  9. $Mod = F('Mod');
  10. if(!$Mod[MODULE_NAME]){
  11. throw_exception('404');
  12. }
  13. }
  14. $a=ACTION_NAME;
  15. $id = intval($_REQUEST['id']);
  16. $catid = intval($_REQUEST['catid']);
  17. $moduleid = intval($_REQUEST['moduleid']);
  18. if(MODULE_NAME=='Urlrule'){
  19. if(APP_LANG){
  20. $l =get_safe_replace($_REQUEST['l']);
  21. $lang= $l ? '_'.$l : '_'.C('DEFAULT_LANG');
  22. }
  23. $catdir =get_safe_replace($_REQUEST['catdir']);
  24. if($catdir){
  25. $Cat = F('Cat'.$lang);
  26. $catid = $catid ? $catid : $Cat[$catdir];
  27. unset($Cat);
  28. }
  29. if($_REQUEST['module']){
  30. $m=get_safe_replace($_REQUEST['module']);
  31. }elseif($moduleid){
  32. $Module =F('Module');
  33. $m=$Module[$moduleid]['module'];
  34. unset($Module);
  35. }elseif($catid){
  36. $Category = F('Category'.$lang);
  37. $m=$Category[$catid]['module'];
  38. unset($Category);
  39. }else{
  40. throw_exception('404');
  41. }
  42. if($a=='index') $id=$catid;
  43. }else{
  44. if(empty($id)){
  45. $Cat = F('Cat'.$lang);
  46. $id = $Cat[$id];
  47. unset($Cat);
  48. }
  49. $m=MODULE_NAME;
  50. }
  51. import('@.Action.Base');
  52. $bae=new BaseAction();
  53. if(!method_exists($bae,$a)){
  54. throw_exception('404');
  55. }
  56. $bae->$a($id,$m);
  57. }
  58. }
  59. ?>