control.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /**
  3. * The control file of index module of ZenTaoPMS.
  4. *
  5. * When requests the root of a website, this index module will be called.
  6. *
  7. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  8. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  9. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  10. * @package ZenTaoPMS
  11. * @version $Id: control.php 5036 2013-07-06 05:26:44Z wyd621@gmail.com $
  12. * @link https://www.zentao.net
  13. */
  14. class index extends control
  15. {
  16. /**
  17. * Construct function, load project, product.
  18. *
  19. * @access public
  20. * @return void
  21. */
  22. public function __construct()
  23. {
  24. parent::__construct();
  25. }
  26. /**
  27. * The index page of whole zentao system.
  28. *
  29. * @param string $open base64 encode string.
  30. * @access public
  31. * @return void
  32. */
  33. public function index($open = '')
  34. {
  35. if($this->app->getViewType() == 'mhtml') $this->locate($this->createLink('my', 'index'));
  36. if($this->get->open) $open = $this->get->open;
  37. $latestVersionList = array();
  38. if(isset($this->config->global->latestVersionList)) $latestVersionList = json_decode($this->config->global->latestVersionList, true);
  39. $this->view->title = $this->lang->index->common;
  40. $this->view->open = helper::safe64Decode($open);
  41. $this->view->showFeatures = $this->indexZen->checkShowFeatures();
  42. $this->view->latestVersionList = $latestVersionList;
  43. $this->view->appsItems = commonModel::getMainNavList($this->app->rawModule);
  44. $this->view->allAppsItems = commonModel::getMainNavList($this->app->rawModule, true);
  45. $this->view->browserMessage = $this->loadModel('message')->getBrowserMessageConfig();
  46. $this->view->zaiConfig = $this->loadModel('zai')->getSetting();
  47. $this->display();
  48. }
  49. /**
  50. * 在框架中打开具体页面。
  51. * Open url in index frame.
  52. *
  53. * @param string $open base64 encode string.
  54. * @access public
  55. * @return void
  56. */
  57. public function app($open = '')
  58. {
  59. $this->view->defaultUrl = helper::safe64Decode($open);
  60. $this->display();
  61. }
  62. /**
  63. * 通过 iframe 的形式打开对话框。
  64. * Open url in iframe modal.
  65. *
  66. * @param string $url base64 encode string.
  67. * @access public
  68. * @return void
  69. */
  70. public function ajaxIframeModal($url = '')
  71. {
  72. $this->view->url = helper::safe64Decode($url);
  73. $this->display();
  74. }
  75. /**
  76. * Get the log record according to the version.
  77. *
  78. * @param string $version
  79. * @access public
  80. * @return void
  81. */
  82. public function changeLog($version = '')
  83. {
  84. $latestVersionList = json_decode($this->config->global->latestVersionList);
  85. $version = $latestVersionList->$version;
  86. $this->view->version = $version;
  87. $this->display();
  88. }
  89. /**
  90. * Ajax get view method for asset lib by object type.
  91. *
  92. * @param int $objectID
  93. * @param string $objectType
  94. * @access public
  95. * @return void
  96. */
  97. public function ajaxGetViewMethod($objectID, $objectType)
  98. {
  99. $method = $this->indexZen->getViewMethodForAssetLib($objectID, $objectType);
  100. return print($method);
  101. }
  102. }