protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     if ($columnName == "template") {
         $collection = Mage::getResourceModel('core/email_template_collection')->load();
         $arr_select = $collection->toOptionArray();
         array_unshift($arr_select, array('label' => Mage::helper('rewardpoints')->__('Default'), 'value' => ''));
         return $this->_getTemplateRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:260px"')->setOptions($arr_select)->toHtml();
     } else {
         if ($columnName == "sender") {
             $arr_select = array();
             $config = Mage::getSingleton('adminhtml/config')->getSection('trans_email')->groups->children();
             foreach ($config as $node) {
                 $nodeName = $node->getName();
                 $label = (string) $node->label;
                 $sortOrder = (int) $node->sort_order;
                 $arr_select[$sortOrder] = array('value' => preg_replace('#^ident_(.*)$#', '$1', $nodeName), 'label' => Mage::helper('adminhtml')->__($label));
             }
             ksort($arr_select);
             /*array_unshift(
                   $arr_select,
                   array(
                       'label' => Mage::helper('rewardpoints')->__('Default'),
                       'value' => ''
                   )
               );*/
             return $this->_getSenderRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:260px"')->setOptions($arr_select)->toHtml();
         }
     }
     return parent::_renderCellTemplate($columnName);
 }
Exemple #2
0
 /**
  * Render array cell for prototypeJS template
  *
  * @param string $columnName
  * @return string
  */
 protected function _renderCellTemplate($columnName)
 {
     if ($columnName == 'value' && isset($this->_columns[$columnName])) {
         $element = new Varien_Data_Form_Element_Select();
         $element->setForm($this->getForm())->setName($this->_getCellInputElementName($columnName))->setHtmlId($this->_getCellInputElementId('#{_id}', $columnName))->setValues(Mage::getModel('Mage_Core_Model_Design_Source_Design')->getAllOptions(false));
         return str_replace("\n", '', $element->getElementHtml());
     }
     return parent::_renderCellTemplate($columnName);
 }
 protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     if ($columnName == "attribute") {
         return $this->_getAttributeRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:160px"')->setOptions($this->getElement()->getValues())->toHtml();
     } elseif ($columnName == "datafield") {
         return $this->_getDatafieldRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:160px"')->setOptions(Mage::getModel('ddg_automation/adminhtml_source_datafields')->toOptionArray())->toHtml();
     }
     return parent::_renderCellTemplate($columnName);
 }
 protected function _renderCellTemplate($columnName)
 {
     if (!empty($this->_columns[$columnName]) && $this->_columns[$columnName]['renderer']) {
         $column = $this->_columns[$columnName];
         $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
         $html = $column['renderer']->setColumn($column)->setColumnName($columnName)->setInputName($inputName)->toHtml();
         return $this->jsQuoteEscape($html);
     }
     return parent::_renderCellTemplate($columnName);
 }
 protected function _renderCellTemplate($columnName)
 {
     if ($columnName == "code") {
         return $this->_renderAttributesDropdown();
     }
     if ($columnName == "category_id") {
         return $this->_renderCategoriesDropdown();
     }
     return parent::_renderCellTemplate($columnName);
 }
Exemple #6
0
 protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     if ($columnName == "payment_method") {
         return $this->_getPaymentRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:260px"')->setClass('validate-select')->setOptions(Mage::getModel("adminhtml/system_config_source_payment_allowedmethods")->toOptionArray(NULL))->toHtml();
     } elseif ($columnName == "fee") {
         $this->_columns[$columnName]['class'] = 'input-text required-entry validate-number';
         $this->_columns[$columnName]['style'] = 'width:50px';
     }
     return parent::_renderCellTemplate($columnName);
 }
Exemple #7
0
 /**
  * overide method _renderCellTemplate in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
  * this is needed to display custom dynamic fieldset and inject custom element
  *
  * @see Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
  *
  * @param string $columnName
  *
  * @return void
  */
 protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     switch ($columnName) {
         case 'type':
             return $this->_getTypeRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:50px"')->setOptions($this->getElement()->getValues())->toHtml();
             break;
         default:
             return parent::_renderCellTemplate($columnName);
             break;
     }
 }
 protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     if ($columnName == "process_once") {
         $arr_select = array(array("label" => Mage::helper('rewardpoints')->__('No'), "value" => "0"), array("label" => Mage::helper('rewardpoints')->__('Yes'), "value" => "1"));
         return $this->_getProcessOnceRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:60px"')->setOptions($arr_select)->toHtml();
     }
     if ($columnName == "model_id") {
         $arr_select = array(array("label" => Mage::helper('rewardpoints')->__('No'), "value" => "0"), array("label" => Mage::helper('rewardpoints')->__('Yes'), "value" => "1"));
         return $this->_getModelIdRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:60px"')->setOptions($arr_select)->toHtml();
     }
     return parent::_renderCellTemplate($columnName);
 }
 /**
  * Render array cell for prototypeJS template
  *
  * @param string $columnName
  * @return string
  */
 protected function _renderCellTemplate($columnName)
 {
     if (empty($this->_columns[$columnName])) {
         throw new Exception('Wrong column name specified.');
     }
     $column = $this->_columns[$columnName];
     $elementName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     $extraParams = ' data-value="#{' . $columnName . '}" ' . (isset($column['style']) ? ' style="' . $column['style'] . '"' : '');
     if ($columnName == 'installments') {
         return $this->getInstallmentsSelectHtml($elementName, $extraParams);
     }
     return parent::_renderCellTemplate($columnName);
 }
 protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     if ($columnName == "template") {
         return $this->_getTemplateRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:160px"')->setOptions($this->getElement()->getValues())->toHtml();
     } elseif ($columnName == "sendtype") {
         return $this->_getSendtypeRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:160px"')->setOptions(Mage::getModel('email_connector/adminhtml_source_transactional_sendtype')->toOptionArray())->toHtml();
     } elseif ($columnName == "datafield") {
         return $this->_getDatafieldRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:160px"')->setOptions(Mage::getModel('email_connector/adminhtml_source_transactional_campaigns')->toOptionArray())->toHtml();
     } elseif ($columnName == "fromaddress") {
         return $this->_getFromadddressRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:160px"')->setOptions(Mage::getModel('email_connector/adminhtml_source_transactional_fromaddress')->toOptionArray())->toHtml();
     }
     return parent::_renderCellTemplate($columnName);
 }
 protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     if ($columnName == "calculation_type_referrer" || $columnName == "calculation_type_referred") {
         /*$arr_select = array(
               array("label" => Mage::helper('rewardpoints')->__('No'), "value" => "0"),
               array("label" => Mage::helper('rewardpoints')->__('Yes'), "value" => "1")
           );*/
         $arr_select = Mage::getModel('rewardpoints/calculationtype')->toOptionArray();
         return $this->_getCalculationTypeReferrerRenderer()->setName($inputName)->setTitle($columnName)->setExtraParams('style="width:80px"')->setOptions($arr_select)->toHtml();
     }
     if ($columnName == "date_from" || $columnName == "date_end") {
         return $this->_getDateRenderer()->setName($inputName)->setTitle($columnName)->setImage(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . '/adminhtml/default/default/images/grid-cal.gif')->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT))->setExtraParams('style="width:65px"')->toHtml();
     }
     return parent::_renderCellTemplate($columnName);
 }
 protected function _renderCellTemplate($columnName)
 {
     $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
     if ($columnName == "group_id") {
         $collection = Mage::getResourceModel('customer/group_collection')->load();
         $arr_select = $collection->toOptionArray();
         return $this->_getCustomerGroupRenderer($columnName)->setName($inputName . '[]')->setTitle($columnName)->setExtraParams('style="width:90px"')->setIsMultiSelect(1)->setOptions($arr_select)->setClass("j2t_customdelivery_countries")->setExtraParams('multiple="multiple" size="5"')->toHtml();
         /*return $this->_getCustomerGroupRenderer()
           ->setName($inputName)
           ->setTitle($columnName)
           ->setIsMultiSelect(1)
           ->setExtraParams('style="width:180px" multiple="multiple" size="5"')
           ->setOptions($arr_select)
           ->toHtml();*/
     }
     if ($columnName == "date_from" || $columnName == "date_end") {
         return $this->_getDateRenderer()->setName($inputName)->setTitle($columnName)->setImage(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . '/adminhtml/default/default/images/grid-cal.gif')->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT))->setExtraParams('style="width:110px"')->toHtml();
     }
     return parent::_renderCellTemplate($columnName);
 }
Exemple #13
0
 /**
  *
  * My renderer does need parameters that are not supported by original implementation
  *
  * @param string $columnName
  * @return ITwebexperts_Payperrentals_Block_Adminhtml_Global_Dates_Excluded
  * @throws Exception
  */
 protected function _renderCellTemplate($_columnName)
 {
     $_inputName = $this->getElement()->getName() . '[#{_id}][' . $_columnName . ']';
     $_block = $this->_getFieldBlock($_columnName);
     if ($_block !== false) {
         $_block->setName($_inputName)->setTitle($_columnName)->setId('exclude_dates_row_#{_id}_' . $_columnName);
         if ($_columnName == 'disabled_from' || $_columnName == 'disabled_to') {
             $_block->setValue('#{' . $_columnName . '}');
         }
         return $this->_jsStringEscapeForHtml($_block->toHtml());
     } else {
         return parent::_renderCellTemplate($_columnName);
     }
 }