Passed
Push — master ( 621302...15a517 )
by Angel Fernando Quiroz
16:26 queued 07:49
created

CustomFooterPlugin::get_name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Description of Custom Footer.
5
 *
6
 * @copyright (c) 2014 VF Consulting
7
 * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
8
 * @author Valery Fremaux <[email protected]>
9
 */
10
class CustomFooterPlugin extends Plugin
11
{
12
    protected function __construct()
13
    {
14
        parent::__construct('1.1', 'Valery Fremaux');
15
    }
16
17
    /**
18
     * @return CustomFooterPlugin
19
     */
20
    public static function create()
21
    {
22
        static $result = null;
23
24
        return $result ?: $result = new self();
25
    }
26
27
    public function pix_url($pixname, $size = 16)
28
    {
29
        global $_configuration;
30
31
        if (file_exists(
32
            $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png'
33
        )) {
34
            return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.png';
35
        }
36
        if (file_exists(
37
            $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.jpg'
38
        )) {
39
            return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.jpg';
40
        }
41
        if (file_exists(
42
            $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.gif'
43
        )) {
44
            return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.gif';
45
        }
46
47
        return $_configuration['root_web'].'/main/img/icons/'.$size.'/'.$pixname.'.png';
48
    }
49
}
50