Ejemplo n.º 1
0
 /**
  * Date 'from-to' filter HTML with values
  *
  * @param Mage_Eav_Model_Entity_Attribute $attribute
  * @param mixed $value
  * @return string
  */
 protected function _getDateFromToHtmlWithValue(Mage_Eav_Model_Entity_Attribute $attribute, $value)
 {
     $dateBlock = new Mage_Core_Block_Html_Date(array('name' => $this->getFilterElementName($attribute->getAttributeCode()) . '[]', 'id' => $this->getFilterElementId($attribute->getAttributeCode()), 'class' => 'input-text input-text-range-date', 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), 'image' => $this->getSkinUrl('images/grid-cal.gif')));
     $fromValue = null;
     $toValue = null;
     if (is_array($value) && count($value) == 2) {
         $fromValue = $this->_helper->escapeHtml(reset($value));
         $toValue = $this->_helper->escapeHtml(next($value));
     }
     return '<strong>' . Mage::helper('Mage_ImportExport_Helper_Data')->__('From') . ':</strong>&nbsp;' . $dateBlock->setValue($fromValue)->getHtml() . '&nbsp;<strong>' . Mage::helper('Mage_ImportExport_Helper_Data')->__('To') . ':</strong>&nbsp;' . $dateBlock->setId($dateBlock->getId() . '_to')->setValue($toValue)->getHtml();
 }