BxXeroStudioPage.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Xero Xero
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. require_once ('BxXeroStudioOptions.php');
  12. class BxXeroStudioPage extends BxTemplStudioModule
  13. {
  14. protected $_sModule;
  15. protected $_oModule;
  16. function __construct($sModule, $mixedPageName, $sPage = "")
  17. {
  18. $this->_sModule = 'bx_xero';
  19. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  20. parent::__construct($sModule, $mixedPageName, $sPage);
  21. $this->aMenuItems['authorize'] = ['name' => 'authorize', 'icon' => 'sign-in-alt', 'title' => '_bx_xero_lmi_cpt_authorize'];
  22. }
  23. protected function getSettings()
  24. {
  25. $oOptions = new BxXeroStudioOptions($this->sModule);
  26. $this->aPageCss = array_merge($this->aPageCss, $oOptions->getCss());
  27. $this->aPageJs = array_merge($this->aPageJs, $oOptions->getJs());
  28. return BxDolStudioTemplate::getInstance()->parseHtmlByName('module.html', array(
  29. 'content' => $oOptions->getCode(),
  30. ));
  31. }
  32. protected function getAuthorize()
  33. {
  34. $this->_oModule->_oTemplate->addStudioCss(['main.css']);
  35. $this->_oModule->_oTemplate->addStudioJs(['main.js']);
  36. return $this->_oModule->_oTemplate->getBlockAuthorize(bx_get('code'));
  37. }
  38. }
  39. /** @} */