PageRenderTime 38ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/jinbo51/DiscuzX
PHP | 45 lines | 32 code | 7 blank | 6 comment | 7 complexity | 5de88c4d510a428256ffe99368d659f5 MD5 | raw file
Possible License(s): BSD-3-Clause
  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 32489 2013-01-29 03:57:16Z monkey $
  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. ?>