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_Adminhtml_Block_System_Config_Form_Field_Import extends Varien_Data_Form_Element_Abstract
00036 {
00037
00038
00039
00040
00041
00042
00043 public function __construct($data)
00044 {
00045 parent::__construct($data);
00046 $this->setType('file');
00047 }
00048
00049
00050
00051
00052
00053
00054 public function getElementHtml()
00055 {
00056 $html = '';
00057
00058 $html .= '<input id="time_condition" type="hidden" name="'.$this->getName().'" value="'.time().'" />';
00059
00060 $html .= <<<EndHTML
00061 <script type="text/javascript">
00062 Event.observe($('carriers_tablerate_condition_name'), 'change', checkConditionName.bind(this));
00063 function checkConditionName(event)
00064 {
00065 var conditionNameElement = Event.element(event);
00066 if (conditionNameElement && conditionNameElement.id) {
00067 $('time_condition').value = '_' + conditionNameElement.value + '/' + Math.random();
00068 }
00069 }
00070 </script>
00071 EndHTML;
00072
00073 $html .= parent::getElementHtml();
00074
00075 return $html;
00076 }
00077
00078 }