MISModel.class.inc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /*
  3. * DON'T REMOVE THE FOLLOWING LICENSE
  4. * INFORMATION!
  5. * ----------------------------------
  6. * Copyright by
  7. * Global Cube Business Solutions
  8. * Author: Dennis Ritz
  9. * info@global-cube.de
  10. * 2007-2008
  11. * ----------------------------------
  12. */
  13. class MISModel extends App {
  14. public function __construct() {
  15. parent::__construct(__file__);
  16. }
  17. /*
  18. * init
  19. * ----
  20. * This function sets the main workaround for this class.
  21. */
  22. public function __init() {
  23. return $this->__MODEL();
  24. }
  25. /*
  26. * getModel
  27. * --------
  28. * This function sets the main HTML Base.
  29. * Please see manual for detail description.
  30. */
  31. public function getModel() {
  32. $MISConfig = new MISConfig();
  33. $projectDOM = new DOMDocument('1.0', 'utf-8');
  34. $projectDOM->load($MISConfig->getConfigFile());
  35. $projectXpath = new DOMXpath($projectDOM);
  36. $configName = $projectXpath->query("/Configuration")->item(0)->getAttribute("Name");
  37. $tpl = $this->Template();
  38. $tpl->assign("TITLE",$configName." - ".$this->_getI18N("title"));
  39. $tpl->assign("CONFIG",$configName);
  40. $tpl->assign("PUBLISHER","&copy;&nbsp;".$this->_getI18N("publisher"));
  41. $tpl->assign("LANG",$this->_getLang());
  42. if($this->getAuth())
  43. $tpl->assign("USER",$this->getUsername()." ".$this->_getI18N("logout"));
  44. else
  45. $tpl->assign("USER",$this->_getI18N("login"));
  46. print $tpl->fetch('model.html');
  47. }
  48. public function getHead() {
  49. global $Core;
  50. $p_args = func_get_args();
  51. $p_comp = array_shift($p_args);
  52. return $Core->callComp($p_comp,"getMain",$p_args);
  53. }
  54. public function getLeftbar() {
  55. global $Core;
  56. $p_args = func_get_args();
  57. $p_comp = array_shift($p_args);
  58. return $Core->callComp($p_comp,"getMain",$p_args);
  59. }
  60. public function getMain($p_comp = null) {
  61. if($this->getAuth()) {
  62. global $Core;
  63. $p_args = func_get_args();
  64. $p_comp = array_shift($p_args);
  65. $res = $Core->callComp($p_comp,"getMain",$p_args);
  66. return array(
  67. $res[0]
  68. ,'
  69. Browser.setDisplay(Browser.getElementById("leftdivider"),true);
  70. Browser.setDisplay(Browser.getElementById("leftbar"),true);
  71. xonresize();
  72. '.$res[1]);
  73. } elseif($p_comp == "MISAuth") {
  74. $MISAuth = new MISAuth();
  75. return $MISAuth->getMain();
  76. } else {
  77. return array(''
  78. ,'
  79. Browser.setDisplay(Browser.getElementById("leftdivider"),false);
  80. Browser.setDisplay(Browser.getElementById("leftbar"),false);
  81. xonresize();CMgr.getMODEL().getMain(\'MISAuth\');');
  82. }
  83. }
  84. public function getFoot() {
  85. return '&copy; Global Cube Business Solutions 2007-2008. All rights reserved. ';
  86. }
  87. public function getRetrieveInput(){
  88. if($this->getAuth()) {
  89. global $Core;
  90. $p_args = func_get_args();
  91. $p_comp = array_shift($p_args);
  92. $res = $Core->callComp($p_comp,"getRetrieveInput",$p_args);
  93. return array(
  94. $res[0]
  95. ,''.$res[1]);
  96. } else {
  97. return array(''
  98. ,'
  99. CMgr.getMODEL().__construct();
  100. ');
  101. }
  102. }
  103. }
  104. ?>