Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Cache.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Backend\Block;
7 
12 class Cache extends \Magento\Backend\Block\Widget\Grid\Container
13 {
19  protected function _construct()
20  {
21  $this->_controller = 'cache';
22  $this->_headerText = __('Cache Storage Management');
23  parent::_construct();
24  $this->buttonList->remove('add');
25 
26  if ($this->_authorization->isAllowed('Magento_Backend::flush_magento_cache')) {
27  $this->buttonList->add(
28  'flush_magento',
29  [
30  'label' => __('Flush Magento Cache'),
31  'onclick' => 'setLocation(\'' . $this->getFlushSystemUrl() . '\')',
32  'class' => 'primary flush-cache-magento'
33  ]
34  );
35  }
36 
37  if ($this->_authorization->isAllowed('Magento_Backend::flush_cache_storage')) {
38  $message = __('The cache storage may contain additional data. Are you sure that you want to flush it?');
39  $this->buttonList->add(
40  'flush_system',
41  [
42  'label' => __('Flush Cache Storage'),
43  'onclick' => 'confirmSetLocation(\'' . $message . '\', \'' . $this->getFlushStorageUrl() . '\')',
44  'class' => 'flush-cache-storage'
45  ]
46  );
47  }
48  }
49 
55  public function getFlushStorageUrl()
56  {
57  return $this->getUrl('adminhtml/*/flushAll');
58  }
59 
65  public function getFlushSystemUrl()
66  {
67  return $this->getUrl('adminhtml/*/flushSystem');
68  }
69 }
__()
Definition: __.php:13
$message