Exemplo n.º 1
0
 /**
  * It was decided to use the overwritable _toHtml instead of a template
  * to be consistent with magento renderers and to increase portability
  * 
  * @return string
  */
 protected function _toHtml()
 {
     $html = parent::_toHtml();
     $html .= "<form id='{$this->getFormId()}' action='{$this->getFormAction()}' method='post' class='{$this->getFormClass()}' enctype='multipart/form-data'>";
     $minigrid = new BlueAcorn_MiniGrid_Block_System_Config_Form_Field_Minigrid();
     $html .= $minigrid->getElementHtml("ba-minigrid-form-grid", $this->getFieldName(), $this->getGridFields(), $this->getGridRowData());
     $html .= "\n            </form>\n            <script type='text/javascript'>\n                function submitMinigridForm() {\n                    \$('{$this->getFormId()}').submit();\n                }\n            </script>\n\n";
     return $html;
 }
Exemplo n.º 2
0
 /**
  * Do a few checks to see if the template should be rendered before actually rendering it.
  *
  * @return string
  *
  * @see Mage_Adminhtml_Block_Abstract::_toHtml()
  */
 protected function _toHtml()
 {
     $shipment = Mage::registry('current_shipment');
     $helper = Mage::helper('tig_myparcel');
     if (!$helper->isEnabled() || !$shipment || !$helper->shippingMethodIsMyParcel($shipment->getOrder()->getShippingMethod())) {
         return '';
     }
     return parent::_toHtml();
 }
Exemplo n.º 3
0
 /**
  * Set data to block
  *
  * @return string
  */
 protected function _toHtml()
 {
     $agreement = $this->_getBillingAgreement();
     $this->setReferenceId($agreement->getReferenceId());
     $customer = Mage::getModel('Mage_Customer_Model_Customer')->load($agreement->getCustomerId());
     $this->setCustomerUrl($this->getUrl('*/customer/edit', array('id' => $customer->getId())));
     $this->setCustomerEmail($customer->getEmail());
     $this->setStatus($agreement->getStatusLabel());
     $this->setCreatedAt($this->helper('Mage_Core_Helper_Data')->formatDate($agreement->getCreatedAt(), 'short', true));
     $this->setUpdatedAt($agreement->getUpdatedAt() ? $this->helper('Mage_Core_Helper_Data')->formatDate($agreement->getUpdatedAt(), 'short', true) : $this->__('N/A'));
     return parent::_toHtml();
 }
Exemplo n.º 4
0
 /**
  * Do a few checks to see if the template should be rendered before actually rendering it.
  *
  * @return string
  *
  * @see Mage_Adminhtml_Block_Abstract::_toHtml()
  */
 protected function _toHtml()
 {
     $shippingMethod = $this->_order->getShippingMethod();
     if (!$this->_helper->isEnabled() || !$this->_order || !$this->_helper->shippingMethodIsMyParcel($shippingMethod)) {
         return '';
     }
     return parent::_toHtml();
 }
 /**
  * _toHtml
  *
  * @return string
  */
 public function _toHtml()
 {
     return parent::_toHtml();
 }
Exemplo n.º 6
0
 /**
  * Check if a payment method can be found before rendering the template.
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (!$this->getPaymentMethod()) {
         return '';
     }
     return parent::_toHtml();
 }