/
Log.php
102 lines (77 loc) · 2.65 KB
/
Log.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/*
* @author M2E Pro Developers Team
* @copyright 2011-2015 ESS-UA [M2E Pro]
* @license Commercial use is forbidden
*/
namespace Ess\M2ePro\Block\Adminhtml\Ebay\Listing;
use Ess\M2ePro\Block\Adminhtml\Magento\Grid\AbstractContainer;
class Log extends AbstractContainer
{
//########################################
public function _construct()
{
parent::_construct();
// Initialization block
// ---------------------------------------
$this->setId('ebayListingLog');
$this->_controller = 'adminhtml_ebay_listing_log';
// ---------------------------------------
// Set buttons actions
// ---------------------------------------
$this->removeButton('back');
$this->removeButton('reset');
$this->removeButton('delete');
$this->removeButton('add');
$this->removeButton('save');
$this->removeButton('edit');
// ---------------------------------------
}
//########################################
public function getListingId()
{
return $this->getRequest()->getParam('id', false);
}
// ---------------------------------------
/** @var \Ess\M2ePro\Model\Listing $listing */
protected $listing = NULL;
/**
* @return \Ess\M2ePro\Model\Listing|null
*/
public function getListing()
{
if (is_null($this->listing)) {
$this->listing = $this->activeRecordFactory->getObjectLoaded('Listing', $this->getListingId());
}
return $this->listing;
}
//########################################
public function getListingProductId()
{
return $this->getRequest()->getParam('listing_product_id', false);
}
// ---------------------------------------
/** @var \Ess\M2ePro\Model\Listing\Product $listingProduct */
protected $listingProduct = NULL;
/**
* @return \Ess\M2ePro\Model\Listing\Product|null
*/
public function getListingProduct()
{
if (is_null($this->listingProduct)) {
$this->listingProduct = $this->activeRecordFactory
->getObjectLoaded('Listing\Product', $this->getListingProductId());
}
return $this->listingProduct;
}
//########################################
protected function _beforeToHtml()
{
// ---------------------------------------
if (!$this->getListingId() && !$this->getListingProductId()) {
$this->setTemplate('Ess_M2ePro::magento/grid/container/only_content.phtml');
}
// ---------------------------------------
}
//########################################
}