@@ 142-162 (lines=21) @@ | ||
139 | * @param string $jsFileName |
|
140 | * @return array |
|
141 | */ |
|
142 | private function setJavascriptFileCDNforHighCharts($jsFileName) |
|
143 | { |
|
144 | $patternFound = null; |
|
145 | $jQueryPosition = strpos($jsFileName, 'highcharts'); |
|
146 | if ($jQueryPosition !== false) { |
|
147 | $patternFound = [ |
|
148 | true, |
|
149 | implode('', [ |
|
150 | '//cdnjs.cloudflare.com/ajax/libs/highcharts/', |
|
151 | str_replace(['highcharts-', '.js'], '', pathinfo($jsFileName)['basename']), |
|
152 | '/highcharts.js', |
|
153 | ]), |
|
154 | implode('', [ |
|
155 | '<script>!window.Highcharts && document.write(\'<script src="', |
|
156 | filter_var($jsFileName, FILTER_SANITIZE_STRING), |
|
157 | '">\x3C/script>\')</script>' |
|
158 | ]) |
|
159 | ]; |
|
160 | } |
|
161 | return $patternFound; |
|
162 | } |
|
163 | ||
164 | /** |
|
165 | * Returns an array with CDN call of a known Javascript library |
|
@@ 172-192 (lines=21) @@ | ||
169 | * @param string $jsFileName |
|
170 | * @return array |
|
171 | */ |
|
172 | private function setJavascriptFileCDNforHighChartsExporting($jsFileName) |
|
173 | { |
|
174 | $patternFound = null; |
|
175 | $jQueryPosition = strpos($jsFileName, 'exporting'); |
|
176 | if ($jQueryPosition !== false) { |
|
177 | $patternFound = [ |
|
178 | true, |
|
179 | implode('', [ |
|
180 | '//cdnjs.cloudflare.com/ajax/libs/highcharts/', |
|
181 | str_replace(['exporting-', '.js'], '', pathinfo($jsFileName)['basename']), |
|
182 | '/modules/exporting.js', |
|
183 | ]), |
|
184 | implode('', [ |
|
185 | '<script>!window.Highcharts.post && document.write(\'<script src="', |
|
186 | filter_var($jsFileName, FILTER_SANITIZE_STRING), |
|
187 | '">\x3C/script>\')</script>' |
|
188 | ]) |
|
189 | ]; |
|
190 | } |
|
191 | return $patternFound; |
|
192 | } |
|
193 | ||
194 | /** |
|
195 | * Returns an array with CDN call of a known Javascript library |