BxFdbConfig.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 Feedback Feedback
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxFdbConfig extends BxBaseModGeneralConfig
  12. {
  13. function __construct($aModule)
  14. {
  15. parent::__construct($aModule);
  16. $this->CNF = array (
  17. // module icon
  18. 'ICON' => 'comment col-green3',
  19. // database tables
  20. 'TABLE_QUESTIONS' => $aModule['db_prefix'] . 'questions',
  21. 'TABLE_ANSWERS' => $aModule['db_prefix'] . 'answers',
  22. 'TABLE_ANSWERS2USERS' => $aModule['db_prefix'] . 'answers2users',
  23. // database fields
  24. 'FIELD_ID' => 'id',
  25. 'FIELD_AUTHOR' => 'author',
  26. 'FIELD_ADDED' => 'added',
  27. 'FIELD_CHANGED' => 'changed',
  28. 'FIELD_TEXT' => 'text',
  29. 'FIELD_ANSWERS' => 'answers',
  30. 'FIELD_STATUS_ADMIN' => 'status_admin',
  31. 'FIELD_ANS_ID' => 'id',
  32. 'FIELD_ANS_TITLE' => 'title',
  33. 'FIELD_ANS_IMPORTANT' => 'important',
  34. 'FIELD_ANS2USR_TEXT' => 'text',
  35. // page URIs
  36. // some params
  37. 'PARAM_QUESTIONS' => 'bx_feedback_enable_questions',
  38. 'PARAM_QUESTION_LIFETIME' => 'bx_feedback_question_lifetime',
  39. 'PARAM_ANSWER_NTF_IMPORTANT_ONLY' => 'bx_feedback_enable_answer_ntf_important_only',
  40. // objects
  41. 'OBJECT_FORM_QUESTION' => 'bx_feedback_question',
  42. 'OBJECT_FORM_QUESTION_DISPLAY_ADD' => 'bx_feedback_question_add',
  43. 'OBJECT_FORM_QUESTION_DISPLAY_EDIT' => 'bx_feedback_question_edit',
  44. 'OBJECT_FORM_QUESTION_DISPLAY_DELETE' => 'bx_feedback_question_delete',
  45. 'OBJECT_FORM_QUESTION_DISPLAY_VIEW' => 'bx_feedback_question_view',
  46. 'OBJECT_GRID_QUESTIONS' => 'bx_feedback_questions',
  47. // some language keys
  48. 'T' => array (
  49. 'txt_sample_question_single' => '_bx_feedback_txt_sample_question_single',
  50. 'txt_sample_question_single_with_article' => '_bx_feedback_txt_sample_question_single_with_article',
  51. 'txt_sample_answer_single' => '_bx_feedback_txt_sample_answer_single',
  52. 'txt_sample_answer_single_with_article' => '_bx_feedback_txt_sample_answer_single_with_article',
  53. //'txt_sample_answer_action' => '_bx_feedback_txt_sample_answer_action',
  54. ),
  55. );
  56. $this->_aJsClasses = array_merge($this->_aJsClasses, array(
  57. 'question' => 'BxFdbQuestion',
  58. ));
  59. $this->_aJsObjects = array_merge($this->_aJsObjects, array(
  60. 'question' => 'oBxFdbQuestion',
  61. ));
  62. $sPrefix = str_replace('_', '-', $this->_sName);
  63. $this->_aHtmlIds = array(
  64. 'question' => $sPrefix . '-question-',
  65. 'question_popup_add' => $sPrefix . '-question-popup-add',
  66. 'question_popup_edit' => $sPrefix . '-question-popup-edit'
  67. );
  68. $this->_aPrefixes = array(
  69. 'style' => 'bx-fdb',
  70. );
  71. }
  72. public function getHtmlIds($sKey = '')
  73. {
  74. if(empty($sKey))
  75. return $this->_aHtmlIds;
  76. return isset($this->_aHtmlIds[$sKey]) ? $this->_aHtmlIds[$sKey] : '';
  77. }
  78. /**
  79. * Notify about important Answers only.
  80. */
  81. public function isModeNio()
  82. {
  83. return getParam($this->CNF['PARAM_ANSWER_NTF_IMPORTANT_ONLY']) == 'on';
  84. }
  85. }
  86. /** @} */