mobile_extends_list.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 33590 2013-07-12 06:39:08Z andyzheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class mobile_api {
  12. public $extendsclass;
  13. public $modulelist;
  14. function common() {
  15. $this->modulelist = array('dz_newthread', 'dz_digest', 'dz_newreply', 'dz_newpic');
  16. if(!in_array($_GET['identifier'], $this->modulelist)) {
  17. mobile_core::result(array('error' => 'identifier_not_exists'));
  18. }
  19. include_once 'source/plugin/mobile/extends/mobile_extends_data.php';
  20. $extendsfilename = "./source/plugin/mobile/extends/module/".$_GET['identifier'].".php";
  21. if(empty($_GET['identifier'])) {
  22. mobile_core::result(array('error' => 'identifier_not_exists'));
  23. } else if(!file_exists($extendsfilename)) {
  24. mobile_core::result(array('error' => 'identifier_file_not_exists'));
  25. } else {
  26. require_once $extendsfilename;
  27. if(!class_exists($_GET['identifier'])) {
  28. mobile_core::result(array('error' => 'identifier_file_not_exists'));
  29. }
  30. $this->extendsclass = new $_GET['identifier'];
  31. if(method_exists($this->extendsclass, 'common')) {
  32. $this->extendsclass->common();
  33. }
  34. }
  35. }
  36. function output() {
  37. $variable = $this->extendsclass->output();
  38. mobile_core::result(mobile_core::variable($variable));
  39. }
  40. }
  41. ?>