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