BxAntispamStudioPage.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 Antispam Antispam
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. require_once ('BxAntispamStudioOptions.php');
  12. class BxAntispamStudioPage extends BxTemplStudioModule
  13. {
  14. protected $oModule;
  15. function __construct($sModule, $mixedPageName, $sPage = "")
  16. {
  17. parent::__construct($sModule, $mixedPageName, $sPage);
  18. $this->oModule = BxDolModule::getInstance('bx_antispam');
  19. $this->aMenuItems = array(
  20. 'settings' => array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
  21. 'ip_table' => array('name' => 'ip_table', 'icon' => 'align-justify', 'title' => '_bx_antispam_ip_table', 'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-ip-table'))),
  22. 'dnsbl_list' => array('name' => 'dnsbl_list', 'icon' => 'align-justify', 'title' => '_bx_antispam_dnsbl_list', 'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-dnsbl-list'))),
  23. 'block_log' => array('name' => 'block_log', 'icon' => 'far clock', 'title' => '_bx_antispam_block_log', 'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-block-log'))),
  24. 'help' => array('name' => 'help', 'icon' => 'question', 'title' => '_bx_antispam_help'),
  25. );
  26. }
  27. protected function getSettings()
  28. {
  29. $oOptions = new BxAntispamStudioOptions($this->sModule);
  30. $this->aPageCss = array_merge($this->aPageCss, $oOptions->getCss());
  31. $this->aPageJs = array_merge($this->aPageJs, $oOptions->getJs());
  32. return BxDolStudioTemplate::getInstance()->parseHtmlByName('module.html', [
  33. 'content' => $oOptions->getCode(),
  34. ]);
  35. }
  36. protected function getHelp ()
  37. {
  38. return _t('_bx_antispam_help_text');
  39. }
  40. }
  41. /** @} */