~cjsmo/ampache/ampache

« back to all changes in this revision

Viewing changes to lib/class/ajax.class.php

  • Committer: Afterster
  • Date: 2015-11-07 07:09:23 UTC
  • mfrom: (3952.1.1)
  • Revision ID: git-v1:88b4662919026b030698448b7cdf6c8dc0cb9897
Merge branch 'Psy-Virus-develop' into develop

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
            $source_txt = "'#$source'";
63
63
        }
64
64
 
65
 
        $observe = "<script type=\"text/javascript\">";
 
65
        $observe   = "<script type=\"text/javascript\">";
66
66
        $methodact = (($method == 'click') ? "update_action();" : "");
67
67
        if (AmpConfig::get('ajax_load') && $method == 'load') {
68
68
            $source_txt = "$( document ).ready(";
69
69
        } else {
70
 
            $source_txt = "$(".$source_txt.").on('".$method."', ";
 
70
            $source_txt = "$(" . $source_txt . ").on('" . $method . "', ";
71
71
        }
72
72
        if (!empty($confirm)) {
73
 
            $observe .= $source_txt . "function(){ ".$methodact." if (confirm(\"".$confirm."\")) { ".$action." }});";
 
73
            $observe .= $source_txt . "function(){ " . $methodact . " if (confirm(\"" . $confirm . "\")) { " . $action . " }});";
74
74
        } else {
75
 
            $observe .= $source_txt . "function(){ ".$methodact." ".$action.";});";
 
75
            $observe .= $source_txt . "function(){ " . $methodact . " " . $action . ";});";
76
76
        }
77
77
        $observe .= "</script>";
78
78
 
140
140
 
141
141
        // If they passed a span class
142
142
        if ($class) {
143
 
            $class = ' class="'.$class.'"';
 
143
            $class = ' class="' . $class . '"';
144
144
        }
145
145
 
146
146
        $string = UI::get_icon($icon, $alt);
148
148
        // Generate an <a> so that it's more compliant with older
149
149
        // browsers (ie :hover actions) and also to unify linkbuttons
150
150
        // (w/o ajax) display
151
 
        $string = "<a href=\"javascript:void(0);\" id=\"$source\" $class>".$string."</a>\n";
 
151
        $string = "<a href=\"javascript:void(0);\" id=\"$source\" $class>" . $string . "</a>\n";
152
152
 
153
153
        $string .= self::observe($source, 'click', $ajax_string, $confirm);
154
154