GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 2.9 ( 7343d3...e1b57e )
by Thorsten
16:48
created

PMF_Helper_Linkverifier::linkOndemandJavascript()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 34
rs 8.8571
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
/**
3
 * Linkverifier Helper class for phpMyFAQ.
4
 *
5
 * PHP Version 5.5
6
 *
7
 * This Source Code Form is subject to the terms of the Mozilla Public License,
8
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
9
 * obtain one at http://mozilla.org/MPL/2.0/.
10
 *
11
 * @category  phpMyFAQ
12
 * @author    Thorsten Rinne <[email protected]>
13
 * @copyright 2012-2015 phpMyFAQ Team
14
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
15
 * @link      http://www.phpmyfaq.de
16
 * @since     2012-09-03
17
 */
18
if (!defined('IS_VALID_PHPMYFAQ')) {
19
    exit();
20
}
21
22
/**
23
 * PMF_Helper_Linkverifier.
24
 *
25
 * @category  phpMyFAQ
26
 * @author    Thorsten Rinne <[email protected]>
27
 * @copyright 2012-2015 phpMyFAQ Team
28
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
29
 * @link      http://www.phpmyfaq.de
30
 * @since     2012-09-03
31
 */
32
class PMF_Helper_Linkverifier extends PMF_Helper
33
{
34
    /**
35
     * Prints JavaScript needed for AJAX verification on record add/save/clicked on listing.
36
     *
37
     * @param int    $id
38
     * @param string $lang
39
     */
40
    public static function linkOndemandJavascript($id, $lang)
41
    {
42
        ?>
43
    <script type="text/javascript">
44
        function ajaxOnDemandVerify(id, lang)
45
        {
46
            var target = $('#onDemandVerifyResult');
47
            var url = 'index.php';
48
            var pars = 'action=ajax&ajax=onDemandURL&id=' + id + '&artlang=' + lang + '&lookup=1';
49
            var myAjax = new jQuery.ajax({url: url,
50
                type: 'get',
51
                data: pars,
52
                complete: ajaxOnDemandVerify_success,
53
                error: ajaxOnDemandVerify_failure});
54
            //TODO: Assign string
55
            target.innerHTML = 'Querying LinkVerifier...';
56
57
            function ajaxOnDemandVerify_success(XmlRequest)
58
            {
59
                target.html(XmlRequest.responseText);
60
            }
61
62
            function ajaxOnDemandVerify_failure(XmlRequest)
63
            {
64
                //TODO: Assign string
65
                target.html('LinkVerifier failed (url probe timed out?)');
66
            }
67
        }
68
69
        ajaxOnDemandVerify(<?php echo $id ?>, '<?php echo $lang ?>');
70
71
    </script>
72
    <?php
73
    }
74
}
75