BxDolInstallController.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinInstall Dolphin Install
  7. * @{
  8. */
  9. class BxDolInstallController
  10. {
  11. protected $_oView;
  12. function __construct()
  13. {
  14. $this->_oView = new BxDolInstallView();
  15. }
  16. function run ($sAction = '')
  17. {
  18. $sMethod = 'action' . ucfirst($sAction);
  19. if ($sAction && method_exists($this, $sMethod))
  20. $this->$sMethod ();
  21. else
  22. $this->actionInitial ();
  23. }
  24. function actionAudit ()
  25. {
  26. $this->_oView->pageStart();
  27. $oAudit = new BxDolStudioToolsAudit();
  28. $sAuditOutput = $oAudit->generate();
  29. $this->_oView->out('audit.php', compact('sAuditOutput'));
  30. $this->_oView->pageEnd('Dolphin 8.0.0 Installation');
  31. }
  32. function actionInitial ()
  33. {
  34. $this->_oView->pageStart();
  35. $aLangs = BxDolInstallLang::getInstance()->getAvailableLanguages();
  36. $oAudit = new BxDolStudioToolsAudit();
  37. $aErrors = $oAudit->checkRequirements(BX_DOL_AUDIT_FAIL);
  38. $aWarnings = $oAudit->checkRequirements(BX_DOL_AUDIT_WARN);
  39. $oAudit->generateStyles();
  40. if (empty($aErrors))
  41. $this->_oView->out('initial.php', compact('aLangs', 'aWarnings'));
  42. else
  43. $this->_oView->out('initial_fail.php', compact('aLangs', 'aErrors'));
  44. $this->_oView->pageEnd('Dolphin 8.0.0 Installation');
  45. }
  46. }
  47. /** @} */