BxDolInstallController.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. function actionPermissions ()
  47. {
  48. $this->_oView->pageStart();
  49. $oAdmTools = new BxDolStudioTools();
  50. $sPermissionsStyles = $oAdmTools->generateStyles();
  51. ob_start();
  52. $bPermissionsOk = $oAdmTools->checkPermissions();
  53. $sPermissionsTable = ob_get_clean();
  54. $this->_oView->out('permissions.php', compact('sPermissionsStyles', 'sPermissionsTable', 'bPermissionsOk'));
  55. $this->_oView->pageEnd('Dolphin 8.0.0 Installation');
  56. }
  57. }
  58. /** @} */