BxMarketApiFormAddClients.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup MarketApi MarketApi
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. class BxMarketApiFormAddClients extends BxTemplFormView
  12. {
  13. protected $MODULE;
  14. protected $_oModule;
  15. function __construct()
  16. {
  17. $this->MODULE = 'bx_market_api';
  18. $this->_oModule = BxDolModule::getInstance($this->MODULE);
  19. $aCustomForm = array(
  20. 'form_attrs' => array(
  21. 'id' => 'bx-market-api-kands-add',
  22. 'name' => 'bx-market-api-kands-add',
  23. 'action' => BX_DOL_URL_ROOT . 'grid.php?' . bx_encode_url_params($_GET, array('ids', '_r')),
  24. 'method' => 'post',
  25. ),
  26. 'params' => array (
  27. 'db' => array(
  28. 'submit_name' => 'client_add',
  29. ),
  30. ),
  31. 'inputs' => array(
  32. 'user_id' => array(
  33. 'type' => 'hidden',
  34. 'name' => 'user_id',
  35. 'attrs' => array(
  36. 'id' => $this->_oModule->_oConfig->getHtmlIds('field_user_id'),
  37. ),
  38. 'db' => array (
  39. 'pass' => 'Int',
  40. ),
  41. ),
  42. 'user' => array(
  43. 'type' => 'text',
  44. 'name' => 'user',
  45. 'caption' => _t('_bx_market_api_user_id'),
  46. 'required' => true,
  47. 'attrs' => array(
  48. 'id' => $this->_oModule->_oConfig->getHtmlIds('field_user'),
  49. ),
  50. 'checker' => array (
  51. 'func' => 'avail',
  52. 'error' => _t ('_sys_adm_form_err_required_field'),
  53. ),
  54. 'db' => array (
  55. 'pass' => 'Xss',
  56. ),
  57. ),
  58. 'title' => array(
  59. 'type' => 'text',
  60. 'name' => 'title',
  61. 'caption' => _t('_Title'),
  62. 'required' => true,
  63. 'checker' => array (
  64. 'func' => 'avail',
  65. 'error' => _t ('_sys_adm_form_err_required_field'),
  66. ),
  67. 'db' => array (
  68. 'pass' => 'Xss',
  69. ),
  70. ),
  71. 'redirect_uri' => array(
  72. 'type' => 'text',
  73. 'name' => 'redirect_uri',
  74. 'caption' => _t('_bx_market_api_client_url'),
  75. 'required' => true,
  76. 'checker' => array (
  77. 'func' => 'avail',
  78. 'error' => _t ('_sys_adm_form_err_required_field'),
  79. ),
  80. 'db' => array (
  81. 'pass' => 'Xss',
  82. ),
  83. ),
  84. 'Submit' => array (
  85. 'type' => 'input_set',
  86. 0 => array (
  87. 'type' => 'submit',
  88. 'name' => 'client_add',
  89. 'value' => _t('_Submit'),
  90. ),
  91. 1 => array (
  92. 'type' => 'reset',
  93. 'name' => 'close',
  94. 'value' => _t('Close'),
  95. 'attrs' => array(
  96. 'onclick' => "$('.bx-popup-active').dolPopupHide()",
  97. 'class' => 'bx-def-margin-sec-left',
  98. ),
  99. ),
  100. ),
  101. ),
  102. );
  103. parent::__construct ($aCustomForm);
  104. }
  105. }
  106. /** @} */