1: <?php
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: class Mage_Adminhtml_Block_Review_Main extends Mage_Adminhtml_Block_Widget_Grid_Container
36: {
37: public function __construct()
38: {
39: $this->_addButtonLabel = Mage::helper('review')->__('Add New Review');
40: parent::__construct();
41:
42: $this->_controller = 'review';
43:
44:
45: $customerId = $this->getRequest()->getParam('customerId', false);
46: $customerName = '';
47: if ($customerId) {
48: $customer = Mage::getModel('customer/customer')->load($customerId);
49: $customerName = $customer->getFirstname() . ' ' . $customer->getLastname();
50: $customerName = $this->escapeHtml($customerName);
51: }
52: $productId = $this->getRequest()->getParam('productId', false);
53: $productName = null;
54: if ($productId) {
55: $product = Mage::getModel('catalog/product')->load($productId);
56: $productName = $this->escapeHtml($product->getName());
57: }
58:
59: if( Mage::registry('usePendingFilter') === true ) {
60: if ($customerName) {
61: $this->_headerText = Mage::helper('review')->__('Pending Reviews of Customer `%s`', $customerName);
62: } else {
63: $this->_headerText = Mage::helper('review')->__('Pending Reviews');
64: }
65: $this->_removeButton('add');
66: } else {
67: if ($customerName) {
68: $this->_headerText = Mage::helper('review')->__('All Reviews of Customer `%s`', $customerName);
69: } elseif ($productName) {
70: $this->_headerText = Mage::helper('review')->__('All Reviews of Product `%s`', $productName);
71: } else {
72: $this->_headerText = Mage::helper('review')->__('All Reviews');
73: }
74: }
75: }
76: }
77: