PageRenderTime 35ms CodeModel.GetById 5ms RepoModel.GetById 1ms app.codeStats 0ms

/source/plugin/mobile/extends/mobile_extends_list.php

https://github.com/kuaileshike/upload
PHP | 45 lines | 32 code | 7 blank | 6 comment | 7 complexity | 8d5625346b8b83b58508c7cdd18255e0 MD5 | raw file
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: mobile_extends_list.php 31964 2012-10-26 07:27:36Z zhangjie $
  7. */
  8. class mobile_api {
  9. public $extendsclass;
  10. public $modulelist;
  11. function common() {
  12. $this->modulelist = array('dz_newthread', 'dz_digest', 'dz_newreply', 'dz_newpic');
  13. if(!in_array($_GET['identifier'], $this->modulelist)) {
  14. mobile_core::result(array('error' => 'identifier_not_exists'));
  15. }
  16. include_once 'source/plugin/mobile/extends/mobile_extends_data.php';
  17. $extendsfilename = "./source/plugin/mobile/extends/module/".$_GET['identifier'].".php";
  18. if(empty($_GET['identifier'])) {
  19. mobile_core::result(array('error' => 'identifier_not_exists'));
  20. } else if(!file_exists($extendsfilename)) {
  21. mobile_core::result(array('error' => 'identifier_file_not_exists'));
  22. } else {
  23. require_once $extendsfilename;
  24. if(!class_exists($_GET['identifier'])) {
  25. mobile_core::result(array('error' => 'identifier_file_not_exists'));
  26. }
  27. $this->extendsclass = new $_GET['identifier'];
  28. if(method_exists($this->extendsclass, 'common')) {
  29. $this->extendsclass->common();
  30. }
  31. }
  32. }
  33. function output() {
  34. $variable = $this->extendsclass->output();
  35. mobile_core::result(mobile_core::variable($variable));
  36. }
  37. }
  38. ?>