BxBaseFormWiki.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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 UnaBaseView UNA Base Representation Classes
  7. * @{
  8. */
  9. /**
  10. * Wiki Form
  11. */
  12. class BxBaseFormWiki extends BxTemplFormView
  13. {
  14. public function __construct($aInfo, $oTemplate)
  15. {
  16. parent::__construct($aInfo, $oTemplate);
  17. if (isset($this->aInputs['lang']))
  18. $this->aInputs['lang']['values'] = BxDolLanguages::getInstance()->getLanguages(false, true);
  19. if (isset($this->aInputs['content']))
  20. $this->aInputs['content']['code'] = true;
  21. }
  22. function genLabel(&$aInput)
  23. {
  24. if (isset($aInput['label']) && $aInput['label'] && ('lang' == $aInput['name'] || 'content_main' == $aInput['name'])) {
  25. $sInputID = $this->getInputId($aInput);
  26. return '<label for="' . $sInputID . '">' . $aInput['label'] . '</label>';
  27. }
  28. return parent::genLabel($aInput);
  29. }
  30. }
  31. /** @} */