00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Core_Block_Html_Date extends Mage_Core_Block_Template
00036 {
00037
00038 protected function _toHtml()
00039 {
00040 $html = '<input type="text" name="' . $this->getName() . '" id="' . $this->getId() . '" ';
00041 $html .= 'value="'.$this->getValue().'" class="'.$this->getClass().'" style="width:100px" '.$this->getExtraParams().'/> ';
00042
00043 $html .= '<img src="' . $this->getImage() . '" alt="" class="v-middle" ';
00044 $html .= 'title="' . $this->helper('core')->__('Select Date') . '" id="' . $this->getId() . '_trig" />';
00045
00046 $html .=
00047
00048 '<script type="text/javascript">
00049 Calendar.setup({
00050 inputField : "' . $this->getId() . '",
00051 ifFormat : "' . $this->getFormat() . '",
00052 button : "' . $this->getId() . '_trig",
00053 align : "Bl",
00054 singleClick : true
00055 });
00056 </script>';
00057
00058
00059 return $html;
00060 }
00061
00062 public function getEscapedValue($index=null) {
00063
00064 if($this->getFormat() && $this->getValue()) {
00065 return strftime($this->getFormat(), strtotime($this->getValue()));
00066 }
00067
00068 return htmlspecialchars($this->getValue());
00069 }
00070
00071 public function getHtml()
00072 {
00073 return $this->toHtml();
00074 }
00075
00076 }