Dashboard.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace Dotdigitalgroup\Email\Block\Adminhtml;
  3. /**
  4. * Dashboard block
  5. *
  6. * @api
  7. */
  8. class Dashboard extends \Magento\Backend\Block\Widget\Container
  9. {
  10. /**
  11. * @var string
  12. */
  13. public $_template = 'dashboard/main.phtml';
  14. /**
  15. * Dashboard constructor
  16. *
  17. * @return void
  18. */
  19. public function _construct()
  20. {
  21. $this->_controller = 'adminhtml_dashboard';
  22. $this->_headerText = __('Dashboard');
  23. parent::_construct();
  24. /**
  25. * Contact sync.
  26. */
  27. $this->buttonList->add(
  28. 'contact_sync',
  29. [
  30. 'label' => __('Run Contact Sync'),
  31. 'class' => 'primary'
  32. ]
  33. );
  34. /**
  35. * Importer sync.
  36. */
  37. $this->buttonList->add(
  38. 'importer_sync',
  39. [
  40. 'label' => __('Run Importer Sync'),
  41. 'class' => 'primary'
  42. ]
  43. );
  44. }
  45. /**
  46. * @return string
  47. */
  48. public function getContactSyncLink()
  49. {
  50. return $this->getUrl('dotdigitalgroup_email/run/contactsync');
  51. }
  52. /**
  53. * @return string
  54. */
  55. public function getImporterLink()
  56. {
  57. return $this->getUrl('dotdigitalgroup_email/run/importersync');
  58. }
  59. }