Example #1
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $element->setFormat(Varien_Date::DATE_INTERNAL_FORMAT);
     //or other format
     $element->setImage($this->getSkinUrl('images/grid-cal.gif'));
     return parent::render($element);
 }
Example #2
0
 /**
  * Apply configuration specific for different element type
  *
  * @param string $inputType
  * @param Varien_Data_Form_Element_Abstract $element
  * @param Mage_Eav_Model_Entity_Attribute $attribute
  */
 protected function _applyTypeSpecificConfig($inputType, $element, Mage_Eav_Model_Entity_Attribute $attribute)
 {
     switch ($inputType) {
         case 'select':
             $element->setValues($attribute->getSource()->getAllOptions(true, true));
             break;
         case 'multiselect':
             $element->setValues($attribute->getSource()->getAllOptions(false, true));
             $element->setCanBeEmpty(true);
             break;
         case 'date':
             $element->setImage($this->getViewFileUrl('images/grid-cal.gif'));
             $element->setDateFormat(Mage::app()->getLocale()->getDateFormatWithLongYear());
             break;
         case 'multiline':
             $element->setLineCount($attribute->getMultilineCount());
             break;
         default:
             break;
     }
 }