_getElementHtml()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 *
5
 *
6
 * @category Mygento
7
 * @package Mygento_Geoip
8
 * @copyright 2014 NKS LLC. (https://www.mygento.ru)
9
 */
10
class Mygento_Geoip_Block_System_Config_Status extends Mage_Adminhtml_Block_System_Config_Form_Field
11
{
12
13
    public function render(Varien_Data_Form_Element_Abstract $element)
14
    {
15
        $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
16
        return parent::render($element);
17
    }
18
19
    /**
20
     *
21
     * @param Varien_Data_Form_Element_Abstract $element
22
     * @return string
23
     *
24
     * @SuppressWarnings("unused")
25
     */
26
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
27
    {
28
        $info = Mage::getModel('geoip/info');
29
        if ($date = $info->getDatFileDownloadDate()) {
30
            $format = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
31
            $date = Mage::app()->getLocale()->date(intval($date))->toString($format);
32
        } else {
33
            $date = '-';
34
        }
35
        return '<div id="sync_update_date">' . $date . '</div>';
36
    }
37
}
38