BxTemplFormView.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  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 UnaTemplate UNA Template Classes
  7. * @{
  8. */
  9. class BxTemplFormView extends BxBaseFormView
  10. {
  11. function __construct($aInfo, $oTemplate = false)
  12. {
  13. parent::__construct($aInfo, $oTemplate);
  14. }
  15. //TODO: genWrapperInput and isHtmlEditor methods can be removed after RC9 is released.
  16. function genWrapperInput($aInput, $sContent)
  17. {
  18. $sAttr = isset($aInput['attrs_wrapper']) && is_array($aInput['attrs_wrapper']) ? bx_convert_array2attrs($aInput['attrs_wrapper']) : '';
  19. return "<div class=\"bx-form-input-wrapper bx-form-input-wrapper-{$aInput['type']}" . ((isset($aInput['html']) && $aInput['html'] && $this->isHtmlEditor($aInput['html'], $aInput)) ? ' bx-form-input-wrapper-html' : '') . "\" $sAttr>$sContent</div>";
  20. }
  21. function isHtmlEditor($iViewMode, &$aInput)
  22. {
  23. return BxDolEditor::getObjectInstance(false, $this->oTemplate) !== false;
  24. }
  25. }
  26. /** @} */