BxEditorStudioPage.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 Editor integration
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxEditorStudioPage extends BxTemplStudioModule
  12. {
  13. protected $_sModule;
  14. protected $_oModule;
  15. function __construct($sModule, $mixedPageName, $sPage = "")
  16. {
  17. $this->_sModule = 'bx_editor';
  18. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  19. parent::__construct($sModule, $mixedPageName, $sPage);
  20. $this->aMenuItems = array(
  21. 'settings' => array('name' => 'mini', 'icon' => 'battery-empty', 'title' => '_bx_editor_mini'),
  22. 'standard' => array('name' => 'standard', 'icon' => 'battery-half', 'title' => '_bx_editor_standard'),
  23. 'full' => array('name' => 'full', 'icon' => 'battery-full', 'title' => '_bx_editor_full'),
  24. );
  25. }
  26. protected function getSettings()
  27. {
  28. return $this->getGrid('mini');
  29. }
  30. protected function getStandard()
  31. {
  32. return $this->getGrid('standard');
  33. }
  34. protected function getFull()
  35. {
  36. return $this->getGrid('full');
  37. }
  38. protected function getGrid($sMode)
  39. {
  40. $sGrid = 'bx_editor_toolbar';
  41. $oGrid = BxDolGrid::getObjectInstance($sGrid, BxDolStudioTemplate::getInstance());
  42. if(!$oGrid)
  43. return '';
  44. return $oGrid->getCode();
  45. }
  46. }
  47. /** @} */