USPhoneNumberField::Field()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
class USPhoneNumberField extends TextField
4
{
5
6
    /**
7
     * Includes the JavaScript neccesary for this field to work using the {@link Requirements} system.
8
     */
9
    public static function include_js()
10
    {
11
        Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
12
        Requirements::javascript('us_phone_number/javascript/USPhoneNumber.js');
13
        Requirements::themedCSS('USPhoneNumber', 'us_phone_number');
14
    }
15
16
    public function Field($properties = array())
17
    {
18
        $this->addExtraClass('text');
19
        $return = parent::Field($properties = array());
20
        self::include_js();
21
        return $return;
22
    }
23
}
24