BxBaseLabelForm.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. class BxBaseLabelForm extends BxTemplFormView
  10. {
  11. protected $_oObject;
  12. public function __construct($aInfo, $oTemplate)
  13. {
  14. parent::__construct($aInfo, $oTemplate);
  15. $this->_oObject = BxDolLabel::getInstance();
  16. switch($this->aParams['display']) {
  17. case 'sys_labels_select':
  18. $this->aInputs['action']['value'] = 'select_labels';
  19. break;
  20. }
  21. }
  22. public function initChecker($aValues = array(), $aSpecificValues = array())
  23. {
  24. return parent::initChecker($aValues, $aSpecificValues);
  25. }
  26. protected function genCustomInputSearch($aInput)
  27. {
  28. $aInput = array_merge($aInput, array(
  29. 'custom' => array(
  30. 'b_img' => false
  31. ),
  32. 'ajax_get_suggestions' => BX_DOL_URL_ROOT . bx_append_url_params('label.php', array(
  33. 'action' => 'labels_list',
  34. ))
  35. ));
  36. return $this->genCustomInputUsernamesSuggestions($aInput);
  37. }
  38. protected function genCustomInputList($aInput)
  39. {
  40. return $this->_oObject->getLabelsList($aInput, $this);
  41. }
  42. }
  43. /** @} */