BxAccntConfig.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 Accounts Accounts
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxAccntConfig extends BxBaseModGeneralConfig
  12. {
  13. protected $_oDb;
  14. protected $_aHtmlIds;
  15. /**
  16. * Constructor
  17. */
  18. public function __construct($aModule)
  19. {
  20. parent::__construct($aModule);
  21. $this->CNF = array (
  22. // some params
  23. 'PARAM_PROFILE_NAME_LENGTH_MAX' => 10,
  24. 'PARAM_LA_SORTING' => 'bx_accounts_last_active_sorting',
  25. 'PARAM_EXPORT_TO' => 'bx_accounts_export_to',
  26. 'PARAM_EXPORT_FIELDS' => 'bx_accounts_export_fields',
  27. // page URIs
  28. 'URL_MANAGE_ADMINISTRATION' => 'page.php?i=accounts-administration',
  29. // objects
  30. 'OBJECT_STORAGE_FILES' => 'sys_files',
  31. 'OBJECT_FORM_ACCOUNT' => 'bx_accounts_account',
  32. 'OBJECT_FORM_ACCOUNT_DISPLAY_SETTINGS_EMAIL' => 'bx_accounts_account_settings_email',
  33. 'OBJECT_FORM_ACCOUNT_DISPLAY_CREATE' => 'bx_accounts_account_create',
  34. 'OBJECT_MENU_MANAGE_TOOLS' => 'bx_accounts_menu_manage_tools', //manage menu in content administration tools
  35. 'OBJECT_GRID_ADMINISTRATION' => 'bx_accounts_administration',
  36. 'OBJECT_GRID_MODERATION' => 'bx_accounts_moderation',
  37. // some language keys
  38. 'T' => array (
  39. 'grid_action_msg_delete_scheduled' => '_bx_accnt_grid_action_msg_delete_scheduled',
  40. 'grid_action_err_delete' => '_bx_accnt_grid_action_err_delete',
  41. 'grid_action_err_perform' => '_bx_accnt_grid_action_err_perform',
  42. 'filter_item_active' => '_bx_accnt_grid_filter_item_title_adm_active',
  43. 'filter_item_operators' => '_bx_accnt_grid_filter_item_title_adm_operators',
  44. 'filter_item_pending' => '_bx_accnt_grid_filter_item_title_adm_pending',
  45. 'filter_item_suspended' => '_bx_accnt_grid_filter_item_title_adm_suspended',
  46. 'filter_item_unconfirmed' => '_bx_accnt_grid_filter_item_title_adm_unconfirmed',
  47. 'filter_item_locked' => '_bx_accnt_grid_filter_item_title_adm_locked',
  48. 'filter_item_without_profile' => '_bx_accnt_grid_filter_item_title_adm_without_profile',
  49. 'filter_item_select_one_filter1' => '_bx_accnt_grid_filter_item_title_adm_select_one_filter1',
  50. 'filter_item_select_one_filter2' => '_bx_accnt_grid_filter_item_title_adm_select_one_filter2',
  51. )
  52. );
  53. $this->_aObjects = array(
  54. 'alert' => $this->_sName,
  55. );
  56. $this->_aJsClasses = array(
  57. 'main' => 'BxAccntMain',
  58. 'manage_tools' => 'BxAccntManageTools'
  59. );
  60. $this->_aJsObjects = array(
  61. 'main' => 'oBxAccntMain',
  62. 'manage_tools' => 'oBxAccntManageTools'
  63. );
  64. $this->_aGridObjects = array(
  65. 'moderation' => $this->CNF['OBJECT_GRID_MODERATION'],
  66. 'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
  67. );
  68. $sHtmlPrefix = str_replace('_', '-', $this->_sName);
  69. $this->_aHtmlIds = array(
  70. 'profile' => $sHtmlPrefix . '-profile-',
  71. 'profile_more_popup' => $sHtmlPrefix . '-profile-more-popup-',
  72. 'password_text' => $sHtmlPrefix . '-txt-password',
  73. 'password_button' => $sHtmlPrefix . '-btn-copy',
  74. 'password_popup' => $sHtmlPrefix . '-password-popup',
  75. );
  76. }
  77. public function init(&$oDb)
  78. {
  79. $this->_oDb = &$oDb;
  80. }
  81. public function isLastActiveSorting()
  82. {
  83. return getParam($this->CNF['PARAM_LA_SORTING']) == 'on';
  84. }
  85. public function getHtmlIds($sKey = '')
  86. {
  87. if(empty($sKey))
  88. return $this->_aHtmlIds;
  89. return isset($this->_aHtmlIds[$sKey]) ? $this->_aHtmlIds[$sKey] : '';
  90. }
  91. }
  92. /** @} */